cvs: peclweb /public_html package-stats.php

From: Date: Wed, 18 Oct 2006 01:33:03 +0000
Subject: cvs: peclweb /public_html package-stats.php
Groups: php.pecl.cvs 
Request: Send a blank email to pecl-cvs+get-6505@lists.php.net to get a copy of this message
cellog Wed Oct 18 01:33:03 2006 UTC Modified files: /peclweb/public_html package-stats.php Log: sort versions by version order using version_compare with highest version near the top of the dropdown http://cvs.php.net/viewvc.cgi/peclweb/public_html/package-stats.php?r1=1.49&r2=1.50&diff_format=u Index: peclweb/public_html/package-stats.php diff -u peclweb/public_html/package-stats.php:1.49 peclweb/public_html/package-stats.php:1.50 --- peclweb/public_html/package-stats.php:1.49 Sun Nov 20 23:38:23 2005 +++ peclweb/public_html/package-stats.php Wed Oct 18 01:33:03 2006 @@ -16,7 +16,7 @@ | Authors: Martin Jansen <mj@php.net> | | Richard Heyes <richard@php.net> | +----------------------------------------------------------------------+ - $Id: package-stats.php,v 1.49 2005/11/20 23:38:23 rasmus Exp $ + $Id: package-stats.php,v 1.50 2006/10/18 01:33:03 cellog Exp $ */ require_once 'HTML/Form.php'; @@ -110,6 +110,7 @@ $query = "SELECT id, version FROM releases WHERE package = '" . $_GET['pid'] . "'"; $rows = $dbh->getAll($query, DB_FETCHMODE_ASSOC); + usort($rows, create_function('$a,$b', 'return version_compare($b[\'version\'],$a[\'version\']);')); foreach ($rows as $row) { $selected = ''; if (isset($_GET['rid']) && $_GET['rid'] == $row['id']) { @@ -188,7 +189,7 @@ /* * Print the graph */ - printf('<br /><img src="package-stats-graph.php?pid=%s&amp;releases=%s_339900" name="stats_graph" width="543" height="200" alt="" />', + printf('<br /><img src="package-stats-graph.php?pid=%s&releases=%s_339900" name="stats_graph" width="543" height="200" alt="" />', $_GET['pid'], isset($_GET['rid']) ? (int)$_GET['rid'] : '' );

« previous php.pecl.cvs (#6505) next »