Module: appdb
Branch: master
Commit: c5d6cf5c751fa7575c92eebf880c137e5e98bf1c
URL: http://source.winehq.org/git/appdb.git/?a=commit;h=c5d6cf5c751fa7575c92eebf…
Author: Jeremy Newman <jnewman(a)codeweavers.com>
Date: Tue Nov 22 10:21:46 2016 -0600
move home page only funcs to home page
* reducing global code in util.php
* add commas to app count
---
include/util.php | 83 ------------------------------------------------------
index.php | 85 +++++++++++++++++++++++++++++++++++++++++++++++++++++++-
2 files changed, 84 insertions(+), 84 deletions(-)
diff --git a/include/util.php b/include/util.php
index cdc8d96..367179d 100644
--- a/include/util.php
+++ b/include/util.php
@@ -266,89 +266,6 @@ function getNumberOfComments()
return $oRow->num_comments;
}
-/* used by outputTopXRowAppsFromRating() to reduce duplicated code */
-function outputTopXRow($oRow)
-{
- $oVersion = new Version($oRow->versionId);
- $oApp = new Application($oVersion->iAppId);
- $img = Screenshot::get_random_screenshot_img(null, $oRow->versionId, false); // image, disable extra formatting
-
- // create the table row
- $oTableRow = new TableRow();
- $oTableRow->SetClass("white");
-
- // create the cells that represent the row
- $oTableCell = new TableCell(version::fullNameLink($oVersion->iVersionId));
- $oTableCell->SetClass("app_name");
- $oTableRow->AddCell($oTableCell);
- $oTableRow->AddTextCell(util_trim_description($oApp->sDescription));
- $oTableCell = new TableCell($img);
- $oTableCell->SetStyle("text-align:center;");
- $oTableRow->AddCell($oTableCell);
-
- // create a new TableRowclick
- $oTableRowClick = new TableRowClick($oVersion->objectMakeUrl());
-
- // set the click property of the html table row
- $oTableRow->SetRowClick($oTableRowClick);
-
- // output the entire table row
- echo $oTableRow->GetString();
- echo "\n";
-}
-
-/* Output the rows for the Top-X tables on the main page */
-function outputTopXRowAppsFromRating($sRating, $iNumApps)
-{
- /* clean the input values so we can continue to use query_appdb() */
- $sRating = query_escape_string($sRating);
- $iNumApps = query_escape_string($iNumApps);
-
- /* list of versionIds we've already output, so we don't output */
- /* them again when filling in any empty spots in the list */
- $aVersionId = array();
-
- $sQuery = "SELECT appVotes.versionId, COUNT( appVotes.versionId ) AS c
- FROM appVotes, appVersion
- WHERE appVersion.rating = '?'
- AND appVersion.versionId = appVotes.versionId
- AND appVersion.state = 'accepted'
- GROUP BY appVotes.versionId
- ORDER BY c DESC
- LIMIT ?";
- $hResult = query_parameters($sQuery, $sRating, $iNumApps);
- $iNumApps -= query_num_rows($hResult); /* take away the rows we are outputting here */
- while($oRow = query_fetch_object($hResult))
- {
- /* keep track of the apps we've already output */
- $aVersionId[] = $oRow->versionId;
- outputTopXRow($oRow);
- }
-
- /* if we have no more app entries we should stop now and save ourselves a query */
- if(!$iNumApps) return;
-
- /* if we have any empty spots in the list, get these from applications with images */
- $sQuery = "SELECT DISTINCT appVersion.versionId
- FROM appVersion, appData
- WHERE appVersion.rating = '$sRating'
- AND appVersion.versionId = appData.versionId
- AND appVersion.state = 'accepted'
- AND appData.type = 'screenshot'
- AND appData.state = 'accepted'";
-
- /* make sure we exclude any apps we've already output */
- foreach($aVersionId as $key=>$value)
- $sQuery.="AND appVersion.versionId != '".$value."' ";
-
- $sQuery .= " LIMIT $iNumApps";
-
- /* get the list that will fill the empty spots */
- $hResult = query_appdb($sQuery);
- while($oRow = query_fetch_object($hResult))
- outputTopXRow($oRow);
-}
-
/* return true if this word is in the list of words to ignore */
function isIgnoredWord($sWord)
{
diff --git a/index.php b/index.php
index d7fa469..71e32b4 100644
--- a/index.php
+++ b/index.php
@@ -11,6 +11,89 @@
require("path.php");
require(BASE."include/incl.php");
+/* used by outputTopXRowAppsFromRating() to reduce duplicated code */
+function outputTopXRow($oRow)
+{
+ $oVersion = new Version($oRow->versionId);
+ $oApp = new Application($oVersion->iAppId);
+ $img = Screenshot::get_random_screenshot_img(null, $oRow->versionId, false); // image, disable extra formatting
+
+ // create the table row
+ $oTableRow = new TableRow();
+ $oTableRow->SetClass("white");
+
+ // create the cells that represent the row
+ $oTableCell = new TableCell(version::fullNameLink($oVersion->iVersionId));
+ $oTableCell->SetClass("app_name");
+ $oTableRow->AddCell($oTableCell);
+ $oTableRow->AddTextCell(util_trim_description($oApp->sDescription));
+ $oTableCell = new TableCell($img);
+ $oTableCell->SetClass("text-center padding-left-md padding-right-md");
+ $oTableRow->AddCell($oTableCell);
+
+ // create a new TableRowclick
+ $oTableRowClick = new TableRowClick($oVersion->objectMakeUrl());
+
+ // set the click property of the html table row
+ $oTableRow->SetRowClick($oTableRowClick);
+
+ // output the entire table row
+ echo $oTableRow->GetString();
+ echo "\n";
+}
+
+/* Output the rows for the Top-X tables on the main page */
+function outputTopXRowAppsFromRating($sRating, $iNumApps)
+{
+ /* clean the input values so we can continue to use query_appdb() */
+ $sRating = query_escape_string($sRating);
+ $iNumApps = query_escape_string($iNumApps);
+
+ /* list of versionIds we've already output, so we don't output */
+ /* them again when filling in any empty spots in the list */
+ $aVersionId = array();
+
+ $sQuery = "SELECT appVotes.versionId, COUNT( appVotes.versionId ) AS c
+ FROM appVotes, appVersion
+ WHERE appVersion.rating = '?'
+ AND appVersion.versionId = appVotes.versionId
+ AND appVersion.state = 'accepted'
+ GROUP BY appVotes.versionId
+ ORDER BY c DESC
+ LIMIT ?";
+ $hResult = query_parameters($sQuery, $sRating, $iNumApps);
+ $iNumApps -= query_num_rows($hResult); /* take away the rows we are outputting here */
+ while($oRow = query_fetch_object($hResult))
+ {
+ /* keep track of the apps we've already output */
+ $aVersionId[] = $oRow->versionId;
+ outputTopXRow($oRow);
+ }
+
+ /* if we have no more app entries we should stop now and save ourselves a query */
+ if(!$iNumApps) return;
+
+ /* if we have any empty spots in the list, get these from applications with images */
+ $sQuery = "SELECT DISTINCT appVersion.versionId
+ FROM appVersion, appData
+ WHERE appVersion.rating = '$sRating'
+ AND appVersion.versionId = appData.versionId
+ AND appVersion.state = 'accepted'
+ AND appData.type = 'screenshot'
+ AND appData.state = 'accepted'";
+
+ /* make sure we exclude any apps we've already output */
+ foreach($aVersionId as $key=>$value)
+ $sQuery.="AND appVersion.versionId != '".$value."' ";
+
+ $sQuery .= " LIMIT $iNumApps";
+
+ /* get the list that will fill the empty spots */
+ $hResult = query_appdb($sQuery);
+ while($oRow = query_fetch_object($hResult))
+ outputTopXRow($oRow);
+}
+
apidb_header("Wine Application Database");
?>
@@ -63,7 +146,7 @@ else
?>
<?php
- $iNumApps = version::objectGetEntriesCount('accepted');
+ $iNumApps = number_format(version::objectGetEntriesCount('accepted'));
$voteQuery = "SELECT appVotes.versionId, count(userId) as count ".
"FROM appVotes ".
Module: appdb
Branch: master
Commit: 23fae1afb7dd6b34b546934661eed179f304ac93
URL: http://source.winehq.org/git/appdb.git/?a=commit;h=23fae1afb7dd6b34b5469346…
Author: Jeremy Newman <jnewman(a)codeweavers.com>
Date: Tue Nov 22 09:53:16 2016 -0600
move last help links over to the wiki
---
include/maintainer.php | 2 +-
include/testData.php | 2 +-
index.php | 3 +--
3 files changed, 3 insertions(+), 4 deletions(-)
diff --git a/include/maintainer.php b/include/maintainer.php
index fa0aa07..6c0c92f 100644
--- a/include/maintainer.php
+++ b/include/maintainer.php
@@ -755,7 +755,7 @@ class maintainer
echo "An application maintainer is someone who runs the application \n";
echo "regularly and who is willing to be active in reporting regressions with newer \n";
echo "versions of Wine and to help other users run this application under Wine.</p>";
- echo "<p>Being an application maintainer comes with new rights and new responsibilities; please be sure to read the <a href=\"".BASE."/help/?sTopic=maintainer_guidelines\">maintainer's guidelines</a> before to proceed.</p> ";
+ echo "<p>Being an application maintainer comes with new rights and new responsibilities; please be sure to read the <a href=\"https://wiki.winehq.org/AppDB_Maintainer_Guidelines\" target=\"_blank\">maintainer's guidelines</a> before to proceed.</p> ";
echo "<p>We ask that all maintainers explain why they want to be an application maintainer,\n";
echo "why they think they will do a good job and a little about their experience\n";
echo "with Wine. This is both to give you time to\n";
diff --git a/include/testData.php b/include/testData.php
index 352428f..18a04b4 100644
--- a/include/testData.php
+++ b/include/testData.php
@@ -901,7 +901,7 @@ class testData{
// Rating
echo '<tr><td class="color0"><b>Rating</b></td><td class="color0">',"\n";
echo make_maintainer_rating_list("sTestedRating", $this->sTestedRating);
- echo '<a href="'.BASE.'/help/?sTopic=maintainer_ratings" target="_blank">Rating definitions</a></td></tr>',"\n";
+ echo '<a href="https://wiki.winehq.org/AppDB_Maintainer_Rating_Definitions" target="_blank">Rating definitions</a></td></tr>',"\n";
// extra comments
echo '<tr valign=top><td class="color1"><b>Extra comments</b></td>',"\n";
echo '<td class="color0"><textarea name="sComments" id="extra_comments" rows=10 cols=65>';
diff --git a/index.php b/index.php
index 405acac..d7fa469 100644
--- a/index.php
+++ b/index.php
@@ -84,8 +84,7 @@ else
}
else
{
- echo " please <a href=\"".BASE."help/?sTopic=voting\" title=\"help on voting\"".
- "style=\"cursor: help\">vote</a> for your favourite application.\n";
+ echo " please <a href=\"https://wiki.winehq.org/AppDB_Voting_Help\">vote</a> for your favorite application.\n";
}
}