Gossamer Forum
Home : Products : Links 2.0 : Discussions :

Total Hits: blank all of a sudden - limit somewhere?

Quote Reply
Total Hits: blank all of a sudden - limit somewhere?
All of a sudden I notice nothing was reported on my directory homepage under Total Hits. Just a blank space with no changes to templates, etc. During the build it is also blank all of a sudden:

Total Links: 2715
Total Hits:
Opening page: /home/(removed for forum post)

Hits for individual records still seem to be updating fine. I've been running the directory since 1998 and total hits have been increasing.

If I add up the hits column in excel from the 850 kb links.db file, the total is 8,550,230 :)

Did I exceed some limit in Links' sum of this column? Is there a way to get the Total Hit calculation to work again in Links?

Last edited by:

Jeff-C: Oct 14, 2006, 6:32 PM
Post deleted by Island In reply to
Quote Reply
Re: [Jeff-C] Total Hits: blank all of a sudden - limit somewhere? In reply to
ladyofdragons wrote:
just figured I needed this one, toyed with it and came up with a solution. This will let you include the total number of hits on your home page. (I'll be using it for the total hits this month, because I have my monthly hits mod working)

in nph-build.cgi, change:
use vars qw(%alpha %category %subcategories @links @new_links @cool_links @pick_links %stats $grand_total $use_html $nph $date $time);
use vars qw(%alpha %category %subcategories @links @new_links @cool_links @pick_links %stats $grand_total $totalhits $use_html $nph $date $time);

in sub build_staggered, after:
$grand_total = 0;
$totalhits = 0;

in sub build_stats, after:
# Add the link to the list of links.
push (@{$links{$category}}, @values) if (!$staggered_mode);
# add to total the hits made this month
$totalhits = $totalhits + $values[$db_hits];

then in sub build_home_page after:
print "\tTotal Links: $grand_total\n";
print "\tTotal Hits This Month: $totalhits\n";

Then in site_html_templates.pl, in sub site_html_home, after:
grand_total => $grand_total,
totalhits => $totalhits,

then add <%totalhits%> where you would like it on your homepage.

Marie Altobelli
Dragonsblood Ink. Librarian

and all works well again. It appears this was something silly.