|
Posted by alexjaquet on 04/25/06 19:42
then I open the corresponding page ( I don't want to change the way I
work in perl I want to do it in php right now)):
sub loadMixTape {
open (FILE, "<$dir/mix_tape.html") or die "cannot open file
$dir/mix_tape.html";
local our $menu = loadMenu();
my $string4 = weekNews ();
local our $cats = getCat();
local our $content;
while (<FILE>) {
s/\$LABEL{'([\w]+)'}/ exists $SERVER{$1} ? $SERVER{$1} : $1 /eg;
s/\$LANG/$lang/g;
s/\$OPTIONS{'categories'}/$cats/g;
s/\$ERROR{'([\w]+)'}//g;
s/\$ARTICLE{'main_menu'}/$menu/g;
s/\$ARTICLE{'search'}//g;
s/\$ARTICLE{'week_news'}/$string4/g;
s/\$LINK{'admin'}/$LINK{'admin'}/g;
s/\$SESSIONID/$session_id/g;
$content .= $_;
}
$content = Compress::Zlib::memGzip($content) if $can_do_gzip; ;
print "Content-Length: ", length($content) , "\n";
print "Content-Encoding: gzip\n" ;
print "Content-Type: text/html\n\n";
print $content;
close (FILE);
}
Navigation:
[Reply to this message]
|