appdb/ ./apidb.css include/application.php inc ...

WineHQ wineowner at vinegar.codeweavers.com
Thu Jul 20 20:41:47 CDT 2006


ChangeSet ID:	26697
CVSROOT:	/opt/cvs-commit
Module name:	appdb
Changes by:	wineowner at winehq.org	2006/07/20 20:41:47

Modified files:
	.              : apidb.css 
	include        : application.php screenshot.php version.php 
Added files:
	images         : xmag_32.png 

Log message:
	Chris Morgan <cmorgan at alum.wpi.edu>
	Add a magnifying glass image overlay on screenshots to make it more apparent that clicking on them
	zooms into the image

Patch: http://cvs.winehq.org/patch.py?id=26697

Old revision  New revision  Changes     Path
 1.15          1.16          +3 -0       appdb/apidb.css
 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  1:41:47 -0000
+++ appdb/apidb.css	21 Jul 2006  1:41:47 -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:10px; margin-left:-32px; padding:0px; }
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  1:41:47 -0000
+++ appdb/include/application.php	21 Jul 2006  1:41:47 -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  1:41:47 -0000
+++ appdb/include/screenshot.php	21 Jul 2006  1:41:47 -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&amp;iVersionId=$iVersionId'>$sImgFile<center>View/Submit&nbsp;Screenshot</center></a>";
+                $sImg .= "<a href='screenshots.php?iAppId=$iAppId&amp;iVersionId=$iVersionId'>".$sImgFile.$sZoomIcon."<center>View/Submit&nbsp;Screenshot</center></a>";
             else
-                $sImg .= "<a href='screenshots.php?iAppId=$iAppId&amp;iVersionId=$iVersionId'>$sImgFile<center>View&nbsp;Screenshot</center></a>";
+                $sImg .= "<a href='screenshots.php?iAppId=$iAppId&amp;iVersionId=$iVersionId'>".$sImgFile.$sZoomIcon."<center>View&nbsp;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&amp;iVersionId=$iVersionId'>$sImgFile<center>Submit&nbsp;Screenshot</center></a>";
+            $sImg .= "<a href='screenshots.php?iAppId=$iAppId&amp;iVersionId=$iVersionId'>".$sImgFile.$sZoomIcon."<center>Submit&nbsp;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  1:41:47 -0000
+++ appdb/include/version.php	21 Jul 2006  1:41:47 -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



More information about the wine-cvs mailing list