Report new bug | New search | Development Roadmap Status: Open | Feedback | All

Bug #5259 Package statistics per category show 1 random release only
Submitted: 2005-08-31 18:28 UTC
From: pear dot nosey at veggerby dot dk Assigned: cellog
Status: Closed Package: Web Site
PHP Version: Irrelevant OS: irrelevant
Roadmaps: (Not assigned)    
Subscription  
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes. If this is not your bug, you can add a comment by following this link. If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
2006-10-18 19:28 UTC
Package:
Bug Type:
Summary:
From: pear dot nosey at veggerby dot dk
New email:
PHP Version: Package Version: OS:

 

 [2005-08-31 18:28 UTC] pear dot nosey at veggerby dot dk
Description: ------------ On the package statistics page, when selecting a category, fx. HTTP (http://pear.php.net/package-stats.php?cid=11&pid=&rid=). HTTP_Upload shows with 36.000+ downloads, while it on the statitics page for the package shows 72.000+ downloads. The downloads it seems are only show for 1 relase of the package (and a random it seems for HTTP_Upload it seems to be version 0.8.1) Test script: --------------- Without having done a deep review of the code, it seems to be a problem with the SQL for the 'cid' case - it does not sum over the dl_number. I think this ought to fix it: Index: package-stats.php =================================================================== RCS file: /repository/pearweb/public_html/package-stats.php,v retrieving revision 1.69 diff -u -r1.69 package-stats.php --- package-stats.php 1 Jun 2005 14:04:49 -0000 1.69 +++ package-stats.php 31 Aug 2005 18:19:06 -0000 @@ -317,10 +317,10 @@ $total_categories = $dbh->getOne(sprintf("SELECT COUNT(*) FROM categories WHERE parent = %d", $_GET['cid'])); // Query to get package list from package_stats_table - $query = sprintf("SELECT ps.dl_number, ps.package, ps.release, ps.pid, ps.rid, ps.cid - FROM package_stats ps, packages p - WHERE p.package_type = 'pear' AND p.id = ps.pid AND - p.category = %s GROUP BY ps.pid ORDER BY ps.dl_number DESC", + $query = sprintf("SELECT sum(ps.dl_number) as dl_number, ps.package, ps.pid, ps.rid, ps.cid + FROM package_stats ps, packages p + WHERE p.id = ps.pid AND p.package_type = 'pear' AND + p.category = %s GROUP BY ps.pid ORDER BY dl_number DESC", $_GET['cid'] ); Expected result: ---------------- The sum of _all_ releases of the package.

Comments

 [2006-10-18 19:28 UTC] User who submitted this comment has not confirmed identity
If you submitted this note, check your email.If you do not have a message, click here to re-send
MANUAL CONFIRMATION IS NOT POSSIBLE.  Write a message to pear-dev@lists.php.net
to request the confirmation link.  All bugs/comments/patches associated with this

email address will be deleted within 48 hours if the account request is not confirmed!