Greetings, I have installed comment 4 lite mod. Everything seems to work ok (can add , view comments) but I have been unable to get the number of comments toshow on the llinks page.
These are the changes I made to site_html_template.pl sub site_html_link :
sub site_html_link {
# --------------------------------------------------------
# This routine is used to display what a link should look
# like.
my (@values, $counter, $totals);
$counter = $totals = 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;
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",
totals => $totals,
%rec,
%globals
});
}
I copied the other two sub's into site_html_template.pl
I call the script from link.html with <a href = "<%db_cgi_url%>/comments4l.cgi?function=display&LID=<%ID%>">Comments on this Report</a> (<%totals%>)
I add a comment , it displays properly but the total will not display. What have I done wrong?
These are the changes I made to site_html_template.pl sub site_html_link :
sub site_html_link {
# --------------------------------------------------------
# This routine is used to display what a link should look
# like.
my (@values, $counter, $totals);
$counter = $totals = 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;
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",
totals => $totals,
%rec,
%globals
});
}
I copied the other two sub's into site_html_template.pl
I call the script from link.html with <a href = "<%db_cgi_url%>/comments4l.cgi?function=display&LID=<%ID%>">Comments on this Report</a> (<%totals%>)
I add a comment , it displays properly but the total will not display. What have I done wrong?