I'm attempting to do an include of a file into a cgi-generated "detail" page that's a cross between widgetz' detailed.cgi. and eliot's siteofday. The URL of the file I'm including is in the URL field.
this is what I have so far:
my %rec = @_;
open (INC, "$rec{'URL'}") or return "Can't find include file:
Article file{$_}";
return join ("", <INC> );
}
sub site_html_article {
# --------------------------------------------------------
# This routine will build a single page per link. It's only
# really useful if you have a long review for each link --
# or more information then can be displayed in a summary.
#
my %rec = @_;
my $template;
# Set the appropriate template file to load
if ($category_name =~ "Outside_Resources/Websites/") {
$template = "article.html"; }
else { $template = "article.html"; }
($rec{'isPopular'} eq 'Yes') ? ($rec{'isPopular'} = 1) : (delete $rec{'isPopular'});
($rec{'isPick'} eq 'Yes') ? ($rec{'isPick'} = 1) : (delete $rec{'isPick'});
return &load_template ( $template, {
total => $total,
grand_total => $grand_total,
title_linked => $title_linked,
# articleinclude => &articleinclude,
%rec,
%globals
} );
}it's called from a detailed.cgi type file called article.cgi. I'm getting "Can't find include file: Article file{} on the page, I can't seem to figure out what's wrong. I'm sure it's something simple & dumb that I did wrong, anyone know what the problem might be?
[This message has been edited by ladyofdragons (edited February 17, 2000).]
this is what I have so far:
Code:
sub articleinclude { my %rec = @_;
open (INC, "$rec{'URL'}") or return "Can't find include file:
Article file{$_}";
return join ("", <INC> );
}
sub site_html_article {
# --------------------------------------------------------
# This routine will build a single page per link. It's only
# really useful if you have a long review for each link --
# or more information then can be displayed in a summary.
#
my %rec = @_;
my $template;
# Set the appropriate template file to load
if ($category_name =~ "Outside_Resources/Websites/") {
$template = "article.html"; }
else { $template = "article.html"; }
($rec{'isPopular'} eq 'Yes') ? ($rec{'isPopular'} = 1) : (delete $rec{'isPopular'});
($rec{'isPick'} eq 'Yes') ? ($rec{'isPick'} = 1) : (delete $rec{'isPick'});
return &load_template ( $template, {
total => $total,
grand_total => $grand_total,
title_linked => $title_linked,
# articleinclude => &articleinclude,
%rec,
%globals
} );
}
[This message has been edited by ladyofdragons (edited February 17, 2000).]