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

Adding Total Hits to Build

Quote Reply
Adding Total Hits to Build
I like to see how many total "hits" my site has generated each time I rebuild. Does anyone know if there would be a way to add to nph-build.cgi something that would total everything in the Hits field for all of the links and then output this total with a variable such as <%total_hits%> that could be put on one of the pages? In other words it would be similar to the way it can currently say "There are x number of links for you to choose from". Any comments or help would be greatly appreciated.

-rover

Quote Reply
Re: Adding Total Hits to Build In reply to
In Reply To:
In other words it would be similar to the way it can currently say "There are x number of links for you to choose from".
Similar, but different.

I would recommend looking at the sub build_update_counter routine and see if you can add some calculations in that routine and create a global variable out of it called <%total_hits%>.

Good luck!

Regards,

Eliot Lee
Quote Reply
Re: Adding Total Hits to Build In reply to
Just add a database call somewhere in the build routine, and stuff this into a global variable (perhaps where you get the Total is good):

SELECT SUM(Hits) from Links

That will return the sum of all your hits.



PUGDOGŪ
PUGDOGŪ Enterprises, Inc.
FAQ: http://postcards.com/FAQ


Quote Reply
Re: Adding Total Hits to Build In reply to
Rover

Did this work?.... I do not see a reply...
Sure would like to put on my index page...
Something like::
This Search Engine has had <%total_hits%> total hits since Dec 2000.

http://www.sfahq.com
Phil the FOG
Quote Reply
Re: Adding Total Hits to Build In reply to
I don't have a lot of ability in modifying the PERL, so unfortunately, I wasn't able to integrate it into my system to display on a page. I am able to check myself, however, by going to the SQL Monitor and entering:

SELECT Sum(Hits)
FROM Links_Links

I use the Prefix of "Links_" with all of my MySQL tables. If you don't use a prefix with yours, then you would just put in:

SELECT Sum(Hits)
FROM Links

When you execute this you will get the total number of Hits for all of your links.

If you do find a way to get this to display on the home page or on the category pages, let me know!

--Rover



Quote Reply
Re: Adding Total Hits to Build In reply to
Rover and All

Maybe Eliot, Pugdog or someone who knows how will be kind enough to do it so we novices will understand or better yet be able to copy and paste it in the proper file..

http://www.sfahq.com
Phil the FOG
Quote Reply
Re: Adding Total Hits to Build In reply to
Rover

I am working on this now and will get it up as soon or If I get it done..

http://www.sfahq.com
Phil the FOG