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

grand_total as a Global

Quote Reply
grand_total as a Global
Would anyone know how to make <%grand_total%> as a global variable in HTML_Templates. I had it going but didn't work with add.cgi.

This is what I tried. It worked on every page except add.cgi,

I added this to the top of HTML_Templates.pm

my ($LINKDB,$sth,$total,$GRAND_TOTAL);

$LINKDB = new Links: BSQL "$LINKS{admin_root_path}/defs/Links.def";

$sth = $LINKDB->prepare ("SELECT COUNT(*) FROM CategoryAlternates");
$sth->execute();
($total) = $sth->fetchrow_array;
$GRAND_TOTAL = $LINKDB->total();


%GLOBALS = (
date => \&Links: BSQL::get_date,
time => \&Links: BSQL::get_time,
db_cgi_url => $LINKS{db_cgi_url},
build_root_url => $LINKS{build_root_url},
site_title => $LINKS{build_site_title},
css => $LINKS{build_css_url},
banner => '',
grand_total => $GRAND_TOTAL

);


Any ideas?

Thanks,

Kevin
Subject Author Views Date
Thread grand_total as a Global kevinhost 1623 Apr 3, 2000, 10:21 AM
Post Re: grand_total as a Global
pugdog 1530 Apr 3, 2000, 11:38 PM