Pissed at a Pixelpost Plugin
Posted November 1st, 2008 @ 02:19pm by Erik J. Barzeski
It's not often I misunderstand what software does, but I'm absolutely furious with the "Image Statistics" addon for Pixelpost.
At my photoblog, right after the date, you'll find two numbers in parentheses. The first shows the number of visitors to that image today. The second shows the total number.
The software resets itself every month, but also includes the option to turn on "long-time statistics." On October 1, I noticed it had reset itself, and was disappointed that the few items I'd posted in September had been lost for good. I enabled the long-term statistics, which I took to mean that the "total number" statistic would live on forever, and the "today" counter would simply update every day.
Turns out I shouldn't have assumed that. All the "long-term statistics" gets you is this:
Big freakin' whoopty doo there. Visit the "Crew" image and you'll see the stats are nowhere near 461 visits (currently 6).
I'm a bit busy this weekend, but I'm willing to pay someone to update this plugin to do what I would call the more "proper" method of maintaining long-term statistics: by not deleting the entire previous month (or any data). Because I have a sound backup strategy, I've saved my database from two nights ago (the morning of October 31), so I should be able to get the vast majority of my October data "back" again.
Based on five minutes spent looking through the plugin's code, it seems that almost 90% of the desired functionality can be brought about by commenting out the entire block of code following these comments:
// check if former months are already deleted // check if long image stats are ready // update long image stats // delete monthly stats if necessary
If you're interested in taking this on, I'd be interested hearing about it.
Posted 01 Nov 2008 at 2:38pm #
And yes, I'm not truly pissed at the addon, I'm more pissed at myself for not paying attention to what the addon truly meant by "long-time stats."
Posted 02 Nov 2008 at 1:25pm #
what's it wirriten in? I'll fix it for you if I know the language. Just toss me an email.
Posted 02 Nov 2008 at 5:27pm #
[quote comment="50477"]what's it wirriten in? I'll fix it for you if I know the language. Just toss me an email.[/quote]
It's PHP. I linked to the plugin above. Everything in Pixelpost is written in PHP, I believe.
Posted 03 Nov 2008 at 12:42am #
[quote comment="50478"]It's PHP. I linked to the plugin above. Everything in Pixelpost is written in PHP, I believe.[/quote]
Christ thats some of the worst looking code I've seen since trying to understand ADOdb.
From what im understanding of it it doesn't actually delete the long stats it just doesn't show them. check the imagestats_long table in mysql and see if it contains the data you're looking for.
Posted 03 Nov 2008 at 9:40am #
[quote comment="50481"]From what im understanding of it it doesn't actually delete the long stats it just doesn't show them.[/quote]
I assure you it does:
mysql_query("DELETE FROM ".$pixelpost_db_prefix."imagestats WHERE datetime NOT LIKE '".$cmonth."%'");
The longtime image stats are a distilled, tiny fraction of the overall stats.