This little class allows you to get statistics of your packages from
the PHP Classes website. So you can write them on your own website.
The statistics are stored into an array (attribute of the class) where :
atu means 'all time users'
atr " 'all time rank'
wu " 'week users'
wr " 'week rank'
Using it is simple. To get the stats of the package 2620 (QCM Class) :
$qcm = new phpcstats(2620);
echo "Number of downloads of the QCM class: ".$qcm->stats["atu"];
or
$qcm = new phpcstats(2620);
$local_dnl = { calculation of the downloads from your own website }
$phpc_dnl = $qcm->stats["atu"]; // and from the PHP Classes website
echo "Total of downloads: " . ($local_dnl + $phpc_dnl);
---
Pierre FAUQUE
pierre@fauque.net
|