The shortest unit of time in the multiverse is the New York Second, defined as the period of time between the traffic lights turning green and the cab behind you honking - Terry Pratchett, Lords and Ladies


Grabbing Coppermine stats

Wednesday 1st February, 2006 | 1:46 pm

With the photo gallery up and running, I was after a way of grabbing basic stats from Coppermine and integrating this alongside the blog stats. Coppermine has some quite nice stats built into, and I was keen to simply get a quick photo + album count. Unless I’m missing something obvious, there doesn’t seem to be a a simple way of getting this out of the database. In the end, cpmFetch seemed like a straight-forward way of doing it, short of writing my own SQL queries, and although I’m not likely to use the ability to grab photos straight from the gallery, at least the functionality is there.

For anyone looking at getting basic stats from Coppermine, simply adjust the location of your cpmFetch install, and customise the formatting of the output:

require_once "gallery/cpmfetch/cpmfetch.php";
$objCpm = new cpm('/gallery');
$objCpm->cpm_formatStats('Gallery: %f photos in %a albums');
$objCpm->cpm_close();

No comments yet

Leave a Reply


If you must, please use valid XHTML
You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>