diff --git a/include/screenshot.php b/include/screenshot.php index d076919..9322078 100644 --- a/include/screenshot.php +++ b/include/screenshot.php @@ -303,8 +303,10 @@ class Screenshot { /** * Get a random image for a particular version of an app. * If the version is not set, get a random app image + * + * $bFormatting == false turns off all extranious formatting applied to the returned image html */ -function get_screenshot_img($iAppId = null, $iVersionId = null) +function get_screenshot_img($iAppId = null, $iVersionId = null, $bFormatting = true) { // we want a random screenshots for this app if($iAppId && !$iVersionId) @@ -325,16 +327,24 @@ function get_screenshot_img($iAppId = null, $iVersionId = null) AND queued = 'false' ORDER BY rand"); } + + if($bFormatting) + $sImgFile .= '
'; + if(!$hResult || !mysql_num_rows($hResult)) { - $sImgFile = '
No Screenshot
'; + $sImgFile = 'No Screenshot'; } else { $oRow = mysql_fetch_object($hResult); - $sImgFile = '
'.$oRow->description.'
'; + $sImgFile = ''.$oRow->description.''; } + + if($bFormatting) + $sImgFile .= '
'; - $sImg = html_frame_start("",'128','',2); + if($bFormatting) + $sImg = html_frame_start("",'128','',2); /* we have screenshots */ if(mysql_num_rows($hResult)) @@ -350,7 +360,9 @@ function get_screenshot_img($iAppId = null, $iVersionId = null) { $sImg .= $sImgFile; } - $sImg .= html_frame_end()."
"; + + if($bFormatting) + $sImg .= html_frame_end()."
"; return $sImg; } diff --git a/include/util.php b/include/util.php index 5b01733..8c6e5ec 100644 --- a/include/util.php +++ b/include/util.php @@ -266,12 +266,12 @@ function outputTopXRow($oRow) { $oVersion = new Version($oRow->versionId); $oApp = new Application($oVersion->iAppId); - $img = get_screenshot_img(null, $oRow->versionId); // image + $img = get_screenshot_img(null, $oRow->versionId, false); // image, disable extra formatting echo ' '.$oApp->sName.' '.$oVersion->sName.' '.trim_description($oApp->sDescription).' - '.$img.' +
'.$img.'
'; }