diff --git a/apidb.css b/apidb.css index ce15fcd..71cec83 100644 --- a/apidb.css +++ b/apidb.css @@ -232,3 +232,6 @@ TD.app_name { width: 150px } /* Editor textarea */ #editor { height: 25em; width:700px; } + +/* zoom image overlay style */ +.zoom_overlay { position:relative; top:10px; left:0px; margin-left:-32px; padding:0px; } diff --git a/images/xmag_32.png b/images/xmag_32.png new file mode 100644 index 0000000..af1e065 Binary files /dev/null and b/images/xmag_32.png differ diff --git a/include/application.php b/include/application.php index 47b4067..1340bd3 100644 --- a/include/application.php +++ b/include/application.php @@ -546,7 +546,7 @@ class Application { } // image - $img = Screenshot::get_random_screenshot_img($this->iAppId); + $img = Screenshot::get_random_screenshot_img($this->iAppId, null, false); echo "$img\n"; echo " \n"; /* close of name/vendor/bugs/url table */ diff --git a/include/screenshot.php b/include/screenshot.php index 6540377..ee8ef84 100644 --- a/include/screenshot.php +++ b/include/screenshot.php @@ -360,6 +360,21 @@ class Screenshot { mail_appdb($sEmail, $sSubject ,$sMsg); } + function get_zoomicon_overlay() + { + /* if the user is using mozilla or firefox show the zoom icon over images */ + /* otherwise because IE doesn't support transparent PNGs or proper css we have to */ + /* skip it for IE */ + if(strpos($_SERVER['HTTP_USER_AGENT'], "MSIE") === false) + { + $sZoomIcon = ''; + } + else + $sZoomIcon = ""; + + return $sZoomIcon; + } + /** * Get a random image for a particular version of an app. * If the version is not set, get a random app image @@ -407,19 +422,22 @@ class Screenshot { if($bFormatting) $sImg = html_frame_start("",'128','',2); + /* retrieve the url for the zoom icon overlay */ + $sZoomIcon = Screenshot::get_zoomicon_overlay(); + /* we have screenshots */ if(mysql_num_rows($hResult)) { if($iVersionId) - $sImg .= "$sImgFile
View/Submit Screenshot
"; + $sImg .= "".$sImgFile.$sZoomIcon."
View/Submit Screenshot
"; else - $sImg .= "$sImgFile
View Screenshot
"; + $sImg .= "".$sImgFile.$sZoomIcon."
View Screenshot
"; } else if($iVersionId) /* we are asking for a specific app version but it has no screenshots */ { - $sImg .= "$sImgFile
Submit Screenshot
"; + $sImg .= "".$sImgFile.$sZoomIcon."
Submit Screenshot
"; } else /* we have no screenshots and we aren't a specific version, we don't allow adding screenshots for an app */ { - $sImg .= $sImgFile; + $sImg .= $sImgFile.$sZoomIcon; } if($bFormatting) @@ -476,7 +494,7 @@ class Screenshot { '?iId='.$this->iScreenshotId.'\',\''.$sRandName.'\','. ($this->get_screenshot_width() + 20).','. ($this->get_screenshot_height() + 6). - ');return false;">'.$shImgSRC.''; + ');return false;">'.$shImgSRC.Screenshot::get_zoomicon_overlay().''; // set image link based on user pref if ($_SESSION['current']->isLoggedIn()) diff --git a/include/version.php b/include/version.php index 79d1e2c..694a73f 100644 --- a/include/version.php +++ b/include/version.php @@ -658,7 +658,7 @@ class Version { echo "Maintainers Version".$this->sTestedRelease."\n"; // image - $img = Screenshot::get_random_screenshot_img($oApp->iAppId, $this->iVersionId); + $img = Screenshot::get_random_screenshot_img($oApp->iAppId, $this->iVersionId, false); echo "$img\n"; // display all maintainers of this application diff --git a/screenshots.php b/screenshots.php index f7c9ab9..2d9d63b 100644 --- a/screenshots.php +++ b/screenshots.php @@ -32,6 +32,7 @@ if($aClean['sCmd']) // process screenshot upload if($aClean['sCmd'] == "screenshot_upload") { + //FIXME: use a defined value here instead of just 600000 if($_FILES['sImageFile']['size']>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");