Use objectGetEntriesCount() in more places
This commit is contained in:
committed by
WineHQ
parent
9a953f7ce8
commit
6c55180786
@@ -56,13 +56,13 @@ echo "</tr>\n\n";
|
|||||||
/* Display the number of application familes */
|
/* Display the number of application familes */
|
||||||
echo "<tr class=color4>\n";
|
echo "<tr class=color4>\n";
|
||||||
echo " <td>Application families:</td>\n";
|
echo " <td>Application families:</td>\n";
|
||||||
echo " <td>".getNumberOfAppFamilies()."</td>\n";
|
echo " <td>".application::objectGetEntriesCount(false, false)."</td>\n";
|
||||||
echo "</tr>\n\n";
|
echo "</tr>\n\n";
|
||||||
|
|
||||||
/* Display the number of versions */
|
/* Display the number of versions */
|
||||||
echo "<tr class=color4>\n";
|
echo "<tr class=color4>\n";
|
||||||
echo " <td>Versions:</td>\n";
|
echo " <td>Versions:</td>\n";
|
||||||
echo " <td>".getNumberOfVersions()."</td>\n";
|
echo " <td>".version::objectGetEntriesCount(false, false)."</td>\n";
|
||||||
echo "</tr>\n\n";
|
echo "</tr>\n\n";
|
||||||
|
|
||||||
/* Display the number of application maintainers */
|
/* Display the number of application maintainers */
|
||||||
|
|||||||
@@ -205,15 +205,6 @@ function make_maintainer_rating_list($varname, $cvalue)
|
|||||||
echo "</select>\n";
|
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 */
|
/* Get the number of users in the database */
|
||||||
function getNumberOfComments()
|
function getNumberOfComments()
|
||||||
{
|
{
|
||||||
@@ -222,22 +213,6 @@ function getNumberOfComments()
|
|||||||
return $oRow->num_comments;
|
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 */
|
/* Get the number of queued bug links in the database */
|
||||||
function getNumberOfQueuedBugLinks()
|
function getNumberOfQueuedBugLinks()
|
||||||
{
|
{
|
||||||
|
|||||||
11
index.php
11
index.php
@@ -57,7 +57,7 @@ If you have screenshots or links to contribute, please browse the database and u
|
|||||||
</p>
|
</p>
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
$numApps = getNumberOfVersions();
|
$iNumApps = version::objectGetEntriesCount(false, false);
|
||||||
|
|
||||||
$voteQuery = "SELECT appVotes.versionId, count(userId) as count ".
|
$voteQuery = "SELECT appVotes.versionId, count(userId) as count ".
|
||||||
"FROM appVotes ".
|
"FROM appVotes ".
|
||||||
@@ -65,17 +65,18 @@ If you have screenshots or links to contribute, please browse the database and u
|
|||||||
$hResult = query_parameters($voteQuery);
|
$hResult = query_parameters($voteQuery);
|
||||||
$oRow = mysql_fetch_object($hResult);
|
$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
|
// don't mention the top application if there are no votes yet
|
||||||
if($oRow->versionId)
|
if($oRow->versionId)
|
||||||
{
|
{
|
||||||
$shVoteAppLink = version::fullNameLink($oRow->versionId);
|
$shVoteAppLink = version::fullNameLink($oRow->versionId);
|
||||||
echo "There are <b>$numApps</b> applications currently in the database with\n";
|
echo " with $shVoteAppLink being the\n";
|
||||||
echo "$shVoteAppLink being the\n";
|
|
||||||
echo "top <a href='votestats.php'>voted</a> application.\n";
|
echo "top <a href='votestats.php'>voted</a> application.\n";
|
||||||
} else
|
} else
|
||||||
{
|
{
|
||||||
echo "There are <b>$numApps</b> applications currently in the database, please\n";
|
echo " please <a href=\"".BASE."help/?sTopic=voting\" title=\"help on voting\"".
|
||||||
echo "<a href=\"".BASE."help/?sTopic=voting\" title=\"help on voting\" style=\"cursor: help\">vote</a> for your favourite application.\n";
|
"style=\"cursor: help\">vote</a> for your favourite application.\n";
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user