Gossamer Forum
Home : Products : Links 2.0 : Customization :

help with comment 4 lite

Quote Reply
help with comment 4 lite
CrazyGreetings, 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?

Quote Reply
Re: [tw1000] help with comment 4 lite In reply to
seems like there was a question/answer about this very subject 3-4 weeks ago...

do a search or page back



Gene
"The older I get, the more I admire competence, just simple competence in any field from adultery to zoology."
Quote Reply
Re: [esm] help with comment 4 lite In reply to
Thanks, there was a thread that started out that way , but talked about methods to call the script and display a zero result . I learned a little from that discussion , but it was of no help with my problem. I need help with figuring out why <%totals%> doesn't return any results at all.

Regards
Quote Reply
Re: [tw1000] help with comment 4 lite In reply to
I know you were part of this thread but maybe this ( I don't have 4 lite so I don't know ).

http://www.gossamer-threads.com/...latest_reply;so=ASC;



Gene
"The older I get, the more I admire competence, just simple competence in any field from adultery to zoology."
Quote Reply
Re: [esm] help with comment 4 lite In reply to
Smilethanks a million! I had looked at and even used the code as presented in the other thread. I tried it again and it workedBlush. I think that my placement of the code in the sub must have been wrong.