Stats: Gallery statistics by date
This plugin is an adaptation from Nibblers Mod http://forum.coppermine-gallery.net/index.php?topic=34858.0 (http://forum.coppermine-gallery.net/index.php?topic=34858.0)
It add a new menu button for opening a statistic page.
INSTALL:- unzip package to plugins folder and use plugin manager to install it
LANGUAGE:english.php italian.php (thank's Lontano) and french.php are avaible in the package. Feel free to translate in your language
New VersionVersion 1.1:
-Adding some others stats inspired by Pslawinsky's Mod http://forum.coppermine-gallery.net/index.php?topic=23945.0 (http://forum.coppermine-gallery.net/index.php?topic=23945.0)
-Adding dutch.php lang file (Thank's Hein)
-adding german.php lang file (Thank's M@rk)
-adding spanish.pgp lang file (Thank's Just_some_guy)
Nice, easy and useful! Good work Fratz!
Italian lang file attached
Nice work, Frantz (I tried to + Karma and hit smite by accident - I'll be back).
I can toggle the year (2006), but if I try to open any month I get the error processing a database query (2 test sites). I'll see if I can get more info.
@lontano
Thank's for your contrib (it will be added in the pack)
@rphMedia
What is the error message ? I've no problem on my site (see here (http://f.keller.free.fr/index.php?file=stats/stats&year=2006&month=5))
Quote from: FrantzI've no problem on my site (see here)
Ahh, but you do - not as severe. Somewhere in your javascript (both IE & FF).
Here's the message I get -
QuoteWhile executing query "SELECT DAY(msg_date) AS period, COUNT(*) AS number
FROM cpg146_comments
WHERE YEAR(msg_date) = 2006
AND MONTH(msg_date) = 10
GROUP BY period
ORDER BY period DESC" on 0
mySQL error: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '(msg_date) AS period, COUNT(*) AS number
FROM cpg146_comme
Also -
...gallery/include/functions.inc.php - Line: 249 (this is an unmodified file)
See http://forum.coppermine-gallery.net/index.php?topic=34858.msg172530#msg172530 in the original thread.
Quote from: Nibbler on November 12, 2006, 04:59:20 PM
See http://forum.coppermine-gallery.net/index.php?topic=34858.msg172530#msg172530 in the original thread.
That did it, thanks Nibbler.
@Nibbler
@rphMedia,
Ok I've correct the code (in version 1.1)
@ All, I've made a new version(1.1) of this plugin, adding some others stats inspired by Pslawinsky's code http://forum.coppermine-gallery.net/index.php?topic=23945.0 (http://forum.coppermine-gallery.net/index.php?topic=23945.0)
demo (http://f.keller.free.fr/index.php?file=stats/stats)
See stats_1_1.zip attached on the very first post
Works good out-of-the-box !!
Thanks Frantz!
Dutch lang file attached ;)
Cheers!
Hein
Quoteupdated dutch.php - <dutch> Tekst klopt nu beter bij de statistiek </dutch>
Thank's Hein,
Original pack updated in the first post with duch lang file
I installed this plugin, but cannot get it to work...
It loads the page for about half a minute, and then displays a blank page.
Check http://www.docgonzo.com/index.php?file=stats/stats
"25976 files in 294 albums and 37 categories with 13930 comments viewed 7348911 times" :o
I'm guessing that you have too many stats ! It's timing out.
lol, that could be it...
Although, when i use the stats mod that i found floating around, it does kinda work...
(think it was a mod for this plugin, have searched for the exact location, but can't seem to find it again, i'm talking about stats.zip)
This plugin is a mix from two Mods, see links in the first post of this thread
Quote from: Frantz on November 19, 2006, 08:51:01 PM
This plugin is a mix from two Mods, see links in the first post of this thread
I'm using stats1_1.zip atm
http://forum.coppermine-gallery.net/index.php?topic=23945.msg170221#msg170221
Tried those, but all i get is 'The selected album does not exist'
You cannot possibly get that message by using the code I posted, since the code does not contain the message in the first place.
Frantz. Updated dutch.php a bit. Attached file to my previous post.
Cheers!
Hein
Hein,
QuoteUpdated dutch.php a bit. Attached file to my previous post.
Added in the original pack
Is it possible to enhance the plugin to included how many visitors there were per day including where they came from (IP or country flags etc..) ?
Cheers!
Hein
Quote from: Hein on November 20, 2006, 01:06:07 PM
Is it possible to enhance the plugin to included how many visitors there were per day including where they came from (IP or country flags etc..) ?
Not sure, i must look if the data's are stored in the database.
great plugin!!
I am getting this error:
While executing query "SELECT YEAR(FROM_UNIXTIME(dateRegistered)) AS period, COUNT(*) AS number
FROM `opshot5_smf1`.smf_members
GROUP BY period
ORDER BY period DESC" on 0
mySQL error:
File: /home/opshot5/public_html/gallery/include/functions.inc.php - Line: 248
debug info provided.
In stats.php, each query that runs on usertable should use the udb link id, like so
...
FROM {$cpg_udb->usertable}
...
$result = cpg_db_query($sql, $cpg_udb->link_id);
3 occurences.
huh? I don't understand? Can I get that in English please? :'( :'(
Ok works like a charm. Thanks for not posting a easy answer (step by step) somtimes I need a little nudge as in not posting step by step. After reading your solution a few more times it is crystal clear. :)
Here's my German Translation...
Thank's M@rk, will be added in the original pack
any chance of adding VIEWS by day? ::)
Great plugin Frantz.
spanish lang file attached.
just_some_guy
thank's just_some_guy,
your lang file is added in the pack in the first post
Hello,
I seem to have an error: the plugin is displaying 1970 as year.
See here: http://www.mysimtractor.com/cpg1412/index.php?file=stats/stats
thanks,
Check the pictures table for entries with invalid dates and correct them.
That did the trick, it must have happened when i was making the plugin i am working on, I neve told it to add a time stamp...
Thanks again nibbler!
I've installed v1.1.1 and get a blank page when I go to view stats.
No error message is given.
Any idea what is blocking the page from loading?
Either get the error message from the server error log or enable display of errors. Can't tell anything from a blank page.
Ok thanks.
Displaying errors shows the following:
/plugins/stats/include/init.inc.php
* Notice line 20: Undefined variable: CONFIG
which points to the following as line 20:
if (file_exists("plugins/stats/lang/{$CONFIG['lang']}.php")) {
does that help at all?
Error messages, not notices!
Could the attached Debug Info help? The blank page is completely blank when I "View Source" and php does not create an error in the log
Great mod :) works just as advertised!
Maybe stat info on how many pictures viewed???
Coppermine doesn't count views per day.
Hello,
ist it possible to hide the link in the menu for guest and members and show it only for admins.
Maybe it is possible in further Versions to select usergroup permissions at the cpg configuration.
Quoteist it possible to hide the link in the menu for guest and members and show it only for admins.
Yes, in codebase.php change
function stats_page_start()
{
global $template_sys_menu, $template_sys_menu_spacer, $template_sys_menu_button, $sys_menu_buttons;
global $CONFIG, $lang_plugin_stats;
require ('plugins/stats/include/init.inc.php');
stats_add_admin_button('index.php?file=stats/stats',$lang_plugin_stats['menu_link'],$lang_plugin_stats['menu_link'],$lang_plugin_stats['menu_link']);
}
to
function stats_page_start()
{
global $template_sys_menu, $template_sys_menu_spacer, $template_sys_menu_button, $sys_menu_buttons;
global $CONFIG, $lang_plugin_stats;
require ('plugins/stats/include/init.inc.php');
if (USER_IS_ADMIN){
stats_add_admin_button('index.php?file=stats/stats',$lang_plugin_stats['menu_link'],$lang_plugin_stats['menu_link'],$lang_plugin_stats['menu_link']);
}
}
Thanks for the very quick reply. That's what I needed! 8)