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->sDescription = $aClean['sScreenshotDesc']; $oScreenshot->sTestedVersion = $aClean['sTestedVersion']; $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 && query_num_rows($hResult)) { echo ' '; // Add some space between title bars echo html_frame_start("Screenshot Gallery for ".$oApp->sName, 500); // display thumbnails $c = 1; // optimization so we don't have to perform as many database queries // only update this variable when $iCurrentVersionId changes $bUserIsMaintainerOfVersion = false; echo "
\n"; echo ' '; // Add some space between title bars while($oRow = query_fetch_object($hResult)) { // if the current version changed then update the current version // and close the previous html frame if this isn't the // first frame if($oRow->versionId != $iCurrentVersionId) { if($iCurrentVersionId) { echo "
\n"; echo html_frame_end(); $c=1; } $iCurrentVersionId = $oRow->versionId; $bUserIsMaintainerOfVersion = $_SESSION['current']->isMaintainer($iCurrentVersionId); echo html_frame_start("Version ".Version::lookup_name($iCurrentVersionId)); 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"; echo '
DXGL version: '; echo $oScreenshot->sTestedVersion ? $oScreenshot->sTestedVersion : 'N/A'; //show admin delete link if($_SESSION['current']->isLoggedIn() && ( $_SESSION['current']->hasPriv("admin") || $bUserIsMaintainerOfVersion ) ) { $oM = new objectManager("screenshot"); $oM->setReturnTo("screenshots.php?iAppId=".$oScreenshot->iAppId."&iVersionId=".$oScreenshot->iVersionId); echo '
[iScreenshotId, "Delete Screenshot").'">Delete]'; } echo "

\n"; echo html_frame_end(); // close the current version we are displaying echo html_frame_end(); // close the "Screenshot Gallary..." html frame } 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, but only // if the user is logged in if($aClean['iVersionId'] && $_SESSION['current']->isLoggedIn()) { echo "

"; echo ""; echo "
Please follow these simple rules
    "; echo "
  • Do not upload screenshots of error messages, installers, game menus etc.
  • "; echo "
  • Crop the image so that only the application is shown and not your desktop.
  • "; echo "
  • To crop the screenshot, press ALT+PrtScr to copy the application window to the clipboard.
  • "; echo "

"; echo '
',"\n"; echo html_frame_start("Upload Screenshot","400","",0); echo '',"\n"; echo '',"\n"; echo '',"\n"; echo '',"\n"; echo '',"\n"; echo '
Image
Description
DXGL version'.make_bugzilla_version_list('sTestedVersion').'
',"\n"; echo html_frame_end(); echo '',"\n"; echo '',"\n"; echo '
',"\n"; } else if(!$_SESSION['current']->isLoggedIn()) // else let the person know that if they log in they can submit screenshots { echo '
'; echo "Log in to submit screenshots
\n"; } else { echo html_frame_start("Upload Screenshot", "30%"); echo 'If you would like to submit screenshots, please select an application version below.
'; echo ''; echo html_frame_end(); } echo html_back_link(1); apidb_footer(); ?>