forum.coppermine-gallery.net
No Support => Modifications/Add-Ons/Hacks => Mods: Statistics => Topic started by: Nibbler on August 11, 2006, 11:29:38 pm
-
I wanted my 10,000th post to be useful, so have this code. ;)
This script will give you an overview of pictures, comments and user registrations per year, month and day over the life of your Coppermine gallery. It is suspiciously similar to the stats feature in SMF.
Demos:
http://www.ic-gallery.com/stats.php
http://www.neeth.info/galerija/stats.php
From the attached file, stats.php goes into your coppermine folder and the images go into your images folder.
-
Awesome plugin, very interesting to see! :)
-
Not a plugin though, but a mod.
@Nibbler: should this be added to the devel branch?
-
It won't work on my 1.4.9 installation. I get "Critical error
There was an error while processing a database query"
, when clicking a month (eg. stats.php?year=2006&month=9). The general statistic seems to work (with eg. stats.php?year=2006). Any ideas about what could be wrong?
versioncheck.php says:
Total files/folders checked: 244
Mandatory files missing: 0
Optional files missing: 0
Files left over from outdated Coppermine version: 0
Outdated file versions: 0
Cheers,
Henrik
-
Enable debug mode and post the mysql error message you get (not the entire debug output) when you replicate the error.
-
While executing query "SELECT DAY(msg_date) AS period, COUNT(*) AS number
FROM cpg148_comments
WHERE YEAR(msg_date) = 2006
AND MONTH(msg_date) = 9
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 cpg148_comme
Additional info:
SELECT DAY(msg_date) FROM cpg148_comments
gives
MySQL said:
#1064 - 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 )
FROM cpg148_comments LIMIT 0, 30' at line 1
If I change "DAY" to "MONTH" I do not get the syntax error.
Thanks,
Henrik
-
Additional question: On http://www.neeth.info/galerija/stats.php you also have a "views" column. How do I enable that?
Cheers,
Henrik
-
Try changing DAY to DAYOFMONTH in the code. Views is not part of this mod.
-
that helped and stats.php now works as expected, thanks for your support!
Actually, it was the view count statistics I was interested in. Is it possible to get that feature somehow?
Cheers,
Henrik
-
Thanks for the mod.
Attached a dutch language version of the stats.php
Cheers!
Hein
-
@ Nibbler: Thanks for this nice Mod!
Could you please post your version of the stats.php, which displays all tables of stats like here (http://www.neeth.info/galerija/stats.php)?
I'm using CPM 1.4.10 with the water_drop theme and when the stats page loads, I see the margins of the stats bars but when the page has loaded completely, the bars disappear and in the single cells simply the numbers for each stat are shown.
And the expand.gif and collapse.gif are not displayed at all.
/include/logger.inc.php
* Warning line 142: filemtime() [function.filemtime]: open_basedir restriction in effect. File(logs/..) is not within the allowed path(s): (/srv/www/web322/html/:/srv/www/web322/phptmp/:/srv/www/web322/files/:/srv/www/web322/atd/)
* Warning line 142: filemtime() [function.filemtime]: stat failed for logs/..
* Warning line 155: unlink() [function.unlink]: open_basedir restriction in effect. File(logs/..) is not within the allowed path(s): (/srv/www/web322/html/:/srv/www/web322/phptmp/:/srv/www/web322/files/:/srv/www/web322/atd/)
* Warning line 51: fopen(logs/global.log.php) [function.fopen]: failed to open stream: Permission denied
* Warning line 52: fwrite(): supplied argument is not a valid stream resource
* Warning line 53: fwrite(): supplied argument is not a valid stream resource
* Warning line 54: fclose(): supplied argument is not a valid stream resource
/plugins/final_extract/include/init2.inc.php
* Warning line 30: mysql_free_result(): supplied argument is not a valid MySQL result resource
How can I fix that problem?
Thank you in advance & greetings
René
-
You probably forgot to upload the images. My file is too customised to be of much use to anyone else. The extra tables are from http://forum.coppermine-gallery.net/index.php?topic=23945.0, a different mod.
-
You probably forgot to upload the images. My file is too customised to be of much use to anyone else. The extra tables are from http://forum.coppermine-gallery.net/index.php?topic=23945.0, a different mod.
I uploaded the images into the main directory where also the stats.php is.
Could you post your stats.php?
If you don't want to post it here, you could send it to me via mail.
How can I add a column with the number of views in the table?
René
-
I saw in the stats.php that the images have to be in /images.
I added them in /images so they are displayed now.
-
From the attached file, stats.php goes into your coppermine folder and the images go into your images folder.
As per the instructions.
Script attached to this post.
-
Could you post your stats.php?
If you don't want to post it here, you could send it to me via mail.
How can I add a column with the number of views in the table?
René
I too am VERY interested in the modified version with "views". May I request it as well. Here or in an email to me would rock. thanks!
-
Hi there,
I have modified Coppermine to suite the needs of a recruitment company who make video interviews of candidates and employers log in to view the videos.
www.sanzavideo.com is the domain. You can use coppermine as the username and password.
I have installed the mod from this thread and searched the forums however I have not been able to find reference to a stats. page that can display all the files by date added/uploaded.
The purpose of this is they want to be able to easily see C.V.'s and videos which are over so many weeks or months old so they can update them.
Can you please advise if there is anything like this currently available and if not can it be achieved?
Thanks in advance
Jason
-
The search function has a date range. Please don't ask unrelated questions on mod threads.