Gossamer Forum
Home : Products : Links 2.0 : Customization :

Comments4 lite

Quote Reply
Comments4 lite
I was able to install the Comments 4 lite mod from:

http://cgi-resource.co.uk/pages/comment4l.html

However, I cannot get the total comments to show up. After the pages are built, the links page has an error: Unknown tag totals

Apparently, the <%totals%> is not being recognized. Here is what my sub site_html_link in site_html_templates.pl looks like...

Code:

sub site_html_link {
# --------------------------------------------------------
# This routine is used to display what a link should look
# like.
my %rec = @_;
# Set new and pop to either 1 or 0 for templates.
($rec{'isNew'} eq 'Yes') ? ($rec{'isNew'} = 1) : (delete $rec{'isNew'});
($rec{'isPopular'} eq 'Yes') ? ($rec{'isPopular'} = 1) : (delete $rec{'isPopular'});
return &load_template ('link.html', {
detailed_url => "$db_detailed_url/$rec{'ID'}$build_extension",
%rec,
%globals
});
# Added for comments4
my (@values, $counter, $totals);
$counter = 0;
open (DB, "<$db_comments_name") or &cgierr("unable to open database: $db_comment_name. Reason: $!");
LINE: while (<DB> ) {
/^#/ and next LINE; # Skip comment Lines.
/^\s*$/ and next LINE; # Skip blank lines.
chomp;
@values = &split_decode ($_);
$counter = $values[1];
if ($rec{'ID'} eq $counter) {
$totals++;
}
}
close DB;
totals => $totals,
}


Do you spot something wrong?

Thanks in advance!!
Subject Author Views Date
Thread Comments4 lite aznaphrodite 3434 Nov 19, 2005, 5:35 PM
Thread Re: [aznaphrodite] Comments4 lite
PerlFlunkie 3375 Nov 19, 2005, 9:20 PM
Thread Re: [PerlFlunkie] Comments4 lite
aznaphrodite 3369 Nov 23, 2005, 1:37 PM
Thread Re: [aznaphrodite] Comments4 lite
PerlFlunkie 3359 Nov 23, 2005, 2:17 PM
Post Re: [PerlFlunkie] Comments4 lite
aznaphrodite 3358 Nov 23, 2005, 2:26 PM