forum.coppermine-gallery.net
No Support => Modifications/Add-Ons/Hacks => Mods: Statistics => Topic started by: luchtzak on July 18, 2006, 10:18:48 am
-
Does this exist for the coppermine gallery?
[ Page generation: 0.1925s ][ DB Queries: 13 (0.1393s) ]
or
Script Execution Time: 0.20084 | SQL Queries: 10
many of the popular softwares have this, perhaps it can be programmed for coppermine too?
any suggestion where to find?
-
Best suggestion is reading the docs...
http://coppermine-gallery.net/demo/cpg14x/docs/index.htm#admin_misc
-
It's not visible to regular users, is that what you are requesting ?
-
it's not that what I am looking for.
I would like to see on the bottom of every page a message saying:
this page has been generated in xxx seconds with xx db queries made. e.g. on the bottom of my website: www.luchtzak.be or http://top-100.luchtzak.be/
-
If you are using cpg1.4.x then you can do the following ...
Create a new script called 'customFooter.php' with code given below and place it in your coppermine folder.
<?php
global $cpg_time_start, $query_stats;
$time_end = cpgGetMicroTime();
$time = round($time_end - $cpg_time_start, 3);
$query_count = count($query_stats);
$total_query_time = array_sum($query_stats);
echo '<p align="center">[ Page generation: '.$time.'s ][ DB Queries: '.$query_count.' ('.$total_query_time.'s)]</p>';
?>
then log in to the gallery, go to config page and change the value of Path to custom footer include to customFooter.php
This should show the stats at the bottom of every page to every user.
-
nice work abbas ;)
-
From the first post, this sounded like a support request rather than a feature request.
And now with Abbas' code contribution, maybe this thread belongs on the Mods/Add-ons board under Stats.
-
Nice programming abbas!
1 item though is the database queries are not shown: http://coppermine.luchtzak.be/displayimage.php?pos=-9043
running 1.4.8 stable
-
functions.inc.php, change
if (isset($CONFIG['debug_mode']) && (($CONFIG['debug_mode']==1) || ($CONFIG['debug_mode']==2) )) {
$duration = round($query_end - $query_start, 3);
$query_stats[] = $duration;
$queries[] = "$query ({$duration}s)";
}
to
//if (isset($CONFIG['debug_mode']) && (($CONFIG['debug_mode']==1) || ($CONFIG['debug_mode']==2) )) {
$duration = round($query_end - $query_start, 3);
$query_stats[] = $duration;
$queries[] = "$query ({$duration}s)";
//}
Shame about that, would have been an easy plugin otherwise. Moving to mods board.
-
nice one that worked for me, been looking for something like that
-
@Nibbler: maybe we should add another plugin hook for cpg1.5.x to allow a full pluginized version?
-
Yes, would be useful to have a hook in cpg_db_query.