Gossamer Forum
Home : General : Perl Programming :

Re: SSI problem !

Quote Reply
Re: SSI problem ! In reply to
Hi,
Both server are NT.

here is new_reader.pl ( it is supposed to insert the headlines of articles into page using SSI) :

#!/usr/local/bin/perl

###################################################################
###################################################################
push (@INC, "j:\\laith\\htdocs\\cgi-bin\\entertainment\\movies\\reviews\\");
require "config.pl";



$head="$tempdir\\newshead.plate";
$foot="$tempdir\\foot.plate";
$sorry="$tempdir\\sorry.plate";
$list="$tempdir\\list.plate";

&parse_form;
$ticker=0;


&open_file("DATAFILE","",$datafile);
$read_file ;
&read_template($incoming=$head);


foreach $line (sort(date_sort &read_file("DATAFILE")))
{

# split the fields at the | character
@tabledata = split("\t",$line ,10);
$snuffy="yes";
&check_record;


## BEGIN VIEW


if ($field6 eq "published" ){
$counter++;
&read_template($incoming=$list);

}




}

## END VIEW


close(DATAFILE);


if ($counter==0) {
&read_template($incoming=$no_news);
}

&read_template($incoming=$foot);

exit;


sub read_template {

$field2link=$field2;
$field2link=~ s/ /%20/g;

local (%listvals) = ("!FIELD1!", "$field1", "!FIELD2LINK!", "$field2link", "!FIELD2!", "$field2", "!FIELD3!", "$field3", "!FIELD4!", "$field4", "!FIVE!", "$five", "!FIELD6!", "$field6", "!FIELD7!", "$field7", "!FIELD8!", "$field8", "!FIELD9!", "$field9", "!FIELD10!", "$field10", "!FIELD11!", "$field11", "!FIELD12!", "$field12", "!FIELD13!", "$field13");

local ($template) = "$incoming";
open(TEMPL, "$template") | | print "no file found $template!";
$template = "";

while(<TEMPL> )
{
$template .= $_;
}

close(TEMPL);

for $ikey (keys(%listvals))
{
local($value) = $listvals{"$ikey"};

$template =~ s/$ikey/$value/gm;
}

print "$template\n";

}

Subject Author Views Date
Thread SSI problem ! Laith 13134 Aug 18, 1999, 10:39 AM
Post Re: SSI problem !
Eliot 12860 Aug 18, 1999, 2:52 PM
Post Re: SSI problem !
dan 12860 Aug 18, 1999, 10:38 PM
Post Re: SSI problem !
Laith 12891 Aug 18, 1999, 10:55 PM
Post Re: SSI problem !
Laith 12876 Aug 19, 1999, 9:51 AM
Post Re: SSI problem !
Laith 12861 Aug 19, 1999, 11:40 PM
Post Re: SSI problem !
Eliot 12894 Aug 20, 1999, 7:46 AM
Post Re: SSI problem !
Eliot 12853 Aug 20, 1999, 9:06 AM
Post Re: SSI problem !
Laith 12871 Aug 20, 1999, 10:56 AM
Post Re: SSI problem !
Eliot 12860 Aug 20, 1999, 1:55 PM
Post Re: SSI problem !
Laith 12882 Aug 22, 1999, 10:11 AM
Post Re: SSI problem !
Eliot 12872 Aug 22, 1999, 11:46 AM
Post Re: SSI problem !
eskimoz 12876 Oct 4, 1999, 8:50 PM
Post Re: SSI problem !
Eliot 12893 Oct 5, 1999, 7:24 AM
Post Re: SSI problem !
eskimoz 12998 Oct 5, 1999, 8:58 PM
Post Re: SSI problem !
Eliot 12962 Oct 6, 1999, 4:08 AM
Post Re: SSI problem !
eskimoz 12927 Oct 6, 1999, 10:22 PM
Post Re: SSI problem !
Eliot 12942 Oct 7, 1999, 5:05 AM
Post Re: SSI problem !
Eliot 13064 Oct 7, 1999, 5:14 AM
Post Re: [Laith] SSI problem !
skwebline 12776 Apr 20, 2004, 5:18 AM