These are cgi generated, and yank the information from the database. The speed difference after indexing the "Count" and "Last_Hit" fields was STAGGERING!

I know there have to be better ways of figuring out the dates -- doing date arithmetic -- and things such as the "top_today" and eventually the "top_yesterday" could be coded more elegantly to use less system resources.

By using more tables, and keeping better tabs of what was being looked at, you could generate stats that could be inserted into a side-bar on each build, or into any cgi generated page (or even SSI).

You need to make the BSQL 'DBSQL' and you need to do the same in the use DBSQL line.

The smiley faces are a real pain... and should not appear in the code blocks, but they do.

I've also figured out how to count daily search term hits, and keep a running total for each day, and I'm working on a way to log the results, so that once a day is over, the program looks to see if the summary exists, if it does, it uses that, if not it calculates it, then stores the summary so that future searches don't have to re-generate it.

This solved a much larger problem for me, and has implications for my "Top 10" links, "Top Today" and "Yesterday" etc. Look for the release soon. If anyone _needs_ this now in beta code, drop me an email. You are on your own for how to install it, but if you want the beta code, you should know how to do that. Once it's all done, the subroutines could be cloned and modified to do just about any sort of tracking and "top" lists you would want. It's just a munge from jump.cgi and search.cgi but it's a useful one!

do I want to know if he has some it sorts things out of showing the last 5 words searched in a template, as she does with top 5, only that not showing the 5 more sought and yes the last ones 5 sought, did she understand?

Hi Pugdog I instilled your mod top 5 search terms few days ago. I have a small problem, someone is cheating.. They are searching for their URl 10's of times so it will always display on my home page and search result page...

Is there a way to prevent diplaying the URL or anything that starts with http:// and only display actuall keywords?

This mod is awesome! Good job Pugdog! My only question is, how can I clear my current keywords because usual the top 5 terms don't change that much and I want to clear them like every month or something. Thanks for God bless!

If you want to keep your search terms, so you maintain an all-time "high" list, there isn't much you can do, since the terms are agregated in the Search_Log table, so if you have 39,000 entries in that table, there are 39,000 different terms, not 39,000 searches (following?). If the table kept a list of all the searches, you could delete the x-number of oldest searches, and "freshen" the list a bit. This _will_not_ work with the current implementation.

In the Search_Log_Daily, you can trim that file by

DELETE from Search_Log_Daily Where TDate > 2000-09-30

or similar. That will reset the various sub tables.

If you delete the Search_Log file, your site will re-set, in effect, and you will be starting your "searches" over from '0'. For an established site, that might look funny.

I'll think about this for a little and see if I can come up with a way to make a sort of 'rolling' "top" searches.

That could probably be done by reading the Search_Log_Daily table, going back how ever far you wanted to, then generating a Top_5 or Top_10 list from that, and storing it in a file, and just including that file in.

You could update that file once a month, or whenever it struck you, but you'd still be tracking the all-time top searches, and keeping a daily log.

Gossamer Threads is a Vancouver-based company with over 23
years experience in web technology. From development to hosting, we
partner with leading organizations around the globe and help to build
their web presences, strategies and infrastructures.