Welcome to Geeklog Saturday, October 19 2019 @ 09:30 pm EDT

Geeklog Forums

Static Page Stats


Status: offline

tomw

Forum User
Full Member
Registered: 12/08/02
Posts: 300
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 http://www.pigstye.net/geeklog.html.

Enjoy

Tom


Status: offline

Dirk

Site Admin
Admin
Registered: 12/01/02
Posts: 13073
Location:Stuttgart, Germany
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

Status: offline

tomw

Forum User
Full Member
Registered: 12/08/02
Posts: 300
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

Status: offline

Tony

Site Admin
Admin
Registered: 17/12/01
Posts: 405
Location:Urbandale, Iowa
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
The reason people blame things on previous generations is that there's only one other choice.

Status: offline

tomw

Forum User
Full Member
Registered: 12/08/02
Posts: 300
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

Status: offline

ericwagner101

Forum User
Newbie
Registered: 21/12/04
Posts: 1
To get the formatting correct in stats you have to change the formatting in the function.inc file for each plugin (plugins/[theplugindir]/functions.inc)

Here is an example. Look for "plugin_showstats" in each plugin functions.inc 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>";

All times are EDT. The time is now 09:30 pm.

  • Normal Topic
  • Sticky Topic
  • Locked Topic
  • New Post
  • Sticky Topic W/ New Post
  • Locked Topic W/ New Post
  •  View Anonymous Posts
  •  Able to post
  •  Filtered HTML Allowed
  •  Censored Content