Every screenshot of an app were shown when asking for a version-specific screenshot

This commit is contained in:
Jonathan Ernst
2005-02-20 01:58:28 +00:00
committed by WineHQ
parent 3cf9a144ee
commit 08141e875f

View File

@@ -280,7 +280,7 @@ class Screenshot {
function get_screenshot_img($iAppId = null, $iVersionId = null) function get_screenshot_img($iAppId = null, $iVersionId = null)
{ {
// we want a random screenshots for this app // we want a random screenshots for this app
if($iAppId) if($iAppId && !$iVersionId)
{ {
$hResult = query_appdb("SELECT appData.*, RAND() AS rand $hResult = query_appdb("SELECT appData.*, RAND() AS rand
FROM appData, appVersion FROM appData, appVersion
@@ -322,7 +322,7 @@ function get_screenshots($iAppId = null, $iVersionId = null, $bQueued = "false")
/* /*
* We want all screenshots for this app. * We want all screenshots for this app.
*/ */
if($iAppId) if($iAppId && !$iVersionId)
{ {
$sQuery = "SELECT appData.*, appVersion.appId as appId $sQuery = "SELECT appData.*, appVersion.appId as appId
FROM appData, appVersion FROM appData, appVersion