From 6c55180786f695a8e116d7a64421fb6f4d34fd2d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20Nicolaysen=20S=C3=B8rnes?= Date: Thu, 5 Apr 2007 02:27:31 +0000 Subject: [PATCH] Use objectGetEntriesCount() in more places --- appdbStats.php | 4 ++-- include/util.php | 25 ------------------------- index.php | 11 ++++++----- 3 files changed, 8 insertions(+), 32 deletions(-) diff --git a/appdbStats.php b/appdbStats.php index 5b8e859..18f9766 100644 --- a/appdbStats.php +++ b/appdbStats.php @@ -56,13 +56,13 @@ echo "\n\n"; /* Display the number of application familes */ echo "\n"; echo " Application families:\n"; -echo " ".getNumberOfAppFamilies()."\n"; +echo " ".application::objectGetEntriesCount(false, false)."\n"; echo "\n\n"; /* Display the number of versions */ echo "\n"; echo " Versions:\n"; -echo " ".getNumberOfVersions()."\n"; +echo " ".version::objectGetEntriesCount(false, false)."\n"; echo "\n\n"; /* Display the number of application maintainers */ diff --git a/include/util.php b/include/util.php index 0c53a7f..2a99101 100644 --- a/include/util.php +++ b/include/util.php @@ -205,15 +205,6 @@ function make_maintainer_rating_list($varname, $cvalue) echo "\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() { diff --git a/index.php b/index.php index be65e87..1fa430d 100644 --- a/index.php +++ b/index.php @@ -57,7 +57,7 @@ If you have screenshots or links to contribute, please browse the database and u

$iNumApps 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 $numApps applications currently in the database with\n"; - echo "$shVoteAppLink being the\n"; + echo " with $shVoteAppLink being the\n"; echo "top voted application.\n"; } else { - echo "There are $numApps applications currently in the database, please\n"; - echo "vote for your favourite application.\n"; + echo " please vote for your favourite application.\n"; } ?>