appdb/ ./appdbStats.php ./index.php include/ut ...

WineHQ wineowner at wine.codeweavers.com
Wed Apr 4 21:27:31 CDT 2007


ChangeSet ID:	31031
CVSROOT:	/opt/cvs-commit
Module name:	appdb
Changes by:	wineowner at winehq.org	2007/04/04 21:27:31

Modified files:
	.              : appdbStats.php index.php 
	include        : util.php 

Log message:
	Alexander Nicolaysen Sørnes <alex at thehandofagony.com>
	Use objectGetEntriesCount() in more places

Patch: http://cvs.winehq.org/patch.py?id=31031

Old revision  New revision  Changes     Path
 1.16          1.17          +2 -2       appdb/appdbStats.php
 1.44          1.45          +6 -5       appdb/index.php
 1.85          1.86          +0 -25      appdb/include/util.php

Index: appdb/appdbStats.php
diff -u -p appdb/appdbStats.php:1.16 appdb/appdbStats.php:1.17
--- appdb/appdbStats.php:1.16	5 Apr 2007  2:27:31 -0000
+++ appdb/appdbStats.php	5 Apr 2007  2:27:31 -0000
@@ -56,13 +56,13 @@ echo "</tr>\n\n";
 /* Display the number of application familes */
 echo "<tr class=color4>\n";
 echo "    <td>Application families:</td>\n";
-echo "    <td>".getNumberOfAppFamilies()."</td>\n";
+echo "    <td>".application::objectGetEntriesCount(false, false)."</td>\n";
 echo "</tr>\n\n";
 
 /* Display the number of versions */
 echo "<tr class=color4>\n";
 echo "    <td>Versions:</td>\n";
-echo "    <td>".getNumberOfVersions()."</td>\n";
+echo "    <td>".version::objectGetEntriesCount(false, false)."</td>\n";
 echo "</tr>\n\n";
 
 /* Display the number of application maintainers */
Index: appdb/index.php
diff -u -p appdb/index.php:1.44 appdb/index.php:1.45
--- appdb/index.php:1.44	5 Apr 2007  2:27:31 -0000
+++ appdb/index.php	5 Apr 2007  2:27:31 -0000
@@ -57,7 +57,7 @@ If you have screenshots or links to cont
 </p>
 <?php
 
-    $numApps = getNumberOfVersions();
+    $iNumApps = version::objectGetEntriesCount(false, false);
 
     $voteQuery = "SELECT appVotes.versionId, count(userId) as count ".
         "FROM appVotes ".
@@ -65,17 +65,18 @@ If you have screenshots or links to cont
     $hResult = query_parameters($voteQuery);
     $oRow = mysql_fetch_object($hResult);
 
+    echo "There are <b>$iNumApps</b> applications currently in the database";
+
     // don't mention the top application if there are no votes yet
     if($oRow->versionId)
     {
        $shVoteAppLink = version::fullNameLink($oRow->versionId);
-       echo "There are <b>$numApps</b> applications currently in the database with\n";
-       echo "$shVoteAppLink being the\n";
+       echo " with $shVoteAppLink being the\n";
        echo "top <a href='votestats.php'>voted</a> application.\n";
     } else
     {
-       echo "There are <b>$numApps</b> applications currently in the database, please\n";
-       echo "<a href=\"".BASE."help/?sTopic=voting\" title=\"help on voting\" style=\"cursor: help\">vote</a> for your favourite application.\n";
+       echo " please <a href=\"".BASE."help/?sTopic=voting\" title=\"help on voting\"".
+               "style=\"cursor: help\">vote</a> for your favourite application.\n";
     }
 ?>
 
Index: appdb/include/util.php
diff -u -p appdb/include/util.php:1.85 appdb/include/util.php:1.86
--- appdb/include/util.php:1.85	5 Apr 2007  2:27:31 -0000
+++ appdb/include/util.php	5 Apr 2007  2:27:31 -0000
@@ -205,15 +205,6 @@ function make_maintainer_rating_list($va
     echo "</select>\n";
 }
 
-/* get the total number of vendors from the vendor table */
-function getVendorCount()
-{
-    $sQuery = "SELECT count(*) as vendors FROM vendor";
-    $hResult = query_parameters($sQuery);
-    $oRow = mysql_fetch_object($hResult);
-    return $oRow->vendors;
-}
-
 /* Get the number of users in the database */
 function getNumberOfComments()
 {
@@ -222,22 +213,6 @@ function getNumberOfComments()
     return $oRow->num_comments;
 }
 
-/* Get the number of versions in the database */
-function getNumberOfVersions()
-{
-    $hResult = query_parameters("SELECT count(versionId) as num_versions FROM appVersion WHERE versionName != 'NONAME';");
-    $oRow = mysql_fetch_object($hResult);
-    return $oRow->num_versions;
-}
-
-/* Get the number of app familes in the database */
-function getNumberOfAppFamilies()
-{
-    $hResult = query_parameters("SELECT count(*) as num_appfamilies FROM appFamily;");
-    $oRow = mysql_fetch_object($hResult);
-    return $oRow->num_appfamilies;
-}
-
 /* Get the number of queued bug links in the database */
 function getNumberOfQueuedBugLinks()
 {



More information about the wine-cvs mailing list