Subject: Static Page Stats

Posted on: 16/08/02 07:05am
By: tomw

I use my Geeklog site for commercial purposes and use the Static pages for product information. I needed to track click-thru so the big omission from static pages for me was statistics. Since static pages is now distributed with Geeklog I hacked the stats.php script to add statistics for Static pages. There are language issues so I added three configuration variables at the top of the script to contain the necessary text. You can find this hack along with my earlier links hack at



Static Page Stats

Posted on: 16/08/02 07:44am
By: Dirk

Hmm, I haven't looked at your code yet but wouldn't it have made more sense to just implement the statistics part in the static pages plugin? Statistics is part of the plugin API, it just hasn't been implemented in the static pages plugin ... bye, Dirk

Static Page Stats

Posted on: 16/08/02 08:19am
By: tomw

I played with the stats plugin code and unless I did something wrong or misunderstood the implementation it was not integrated with the regular stats very well. It was far easier to modify stats.php than to dig through the code for some undocumented trick. As far as I could find all formating was left up to code written in the plugin function. Am I wrong? Point me in the right direction. Tom

Static Page Stats

Posted on: 16/08/02 10:03am
By: Tony

Well, you are right, it is an undocumented trick but if you see the function calls being made by the plugin API you'll see how easy it really is. Look in /path/to/geeklog/system/lib-plugins.php and there is a stats function. In that function there is a flag that tells whether or not to report overall plugin stats (which would show up in the top stat block on stat.php) or if it should generate the plugin-specific stats like the blocks you see for stories. Hope that is a good starting point. --Tony

Static Page Stats

Posted on: 16/08/02 10:51am
By: tomw

I saw that function and played with it a while -- all I could get it to do was print out two boxes at the top of stats page with the information in it. I wanted it integrated with the rest of the stats and in the same format. I even cut and pasted the code I used into that function and it always looked like a hacked addon. When I saw the function I assumned that it would be called with a 1 and want a summary line which would be added to the site summary box. When the function was called with something else it wanted the stats formated as the detail boxes. But it did not work that way. What did I do wrong or do I missunderstand how the function works. Tom

Static Page Stats

Posted on: 21/12/04 04:06am
By: ericwagner101

To get the formatting correct in stats you have to change the formatting in the file for each plugin (plugins/[theplugindir]/

Here is an example. Look for "plugin_showstats" in each plugin file and look for lines like this:

$retval = "<table border = '0' width='100%' cellspacing='0' cellpadding='0'>";
$retval .= "<tr><td>" . $LANG_FILEMGMT['nofiles'] . "</td>";
$retval .= "<td align='right'>" . $total_pages . " (" $total_downloads&quotWink   </td></tr></table>";

... and change them so something like this:

$retval = "<table border = '0' width='70%' cellspacing='0' cellpadding='4'>";
$retval .= "<tr><td>" . $LANG_FILEMGMT['nofiles'] . "</td>";
$retval .= "<td align='right'>" . $total_pages . " (" .$total_downloads.&quotWink</td></tr></table>";

Geeklog - Forum