ChangeSet ID: 26695 CVSROOT: /opt/cvs-commit Module name: appdb Changes by: wineowner@winehq.org 2006/07/20 23:18:28
Modified files: . : apidb.css screenshots.php include : application.php screenshot.php version.php Added files: images : xmag_32.png
Log message: Chris Morgan cmorgan@alum.wpi.edu 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
Patch: http://cvs.winehq.org/patch.py?id=26695
Old revision New revision Changes Path 1.15 1.16 +3 -0 appdb/apidb.css 1.40 1.41 +1 -0 appdb/screenshots.php Added 1.1 +0 -0 appdb/images/xmag_32.png 1.68 1.69 +1 -1 appdb/include/application.php 1.48 1.49 +23 -5 appdb/include/screenshot.php 1.78 1.79 +1 -1 appdb/include/version.php
Index: appdb/apidb.css diff -u -p appdb/apidb.css:1.15 appdb/apidb.css:1.16 --- appdb/apidb.css:1.15 21 Jul 2006 4:18:28 -0000 +++ appdb/apidb.css 21 Jul 2006 4:18:28 -0000 @@ -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; } Index: appdb/screenshots.php diff -u -p appdb/screenshots.php:1.40 appdb/screenshots.php:1.41 --- appdb/screenshots.php:1.40 21 Jul 2006 4:18:28 -0000 +++ appdb/screenshots.php 21 Jul 2006 4:18:28 -0000 @@ -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"); Index: appdb/include/application.php diff -u -p appdb/include/application.php:1.68 appdb/include/application.php:1.69 --- appdb/include/application.php:1.68 21 Jul 2006 4:18:28 -0000 +++ appdb/include/application.php 21 Jul 2006 4:18:28 -0000 @@ -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 "<tr><td align="center" colspan="2">$img</td></tr>\n";
echo " </table>\n"; /* close of name/vendor/bugs/url table */ Index: appdb/include/screenshot.php diff -u -p appdb/include/screenshot.php:1.48 appdb/include/screenshot.php:1.49 --- appdb/include/screenshot.php:1.48 21 Jul 2006 4:18:28 -0000 +++ appdb/include/screenshot.php 21 Jul 2006 4:18:28 -0000 @@ -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 = '<img class="zoom_overlay" src="'.BASE.'images/xmag_32.png">'; + } + 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 .= "<a href='screenshots.php?iAppId=$iAppId&iVersionId=$iVersionId'>$sImgFile<center>View/Submit Screenshot</center></a>"; + $sImg .= "<a href='screenshots.php?iAppId=$iAppId&iVersionId=$iVersionId'>".$sImgFile.$sZoomIcon."<center>View/Submit Screenshot</center></a>"; else - $sImg .= "<a href='screenshots.php?iAppId=$iAppId&iVersionId=$iVersionId'>$sImgFile<center>View Screenshot</center></a>"; + $sImg .= "<a href='screenshots.php?iAppId=$iAppId&iVersionId=$iVersionId'>".$sImgFile.$sZoomIcon."<center>View Screenshot</center></a>"; } else if($iVersionId) /* we are asking for a specific app version but it has no screenshots */ { - $sImg .= "<a href='screenshots.php?iAppId=$iAppId&iVersionId=$iVersionId'>$sImgFile<center>Submit Screenshot</center></a>"; + $sImg .= "<a href='screenshots.php?iAppId=$iAppId&iVersionId=$iVersionId'>".$sImgFile.$sZoomIcon."<center>Submit Screenshot</center></a>"; } 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.'</a>'; + ');return false;">'.$shImgSRC.Screenshot::get_zoomicon_overlay().'</a>';
// set image link based on user pref if ($_SESSION['current']->isLoggedIn()) Index: appdb/include/version.php diff -u -p appdb/include/version.php:1.78 appdb/include/version.php:1.79 --- appdb/include/version.php:1.78 21 Jul 2006 4:18:28 -0000 +++ appdb/include/version.php 21 Jul 2006 4:18:28 -0000 @@ -658,7 +658,7 @@ class Version { echo "<tr class="color0" valign="top"><td><b>Maintainers Version</b></td><td>".$this->sTestedRelease."</td></tr>\n";
// image - $img = Screenshot::get_random_screenshot_img($oApp->iAppId, $this->iVersionId); + $img = Screenshot::get_random_screenshot_img($oApp->iAppId, $this->iVersionId, false); echo "<tr><td align="center" colspan="2">$img</td></tr>\n";
// display all maintainers of this application