forum.coppermine-gallery.net

Support => cpg1.4 plugins => cpg1.4.x Support => Older/other versions => cpg1.4 plugin contributions => Topic started by: François Keller on November 12, 2006, 03:03:00 pm

Title: Stats: Gallery statistics by date
Post by: François Keller on November 12, 2006, 03:03:00 pm
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 Version
Version 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)
Title: Re: Stats: Gallery statistics by date
Post by: Davide Renda on November 12, 2006, 04:21:34 pm
Nice, easy and useful! Good work Fratz!
Italian lang file attached
Title: Re: Stats: Gallery statistics by date
Post by: rphMedia on November 12, 2006, 04:26:01 pm
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.
Title: Re: Stats: Gallery statistics by date
Post by: François Keller on November 12, 2006, 04:32:14 pm
@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))
Title: Re: Stats: Gallery statistics by date
Post by: rphMedia on November 12, 2006, 04:42:43 pm
Quote from: Frantz
I'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 -

Quote
While 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)



Title: Re: Stats: Gallery statistics by date
Post by: 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.
Title: Re: Stats: Gallery statistics by date
Post by: rphMedia on November 12, 2006, 05:06:18 pm
See http://forum.coppermine-gallery.net/index.php?topic=34858.msg172530#msg172530 in the original thread.

That did it, thanks Nibbler.
Title: Re: Stats: Gallery statistics by date
Post by: François Keller on November 12, 2006, 06:16:42 pm
@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
Title: Re: Stats: Gallery statistics by date
Post by: rphMedia on November 12, 2006, 06:50:46 pm
Works good out-of-the-box !!
Title: Re: Stats: Gallery statistics by date
Post by: Hein Traag on November 18, 2006, 05:53:55 pm
Thanks Frantz!
Dutch lang file attached ;)

Cheers!
Hein

Quote
updated dutch.php - <dutch> Tekst klopt nu beter bij de statistiek </dutch>
Title: Re: Stats: Gallery statistics by date
Post by: François Keller on November 18, 2006, 07:14:47 pm
Thank's Hein,

Original pack updated in the first post with duch lang file
Title: Re: Stats: Gallery statistics by date
Post by: docgonzo on November 19, 2006, 06:11:56 pm
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
Title: Re: Stats: Gallery statistics by date
Post by: rphMedia on November 19, 2006, 08:21:42 pm
"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.
Title: Re: Stats: Gallery statistics by date
Post by: docgonzo on November 19, 2006, 08:45:35 pm
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)
Title: Re: Stats: Gallery statistics by date
Post by: François Keller 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
Title: Re: Stats: Gallery statistics by date
Post by: docgonzo on November 19, 2006, 08:53:02 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
Title: Re: Stats: Gallery statistics by date
Post by: Nibbler on November 19, 2006, 08:54:53 pm
http://forum.coppermine-gallery.net/index.php?topic=23945.msg170221#msg170221
Title: Re: Stats: Gallery statistics by date
Post by: docgonzo on November 19, 2006, 09:01:32 pm
Tried those, but all i get is 'The selected album does not exist'
Title: Re: Stats: Gallery statistics by date
Post by: Nibbler on November 19, 2006, 09:37:17 pm
You cannot possibly get that message by using the code I posted, since the code does not contain the message in the first place.
Title: Re: Stats: Gallery statistics by date
Post by: Hein Traag on November 19, 2006, 09:57:54 pm
Frantz. Updated dutch.php a bit. Attached file to my previous post.

Cheers!
Hein
Title: Re: Stats: Gallery statistics by date
Post by: François Keller on November 19, 2006, 10:44:24 pm
Hein,

Quote
Updated dutch.php a bit. Attached file to my previous post.
Added in the original pack
Title: Re: Stats: Gallery statistics by date
Post by: Hein Traag 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..) ?

Cheers!
Hein
Title: Re: Stats: Gallery statistics by date
Post by: François Keller on November 20, 2006, 01:18:57 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.
Title: Re: Stats: Gallery statistics by date
Post by: mystifiedlala on November 23, 2006, 05:56:33 am
great plugin!!
Title: Re: Stats: Gallery statistics by date
Post by: MarkP on November 28, 2006, 03:07:59 am
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.

Title: Re: Stats: Gallery statistics by date
Post by: Nibbler on November 28, 2006, 12:34:57 pm
In stats.php, each query that runs on usertable should use the udb link id, like so

Code: [Select]
...
FROM {$cpg_udb->usertable}
...

Code: [Select]
$result = cpg_db_query($sql, $cpg_udb->link_id);
3 occurences.
Title: Re: Stats: Gallery statistics by date
Post by: MarkP on November 29, 2006, 03:14:40 am
huh? I don't understand? Can I get that in English please?  :'( :'(
Title: Re: Stats: Gallery statistics by date
Post by: MarkP on December 01, 2006, 03:31:02 pm
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.  :)
Title: German Translation
Post by: m@rk on December 12, 2006, 01:35:28 am
Here's my German Translation...
Title: Re: Stats: Gallery statistics by date
Post by: François Keller on December 12, 2006, 07:28:25 am
Thank's M@rk, will be added in the original pack
Title: Re: Stats: Gallery statistics by date
Post by: lifter on September 01, 2007, 04:03:31 am
any chance of adding VIEWS by day?  ::)
Title: Re: Stats: Gallery statistics by date
Post by: just_some_guy on October 01, 2007, 10:48:30 pm
Great plugin Frantz.

spanish lang file attached.


just_some_guy
Title: Re: Stats: Gallery statistics by date
Post by: François Keller on October 02, 2007, 07:57:39 am
thank's just_some_guy,

your lang file is added in the pack in the first post
Title: Re: Stats: Gallery statistics by date
Post by: just_some_guy on October 08, 2007, 08:38:20 pm
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,
Title: Re: Stats: Gallery statistics by date
Post by: Nibbler on October 08, 2007, 08:41:42 pm
Check the pictures table for entries with invalid dates and correct them.
Title: Re: Stats: Gallery statistics by date
Post by: just_some_guy on October 08, 2007, 08:46:18 pm
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!
Title: Re: Stats: Gallery statistics by date
Post by: Gephri on March 03, 2008, 11:03:47 pm
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?
Title: Re: Stats: Gallery statistics by date
Post by: Nibbler on March 03, 2008, 11:10:15 pm
Either get the error message from the server error log or enable display of errors. Can't tell anything from a blank page.
Title: Re: Stats: Gallery statistics by date
Post by: Gephri on March 03, 2008, 11:57:18 pm
Ok thanks.

Displaying errors shows the following:

Code: [Select]
/plugins/stats/include/init.inc.php
    * Notice line 20: Undefined variable: CONFIG

which points to the following as line 20:
Code: [Select]
if (file_exists("plugins/stats/lang/{$CONFIG['lang']}.php")) {

does that help at all?
Title: Re: Stats: Gallery statistics by date
Post by: Joachim Müller on March 04, 2008, 08:02:29 am
Error messages, not notices!
Title: Re: Stats: Gallery statistics by date
Post by: Gephri on March 04, 2008, 06:47:36 pm
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
Title: Re: Stats: Gallery statistics by date
Post by: MechMykl on April 19, 2008, 01:13:54 am
Great mod :) works just as advertised!

Maybe stat info on how many pictures viewed???
Title: Re: Stats: Gallery statistics by date
Post by: Nibbler on April 19, 2008, 01:19:33 am
Coppermine doesn't count views per day.
Title: Re: Stats: Gallery statistics by date
Post by: Audax on May 18, 2008, 01:48:11 am
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.
Title: Re: Stats: Gallery statistics by date
Post by: François Keller on May 18, 2008, 10:01:34 am
Quote
ist it possible to hide the link in the menu for guest and members and show it only for admins.
Yes, in codebase.php change
Code: [Select]
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
Code: [Select]
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']);
  }
}
Title: Re: Stats: Gallery statistics by date
Post by: Audax on May 18, 2008, 10:18:35 pm
Thanks for the very quick reply. That's what I needed! 8)