Hello
@ManageTemplates.pm
Actual the open and print sub not realy work!
When i edit eg. Post.template .... the code in the file looks like this .....
## Post Top
$mypost_title = qq~{yabb my_topper}<table class="tabtitle">
<tr>
<td style="padding-left:1%">
<img src="{yabb icon_img}" alt="" /> {yabb yytitle}
</td>
</tr>
</table>
{yabb my_topview}
~;
.... after save the file the code looks this.
## Post Top
$mypost_title = qq~{yabb my_topper}<table class="tabtitle">
<tr>
<td style="padding-left:1%">
<img src="{yabb icon_img}" alt="" /> {yabb yytitle}
</td>
</tr>
</table>
{yabb my_topview}
~;
I have found a working code for open and save
In ManageTemplates "
sub ModifyTemplate" find this code ...
fopen( TMPL, "$templatesdir/$templatefile" );
while ( $line = <TMPL> ) {
$line =~ s/[\r\n]//gxsm;
$line =~ s/ /&nbsp;/gxsm;
$line =~ s/&/&amp;/gxsm;
$line =~ s/^\s+//gsm;
$line =~ s/\s+$//gsm;
FromHTML($line);
$fulltemplate .= qq~$line\n~;
}
fclose(TMPL);
and replace with ....
fopen( TMPL, "$templatesdir/$templatefile" );
my $line = join("",<TMPL>);
fclose(TMPL);
for($x=0;$x<length($line);$x++){
$fulltemplate .= "&#" . sprintf("%03d",ord((substr($line,$x,1)))) . ";";
}
And in "
sub ModifyTemplate2" replace this code ...
$FORM{'template'} =~ tr/\r//d;
$FORM{'template'} =~ s/\A\n//xsm;
$FORM{'template'} =~ s/\n\Z//xsm;
if ( $FORM{'filename'} ) { $templatefile = $FORM{'filename'}; }
else { $templatefile = 'default.html'; }
fopen( TMPL, ">$templatesdir/$templatefile" );
print {TMPL} "$FORM{'template'}\n" or croak "$croak{'print'} TMPL";
fclose(TMPL);
.... with this one!
if ( $FORM{'filename'} ) { $templatefile = $FORM{'filename'}; }
else { $templatefile = 'default.html'; }
fopen( TMPL, ">$templatesdir/$templatefile" );
print {TMPL} "$FORM{'template'}" or croak "$croak{'print'} TMPL";
fclose(TMPL);
Check it out ....
lg XTC