Extension when using a profile-template

All notes and input on 2.0 Development are herein. <ul><li>Feature requests</li>
<li>Bug Reports</li>
<li>Beta Testing Feedback</li>
<li>Open Dev Discussion</li></ul>

Moderator: Coranto Moderator Team

Extension when using a profile-template

Postby Parahead » Wed Aug 06, 2003 8:25 am

Encountered a small problem when using templates in a profile. I lack the possibility to be able to specify an extension of the outputfile, in the current version (v1.20) it is locked down to allways be .html

My hope would be to see a new field in the Profiles Settings page under the headline "Advanced Profile Settings" which said "File Extension", just as it is in the Maginot Line-addon.


Regards,
/Parahead
User avatar
Parahead
 
Posts: 4837
Joined: Fri Jan 12, 2007 8:54 pm
Location: Stockholm - Sweden

Postby kriko » Wed Aug 06, 2003 8:35 am

Change settings -> Archive file extension.


Developers: This has to be made clearer. Really!
Kristjan aka. kriko
now a wireless expert
User avatar
kriko
 
Posts: 3328
Joined: Sat Feb 24, 2007 8:13 pm

Postby Parahead » Wed Aug 06, 2003 9:21 am

Hi Kriko!

Thanks, Yes, I know that it is possible to change this in Administration -> Change Settings -> Archive HTML file extension, but the problem is that then you change it for *all* profiles, I have a certain profile which I would like to publish WAP-news to.

And I really don´t think it should be that way anyhow, when you think about it, what has ordinary templates to do with how you archive the news. Anyway, I have made a fix in my installation of Coranto (v1.20) so it is working for me now to specify an individual extension for each profile where I use a template.

It really is only 3 lines of code, so I publish it here so the core-developers can add it if they want... I use the version 1.20 Final.

In cradmin.pl, after line 144, add:
Code: Select all
['tmplfileext', 'Template Output Extension', "Choose a file extension to use for all static pages generated by this profile. <b>Leave blank</b> to use the default: <b>$CConfig{'ArcHtmlExt'}</b>  Only necessary if an HTML template has been specified in the previous setting."],


In crcore.pl, replace line 1345 with these *two* lines instead:
Code: Select all
my $filext = $newsprofiles{$i}->{'tmplfileext'} || $CConfig{'ArcHtmlExt'};
my $fh = CRopen(">$ProfFilePath{$i}/$i.$filext");
User avatar
Parahead
 
Posts: 4837
Joined: Fri Jan 12, 2007 8:54 pm
Location: Stockholm - Sweden

Postby kriko » Wed Aug 06, 2003 2:20 pm

oh, very cool and thanks for your nice code!

This really should be included in the next release, again thanks :)
Kristjan aka. kriko
now a wireless expert
User avatar
kriko
 
Posts: 3328
Joined: Sat Feb 24, 2007 8:13 pm

Postby Parahead » Wed Aug 06, 2003 2:30 pm

No problem... :-)

If the code is included into the core it should be noted that for example the Maginot addon creates it´s own profile-page and should therefore also add the line abow that goes into cradmin.pl to match this change, but that is up to Plushpuffin in that case...
User avatar
Parahead
 
Posts: 4837
Joined: Fri Jan 12, 2007 8:54 pm
Location: Stockholm - Sweden

Postby cerberos76_ » Wed Aug 06, 2003 6:56 pm

Parahead,
the functionality you require has already been embedded in the core a while ago (it is in cr 1.2.1) with some more bug fixes/small improvements. It was decided to leave this new set of changes out for the moment from 1.20 to have finally a stable release before changing anything else....

The necessary changes to obtain the custom extention were also included in the extractor readme in July so that anyone could start implementing that in the meantime...

Maginot has already its own file extension parameter and does not use the one from the standard profile. What are the changes do you see necessary? and why?

If you need cr 1.2.1 check out:
http://www.-.com/public/crt/coranto_1_2_1.zip
(but be careful this is not tested and has significant changes in the build routine...)

BTW:
here is the log file for that release to see what was changed from 1.11 (ie. 1.20):

Version 1.2.1 (21 July 2003)
- Small revisions in the documentation - cerberos76
- Added custom name and extension for the profile html-template driven (static) files for standard profiles - cerberos76

Version 1.2.0 (20 July 2003)
- Written readme documentation on Coranto (what it is etc) - cerberos76
- Updated the setup.html file (server requirements) - cerberos76
- Added the Style and Addon Guide in the zip file - cerberos76
- Added a list with most of the current Coranto Addons in the zip file - cerberos76
- Improved the set-up routine (crsetup.pl), to support servers without writing permission in the cgi directory - cerberos76
- Corrected the three official addons in the zip to be both privacy compleiant and back-compatible - cerberos76
- Fixed Build News bug with profile .txt files building (now done one at a time and not anynmore zeroing all of them at the start of the build which caused file loss) - cerberos76
- Removed the links to http://www.amphibianweb.com (site now in the hands of cybersquatters) and substituted with links to http://coranto.org/forum/. Now the options are: '0' => 'No link' (default), '1' => 'Link pointing to Unofficial Site', '2' => 'Link pointing to Coranto Support Forum ', '3' => 'Text without link' - cerberos76
- Added css styles in the button calls submit and reset (i.e. replaced ==type="submit"== with ==type="submit" class="inputsubmit"==
==type="reset"== with ==type="reset" class="inputreset"==
(so reset buttons can be hidden) - cerberos76
Coranto addons:
* GuestPost, one click guestposting
* MoveIt!, Advanced Backup and site transfer
* PartialRebuild, CPU-friendly enhancement of FullBuild
* URLColumn, URLs for multiple Categories/Profiles
* Tickit!, Javascript News Tickers/Faders for Coranto!
* AddonEnabler, enables or disables single, multiple or all addons in one go
* SubmitMultiple, post consecutive news in an automatic loop!
* RSSAdvanced, RelatedNews ....

Get them at: http://coranto.gweilo.org/addons/
cerberos76_
 
Posts: 1339
Joined: Sun Mar 10, 2002 1:21 am

Postby Parahead » Wed Aug 06, 2003 8:14 pm

OK, I see, sorry I didn´t investigate it more deeply before posting... So it wasn´t that cool code after all... ;-)

Anyway, the thing with Maginot is that (as you already mentioned), it has it´s own set of parameters but the first "normal" settings under "Main Profile Settings" and "Advanced Profile Settings" it has to "mimic" to look the same as a normal profile.

So if a field is added under "Advanced Profile Settings" for a normal profile, that field should also be included in the Maginot addons code so it "mimic" correctly, that´s all...

This applies ofcourse to all addons that creates a new profile that "mimic" the template-part of a normal profile, but I don´t know of any other addon that does?
User avatar
Parahead
 
Posts: 4837
Joined: Fri Jan 12, 2007 8:54 pm
Location: Stockholm - Sweden

Postby Parahead » Wed Feb 11, 2004 7:41 am

Please note that this solution is somewhat modified in the actual implementation in the 1.30.x series, making it possible to use a complete filename, not only specifying the extension. I advice you *not* to rely on the solution I provided above in an old version of Coranto because you will have some problems when later upgrading to 1.30.x. If you know what you are doing, go right ahead, it is not that big of deal, but you have been warned!
Yes, I am still around...
www.parahead.com/coranto/
User avatar
Parahead
 
Posts: 4837
Joined: Fri Jan 12, 2007 8:54 pm
Location: Stockholm - Sweden

Postby web » Fri Sep 16, 2005 3:21 pm

sorry, but in crcore.pl in line 1344 there is }

Do you mean I need to replace this symbol with two lines you have given..

Must this lines provided by you be inserted above or below this symbol?

I have tried all versions but nothing happens in my Satndard Profile..
I'm using Coranto 1.24 upgraded from 1.22.1

Ok. now..
I've removed Facelift and field "Template Output Extension:" appeared.
but coranto generates empty file with new extention..

I think the problem is in crcore.pl
the block I've inserted the code looks like:
Code: Select all
# Put the saved data through a TMPL file and save it.
         my $fh = CRopen(">$ProfFilePath{$i}/$i.$CConfig{'ArcHtmlExt'}");
         print {$fh} ProcessTMPL("$CConfig{'admin_path'}/$newsprofiles{$i}->{'tmplfile'}", \$HTMLContent{$i}, $newsprofiles{$i}->{'tmpltitle'});
         close($fh);
my $filext = $newsprofiles{$i}->{'tmplfileext'} || $CConfig{'ArcHtmlExt'};
my $fh = CRopen(">$ProfFilePath{$i}/$i.$filext");
      }
   }


what I have to do now?

Now, after some experiments it seems i've understand

this two lines must replace the line

my $fh = CRopen(">$ProfFilePath{$i}/$i.$CConfig{'ArcHtmlExt'}");

which is line #1341 in my crcore.pl
Is it right?
User avatar
web
 
Posts: 176
Joined: Sun Nov 30, 2003 3:39 pm

Postby Parahead » Sat Sep 17, 2005 7:15 am

web wrote:sorry, but in crcore.pl in line 1344 there is }
As you can see yourself the line references are for 1.20, not 1.24 as you use. I agree that also posting the actual line would have been good, and this is what I always does nowdays when posting about changing stuff.

web wrote:
Code: Select all
my $fh = CRopen(">$ProfFilePath{$i}/$i.$CConfig{'ArcHtmlExt'}");

which is line #1341 in my crcore.pl
Is it right?
I think so, looks about right. This is a 2 year old thread, so I don't remember exactly. You could have downloaded 1.20 and find out yourself what line this was?
Yes, I am still around...
www.parahead.com/coranto/
User avatar
Parahead
 
Posts: 4837
Joined: Fri Jan 12, 2007 8:54 pm
Location: Stockholm - Sweden

Postby web » Sat Sep 17, 2005 7:21 pm

I tried but couldn't find anylive links ;-))
User avatar
web
 
Posts: 176
Joined: Sun Nov 30, 2003 3:39 pm

Postby Parahead » Sat Sep 17, 2005 7:22 pm

web wrote:I tried but couldn't find anylive links ;-))

http://corantobeta.gwe ilo.org/?previous
Yes, I am still around...
www.parahead.com/coranto/
User avatar
Parahead
 
Posts: 4837
Joined: Fri Jan 12, 2007 8:54 pm
Location: Stockholm - Sweden

Postby web » Sat Sep 17, 2005 7:41 pm

Thanks
User avatar
web
 
Posts: 176
Joined: Sun Nov 30, 2003 3:39 pm


Return to Coranto 2.0 Development

Who is online

Users browsing this forum: No registered users and 2 guests

cron