Gossamer Forum
Home : Products : Gossamer Links : Version 1.x :

Building a New Template

Quote Reply
Building a New Template
Hello everyone!

I wanted to add a Terms and Agreements page that everyone agrees to when then submit a link to my search engine. I created the template (terms.html), added the subroutine in HTML_Template.pm (and to @EXPORTS):

Code:
sub site_html_terms_and_agreements {
# --------------------------------------------------------
# This routine will build a what's new page.
#
my ($tags, $dynamic) = @_;
my $template = defined $dynamic ? $dynamic->param('t') : undef;
(ref $tags eq 'HASH') or croak "HTML_TEMPLATES: Argument '$tags' must be hash reference";

defined $dynamic and &load_user ($dynamic, $tags);
my $output = &load_template ('terms.html', {
%$tags,
%GLOBALS
}, undef, $template );
defined $dynamic and &clean_output($dynamic, \$output);
return $output;
}
add a variable for it in Links.pm:

Code:
# The path and URL to the terms and agreements page
$LINKS{build_terms_and_agreements_path} = "$LINKS{build_root_path}/terms_and_agreenments$LINKS{build_extension}";
$LINKS{build_terms_and_agreements_url} = "$LINKS{build_root_url}/terms_and_agreements$LINKS{build_extension}";
and then placed this subroutine (which I created from others) in nph-build.cgi:

Code:
sub build_terms_and_agreements {
# --------------------------------------------------------
# Creates the terms and agreements page.
#
my ($s, $e, $f);

$USE_HTML ?
print "Building <a href='$LINKS{build_terms_and_agreements}' target='_blank'>Terms and Agreements Page</a> ... \n" :
print "Building Terms and Agreements Page ... \n";
$s = time();

open (TERMS, ">$LINKS{build_terms_and_agreements_path}") or die "unable to open terms and agreements page: $LINKS{build_terms_and_agreements}. Reason: $!";
print TERMS &site_html_terms_and_agreements (\%OUT);
close TERMS;
print "\tClosing page.\n";

$f = time();
$e = $f - $s;
print "Done ($e s)\n\n";
}
and I got a software error saying complication errors. I know the problem lies in the nph-build.cgi subroutine because that is the only one I'm not sure on. So can someone look it over and tell me what I'm doing wrong? Thanks and God bless!

<><------------><>
Daniel
http://www.christian-search.net
<><------------><>
Subject Author Views Date
Thread Building a New Template OneDanShow 3646 Nov 10, 2000, 11:15 AM
Thread Re: Building a New Template
OneDanShow 3600 Nov 10, 2000, 12:06 PM
Thread Re: Building a New Template
phoule 3566 Nov 15, 2000, 1:17 PM
Thread Re: Building a New Template
OneDanShow 3540 Nov 18, 2000, 10:55 AM
Thread Re: Building a New Template
pugdog 3546 Nov 18, 2000, 12:34 PM
Thread Re: Building a New Template
OneDanShow 3535 Nov 19, 2000, 2:25 PM
Thread Re: Building a New Template
phoule 3532 Nov 19, 2000, 3:08 PM
Thread Re: Building a New Template
OneDanShow 3508 Nov 19, 2000, 3:35 PM
Post Re: Building a New Template
OneDanShow 3475 Nov 25, 2000, 9:19 AM