From 1bdc44a003b41cf1562b10653ef79d28ad16d22f Mon Sep 17 00:00:00 2001 From: Chris Morgan Date: Fri, 21 Jul 2006 04:18:28 +0000 Subject: [PATCH] Add a magnifying glass image overlay on top of screenshot thumbnails to make it more obvious to users that clicking on the image will allow them to see a larger version of the thumbnail --- apidb.css | 3 +++ images/xmag_32.png | Bin 0 -> 1964 bytes include/application.php | 2 +- include/screenshot.php | 28 +++++++++++++++++++++++----- include/version.php | 2 +- screenshots.php | 1 + 6 files changed, 29 insertions(+), 7 deletions(-) create mode 100644 images/xmag_32.png 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 0000000000000000000000000000000000000000..af1e0651ad08e0ba60587edb05ae222990b3dbdb GIT binary patch literal 1964 zcmeAS@N?(olHy`uVBq!ia0y~yU{C;I4mJh`hT^KKFANL}Ea{HEjtmUzPnffIy<}iu zkSuYHC<)F_D=AMbN@Z|N$xljE@XSq2PYp^J9%9J|m+?JUTjOc<%52pY-G7nyX>jwbLg%xeE#ln?wx_HXHv*e3XzP{~$eWTc4reg>4 z75;sk-uUpfJ;z^ZkN>G@KaQ_n_~rBA`fv40N=yoeuf4xj>eX;1fPq6{*`Y(6O!fc% ztWHl)PyM03_{s%EjM!iQpZW0|{|67Nm;GPEwQGMpqwYV(!v{Y6`^fK9?|$gSqxy!vA4)4e zNOMRuSSlwzKQ~#WmC1pDQTD@e`6CI_0{;Jgu79{b!H@Z<{^9NNJUsCYKVIv1oUi}m z%-gx%!8CrstGc41zdJv_`Ry+#Sl3qn{~!B=M+^-NNsMg!4_{wzFX8upl1=94R>$7X znT@k0r~54L=i7V=d%-t^&l{U7@)|Nf`_|NVWw zohHZ&Vs&+L2{A^7bLx&1em(QpKRniV#}wbIktQyz5-k6jb^o7c+rlAnMaO}?=HIyw zLLoW@g$5n}nY#Y6w4LM6==jSrO~}69j(w^i+Y$=~g@y=+)>HXud>h{XXqfr;+~oV^ z_iKMuhx;_l^o^SnIbrhLiH)K&{@<(n^Iu3rY5)I!>`}kwJH|9bib*_@I&+5S(SnTM z{HG)jEcp5Ty}W0qfI>rrUH!jf2M&Im?l|GKy|lgjWqrXqH8#b%G&aUKwFMh{^d%eZ z(iyEBqNWJSsP3;fHmYGhRrB-P|Bp|9|Ccj1HthQR+33~B`k!Y`>6|>n+jEH@?8+JY z>i)7_TX5u?2Umt>vw*xY^9jL4Og=nGPCPt83OYPR3@qNA4o8l(N*v7k_xJz*PtO+L z-_0svXH?I;%p+mZK94SD2Br?y8Cm9k{{Po^eDqs%tA5NY{vVYMeGEwnAB;FY8X0hW zFfb@6X6jB%3pmMoa$fvC#-BM0TuyTMOz`1(nfpXz?;KaXe{g zoo`p`{UEV!$$^u9;=1~y-$)w78gVdf)Hoqn!^30az`lV|_5**EP#sIuxg#tm73~`X z7kzj=Z6kxe_2JXg^W|04eoc4+N*z%0KQv*X%Qy5q4f-MI= zzhC@ex3hPRWrXC7hOK(c{Oruk>KC5xIUu9N5yH+Rz?QdwPcN(>EakzEKVfhG&rJ^N zIj|rhH8quC+KQjxY((j$En7tFiyqUjV?!%MW`3DZ3+u&&TKUHbrD+z@LgD97W4^16T&-``s=1n1o zt2!%Kzx@6#pCGW=prE*zK{q-12dhqd%G`%b^m`(`|$C6C>z^hskYtA?=>tr z5Np}Mkd(4On89k%1GB}w2fW=%1MY5Q3}I{%QgmQ2yriQoz{$YG!?1O^QDD}m@C^(M O3=E#GelF{r5}E))Oq!qo literal 0 HcmV?d00001 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");