Hello everyone,
I want to incorporate my new template into page.cgi now. Here is what I've done so far:
add my ($terms_match) = $LINKS{build_terms_and_agreements} =~ m,^$LINKS{build_terms_and_agreements}/(.+),o; to the top of page.cgi under #Figure out what to look for.
add ($page =~ /^$terms_match/o) and do { &generate_terms_page ($in); last CASE; } to top of page.cgi under CASE: {
add sub generate_terms_page {
# --------------------------------------------------------
# This routine build a single page for every link.
#
my $in = shift;
my ($terms_match);
$page = $in->param('g');
($terms_match) = $LINKS{build_terms_and_agreements} =~ m,^$LINKS{build_terms_and_agreements}/(.+),o;
($id) = $page =~ m,$terms_match/(\d+),o;
if (!$id) {
print $in->header();
&site_html_error ( { error => "Sorry, I'm not sure what page you are asking for: '$page'" }, $in);
return;
}
$link = $LINKDB->get_record ($id, 'HASH');
if (!$link) {
print $in->header();
&site_html_error ( { error => "Sorry, we don't seem to have link '$id'" }, $in);
return;
}
$category = $CATDB->get_record ($link->{'CategoryID'}, 'HASH');
$title_linked = &build_linked_title ($category->{'Name'} . "/" . $link->{'Title'});
print $in->header();
print &site_html_terms_and_agreements ($link, { grand_total => $GRAND_TOTAL, title_linked => $title_linked }, $in);
} into page.cgi
i just copied the subroutine for the detailed page and then tried to modify it with the variables I have. I can figure what needs to be edited but I would like to get help with this first. I also posted this in the same forum thread so that people can use this as a resource. Thanks!
<><------------><>
Daniel
http://www.christian-search.net
<><------------><>
I want to incorporate my new template into page.cgi now. Here is what I've done so far:
add my ($terms_match) = $LINKS{build_terms_and_agreements} =~ m,^$LINKS{build_terms_and_agreements}/(.+),o; to the top of page.cgi under #Figure out what to look for.
add ($page =~ /^$terms_match/o) and do { &generate_terms_page ($in); last CASE; } to top of page.cgi under CASE: {
add sub generate_terms_page {
# --------------------------------------------------------
# This routine build a single page for every link.
#
my $in = shift;
my ($terms_match);
$page = $in->param('g');
($terms_match) = $LINKS{build_terms_and_agreements} =~ m,^$LINKS{build_terms_and_agreements}/(.+),o;
($id) = $page =~ m,$terms_match/(\d+),o;
if (!$id) {
print $in->header();
&site_html_error ( { error => "Sorry, I'm not sure what page you are asking for: '$page'" }, $in);
return;
}
$link = $LINKDB->get_record ($id, 'HASH');
if (!$link) {
print $in->header();
&site_html_error ( { error => "Sorry, we don't seem to have link '$id'" }, $in);
return;
}
$category = $CATDB->get_record ($link->{'CategoryID'}, 'HASH');
$title_linked = &build_linked_title ($category->{'Name'} . "/" . $link->{'Title'});
print $in->header();
print &site_html_terms_and_agreements ($link, { grand_total => $GRAND_TOTAL, title_linked => $title_linked }, $in);
} into page.cgi
i just copied the subroutine for the detailed page and then tried to modify it with the variables I have. I can figure what needs to be edited but I would like to get help with this first. I also posted this in the same forum thread so that people can use this as a resource. Thanks!
<><------------><>
Daniel
http://www.christian-search.net
<><------------><>