forum.coppermine-gallery.net

Support => cpg1.4 plugins => cpg1.4.x Support => Older/other versions => cpg1.4 plugin contributions => Topic started by: Paver on November 01, 2006, 06:20:29 am

Title: Summary of Hit Statistics
Post by: Paver on November 01, 2006, 06:20:29 am
This plugin is originally based on the discussion in this thread (http://forum.coppermine-gallery.net/index.php?topic=36943.0).  It provides a summary of the hit statistics kept by Coppermine (if you have set "Keep detailed hit statistics" on the config panel).  Coppermine gives you the details for each file/photo with a popup window linked on each file/photo (in the info box).  This plugin gives you a summary of the hit statistics overall.  I imagine that this plugin will add features as people contribute them, so feel free to submit code contributions on this thread for inclusion into future versions of this plugin.

Version 0.1 beta - initial release of the plugin by wrapping the code in the original support thread into the plugin system.  This version has not been tested thoroughly so please report any issues here.  This version gives you a summary of the hit statistics from the last N number of days sorted by IP address with number of hits.  The hits from each IP address can then be broken down and displayed in a table.
Title: Re: Summary of Hit Statistics
Post by: freynolds on November 02, 2006, 12:19:14 am
I've just tried out the plugin and it works great!

Paver thanks alot for this!

I will test it out and talk to you if there is anything not workin as it should.

Thanks again
Title: Re: Summary of Hit Statistics
Post by: christian on March 07, 2007, 11:02:33 pm
Great plugin! And if you could do an automatic lookup in the members list ...  ::)
Christian
Title: Re: Summary of Hit Statistics
Post by: RArch on August 12, 2008, 06:31:51 pm
This plugin is working good on my server too.

Would it be possible to add some functionality so that it can convert server times to local times?
Title: Re: Summary of Hit Statistics
Post by: freynolds on August 12, 2008, 08:22:56 pm
Rarch, I was impressed to hear a comment on the subject over two years ago, at the momment I'm not using a cooppermine gallery, facebook sort of replaced the need for it.
So I can't help you, but if you check the code you might be able to change the way is printed. just add the amount of hours you want it to change to the number before you print it and you might get what you want.

In line 52 of ip_watch.php

Code: [Select]
    echo "\n\n<TR><TD align=\"middle\">".date("D d-m h:i:s a",$row[sdate])."</TD>";
change
Code: [Select]
$row[sdate]
to

Code: [Select]
($row[sdate] + Timeshift)
And replace timeshift with the hours you want to correct for your server...

Tell me if it works for you.

Francisco.
Title: Re: Summary of Hit Statistics
Post by: freynolds on August 12, 2008, 08:23:55 pm
Seconds not hours...
3660 is an hour.
Title: Re: Summary of Hit Statistics
Post by: maxymalny on August 13, 2008, 11:51:28 am
Seconds not hours...
3660 is an hour.
3660??? Maybe 3600?
Title: Re: Summary of Hit Statistics
Post by: RArch on August 13, 2008, 02:07:49 pm
Yeah, its an old mod but its a great one for viewing those stats  ;)

Thanks for the info guys, it has helped.
Title: Re: Summary of Hit Statistics
Post by: RArch on August 13, 2008, 03:38:33 pm
I've modified the files from the original plugin to add a time zone option, where you can add/subtract hours from the server time to correct the displayed time should your web server be in a different time zone.

The files ip_watch.php and stats.php have changed, you just need to install the plugin (posted above) as normal and overwrite those two files with the ones in the attached zip.

Near the top of each file (line 13) there is the following new variable:

Code: [Select]
$timeshift = 3600 * 8; /** Adjust server time by adding 8 hours **/
You need to set this to the number of seconds (ie. 3600 * hours) that you want to add to the server time or a negative value if you need to remove time.

I've also added a link to lookup the ip address (line 26, using dnsstuff.com), you may edit this to add your favourite lookup site. I like an idea of my visitor come from.

PS. Within the Config options of Coppermine under "General Settings" you set the "Timezone difference relative to GMT" I wonder if there is way of using this to set the timeshift variable. Maybe someone would like that challenge and modify this again.

Thanks freynolds and Paver for sharing this plugin.
Title: Re: Summary of Hit Statistics
Post by: paquets on July 03, 2009, 08:26:28 pm
Great plugin Paver. Would it be possible to also have the username with the IP address?
Title: Re: Summary of Hit Statistics
Post by: drownedgod on July 13, 2009, 09:34:18 am
I installed it but I got this. Help?

Code: [Select]
Fatal error: online_configure() [function.require]: Failed opening required './plugins/onlinestats/include/init.inc.php' (include_path='.:/usr/local/lib/php:/usr/local/lib/php/PEAR:/usr/local/share/pear') in /plugins/onlinestats/codebase.php on line 46
Title: Re: Summary of Hit Statistics
Post by: Joachim Müller on July 13, 2009, 11:17:52 am
Means you haven't uploaded all files that belong to the plugin. Uninstall the plugin, delete the folder that contains the plugin files, get a fresh copy of the plugin archive, unzip preserbing the folder structure, upload the entire plugin's folder with all sub-folders that resided in the zip archive, install the plugin using the plugin manager. If that doesn't help, stay out of this announcement thread, but start an individual support request.
Title: Re: Summary of Hit Statistics
Post by: drownedgod on July 13, 2009, 01:03:19 pm
It worked. Thanks!