600000) { addmsg("Your screenshot was not accepted because it is too big. Please try to keep your screenshots under 600KB by saving games/video screenshots to jpeg and normal applications to png you might be able to achieve very good results with less bytes", "red"); } else { $oScreenshot = new Screenshot(); $oScreenshot->iVersionId = $aClean['iVersionId']; $oScreenshot->sScreenshotDesc = $aClean['sScreenshotDesc']; $oScreenshot->hFile = $_FILES['sImageFile']; $oScreenshot->create(); $oScreenshot->free(); } } elseif($aClean['sCmd'] == "delete" && is_numeric($aClean['iImageId'])) // process screenshot deletion { $oScreenshot = new Screenshot($aClean['iImageId']); $oScreenshot->delete(); $oScreenshot->free(); } util_redirect_and_exit(apidb_fullurl("screenshots.php?iAppId=".$aClean['iAppId']."&iVersionId=".$aClean['iVersionId'])); } // we didn't issued any command $hResult = Screenshot::get_screenshots($aClean['iAppId'], $aClean['iVersionId']); apidb_header("Screenshots"); $oApp = new Application($aClean['iAppId']); $oVersion = new Version($aClean['iVersionId']); if($hResult && mysql_num_rows($hResult)) { echo html_frame_start("Screenshot Gallery for ".$oApp->sName." ".$oVersion->sName,500); // display thumbnails $c = 1; echo "
\n"; while($oRow = mysql_fetch_object($hResult)) { if(!$aClean['iVersionId'] && $oRow->versionId != $currentVersionId) { if($currentVersionId) { echo "
\n"; echo html_frame_end(); $c=1; } $currentVersionId=$oRow->versionId; echo html_frame_start("Version ".Version::lookup_name($currentVersionId)); echo "
\n"; } $oScreenshot = new Screenshot($oRow->id); $img = $oScreenshot->get_thumbnail_img(); // display image echo "\n"; // end row if counter of 3 if ($c % 3 == 0) echo "\n"; $c++; } echo "
\n"; echo $img; echo "
". substr($oRow->description,0,20). "\n"; //show admin delete link if($_SESSION['current']->isLoggedIn() && ($_SESSION['current']->hasPriv("admin") || $_SESSION['current']->isMaintainer($aClean['iVersionId']))) { echo "
[Delete Image]"; } echo "

\n"; echo html_frame_end("Click thumbnail to view image in new window."); } else { echo "

There are currently no screenshots for the selected version of this application."; echo "
Please consider submitting a screenshot for the selected version yourself.

"; } // let's show the screenshot uploading box if($aClean['iVersionId']) { echo '
',"\n"; echo html_frame_start("Upload Screenshot","400","",0); echo '',"\n"; echo '',"\n"; echo '',"\n"; echo '',"\n"; echo '
Image
Description
',"\n"; echo html_frame_end(); echo '',"\n"; echo '',"\n"; echo '
',"\n"; } echo html_back_link(1); apidb_footer(); ?>