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):
# --------------------------------------------------------
# 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:
$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:
# --------------------------------------------------------
# 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
<><------------><>
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;
}
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}";
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";
}
<><------------><>
Daniel
http://www.christian-search.net
<><------------><>