diff --git a/include/url.php b/include/url.php index a4682d9..9474693 100644 --- a/include/url.php +++ b/include/url.php @@ -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( + "Link", + "url\">$oRow->description"), + "color1"); + } + + return $sReturn; + } } ?> diff --git a/include/version.php b/include/version.php index 78e124e..b31e4c1 100644 --- a/include/version.php +++ b/include/version.php @@ -646,28 +646,20 @@ class Version { // main URL echo " URL".$appLinkURL."\n"; - // links - $result = query_parameters("SELECT * FROM appData WHERE versionID = '?' AND type = 'url'", - $this->iVersionId); - if($result && mysql_num_rows($result) > 0) - { - echo " Links\n"; - while($oRow = mysql_fetch_object($result)) - { - echo " url\">".substr(stripslashes($oRow->description),0,30)."
\n"; - } - echo " \n"; - } - if($this->sTestedRating != "/" && $this->sTestedRating) $sMaintainerColor = $this->sTestedRating; else $sMaintainerColor = "color0"; + // URLs + if($sUrls = url::display($this->iVersionId)) + echo $sUrls; + // rating Area echo "Maintainer’s Rating".$this->sTestedRating."\n"; echo "Maintainer’s Version".$this->sTestedRelease."\n"; + // Download URLs if($sDownloadurls = downloadurl::display($this->iVersionId)) echo $sDownloadurls;