[31369] trunk/www/ports.php

jmpp at macports.org jmpp at macports.org
Wed Nov 21 11:30:30 PST 2007


Revision: 31369
          http://trac.macosforge.org/projects/macports/changeset/31369
Author:   jmpp at macports.org
Date:     2007-11-21 11:30:29 -0800 (Wed, 21 Nov 2007)

Log Message:
-----------
Use ports_count() function defined in includes/common.inc to output the total count of existing ports. Code_duplication--!

Modified Paths:
--------------
    trunk/www/ports.php

Modified: trunk/www/ports.php
===================================================================
--- trunk/www/ports.php	2007-11-21 18:26:14 UTC (rev 31368)
+++ trunk/www/ports.php	2007-11-21 19:30:29 UTC (rev 31369)
@@ -45,16 +45,7 @@
             </tr>
             <tr><td colspan="4"><hr /></td></tr>
             <tr>
-<?php
-                $result = mysql_query("SELECT count(*) from $portsdb.portfiles");
-                if ($result) {
-                    $row = mysql_fetch_array($result);
-                    $count = $row[0];
-                } else {
-                    $count = 0;
-                }
-?>
-                <td colspan="4" align="left"><a href="<?php echo $_SERVER['PHP_SELF']; ?>?by=all">View All Software Titles (<?php echo $count; ?>)</a></td>
+                <td colspan="4" align="left"><a href="<?php echo $_SERVER['PHP_SELF']; ?>?by=all">View All Software Titles (<?php print ports_count(); ?>)</a></td>
             </tr>
 <?php
             if (!$by || (!$substr && $by != "all")) {

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/macports-changes/attachments/20071121/747cd4bf/attachment-0001.html


More information about the macports-changes mailing list