appdb/include url.php version.php

WineHQ wineowner at wine.codeweavers.com
Wed Jan 17 20:28:21 CST 2007


ChangeSet ID:	30885
CVSROOT:	/opt/cvs-commit
Module name:	appdb
Changes by:	wineowner at winehq.org	2007/01/17 20:28:21

Modified files:
	include        : url.php version.php 

Log message:
	Alexander Nicolaysen Sørnes <alex at thehandofagony.com>
	Add url::display and replace old link display code.

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

Old revision  New revision  Changes     Path
 1.11          1.12          +25 -1      appdb/include/url.php
 1.94          1.95          +5 -13      appdb/include/version.php

Index: appdb/include/url.php
diff -u -p appdb/include/url.php:1.11 appdb/include/url.php:1.12
--- appdb/include/url.php:1.11	18 Jan 2007  2:28:21 -0000
+++ appdb/include/url.php	18 Jan 2007  2:28:21 -0000
@@ -234,6 +234,30 @@ class Url {
         $sEmail = User::get_notify_email_address_list(null, $this->iVersionId);
         if($sEmail)
             mail_appdb($sEmail, $sSubject ,$sMsg);
-    } 
+    }
+
+    /* Display links for a given version/application */
+    function display($iVersionId, $iAppId = NULL)
+    {
+        if($iVersionId)
+        {
+            if(!($hResult = appData::getData($iVersionId, "url")))
+                return FALSE;
+        } else
+        {
+            if(!($hResult = appData::getData($iAppId, "url", FALSE)))
+                return FALSE;
+        }
+
+        for($i = 0; $oRow = mysql_fetch_object($hResult); $i++)
+        {
+            $sReturn .= html_tr(array(
+                "<b>Link</b>",
+                "<a href=\"$oRow->url\">$oRow->description</a>"),
+                "color1");
+        }
+
+        return $sReturn;
+    }
 }
 ?>
Index: appdb/include/version.php
diff -u -p appdb/include/version.php:1.94 appdb/include/version.php:1.95
--- appdb/include/version.php:1.94	18 Jan 2007  2:28:21 -0000
+++ appdb/include/version.php	18 Jan 2007  2:28:21 -0000
@@ -646,28 +646,20 @@ class Version {
         // main URL
         echo "        <tr class=\"color1\"><td><b>URL</b></td><td>".$appLinkURL."</td></tr>\n";
 
-        // links
-        $result = query_parameters("SELECT * FROM appData WHERE versionID = '?' AND type = 'url'",
-                                   $this->iVersionId);
-        if($result && mysql_num_rows($result) > 0)
-        {
-            echo "        <tr class=\"color1\"><td><b>Links</b></td><td>\n";
-            while($oRow = mysql_fetch_object($result))
-            {
-                echo "        <a href=\"$oRow->url\">".substr(stripslashes($oRow->description),0,30)."</a> <br />\n";
-            }
-            echo "        </td></tr>\n";
-        }    
-
         if($this->sTestedRating != "/" && $this->sTestedRating)
             $sMaintainerColor = $this->sTestedRating;
         else
             $sMaintainerColor = "color0";
 
+        // URLs
+        if($sUrls = url::display($this->iVersionId))
+            echo $sUrls;
+
         // rating Area
         echo "<tr class=\"$sMaintainerColor\" valign=\"top\"><td><b>Maintainer&#8217;s Rating</b></td><td>".$this->sTestedRating."</td></tr>\n";
         echo "<tr class=\"$sMaintainerColor\" valign=\"top\"><td><b>Maintainer&#8217;s Version</b></td><td>".$this->sTestedRelease."</td></tr>\n";
 
+        // Download URLs
         if($sDownloadurls = downloadurl::display($this->iVersionId))
             echo $sDownloadurls;
 



More information about the wine-cvs mailing list