Alexander Nicolaysen Sørnes : Don' t show vote link for obsolete versions

Chris Morgan cmorgan at winehq.org
Fri Jan 18 10:16:39 CST 2008


Module: appdb
Branch: master
Commit: 0f5bb1b0f9c2d9b5b9564b55b4fd4c1014b4945c
URL:    http://source.winehq.org/git/appdb.git/?a=commit;h=0f5bb1b0f9c2d9b5b9564b55b4fd4c1014b4945c

Author: Alexander Nicolaysen Sørnes <alex at thehandofagony.com>
Date:   Fri Jan 18 17:24:17 2008 +0100

Don't show vote link for obsolete versions

---

 include/version.php |   27 +++++++++++++++++----------
 1 files changed, 17 insertions(+), 10 deletions(-)

diff --git a/include/version.php b/include/version.php
index 3d0a36e..740291c 100644
--- a/include/version.php
+++ b/include/version.php
@@ -836,17 +836,24 @@ class version {
         // main URL
         echo "        <tr class=\"color1\"><td><b>URL</b></td><td>".$appLinkURL."</td></tr>\n";
 
-        $oM = new objectManager("voteManager", "Vote");
-        $oM->setReturnTo($this->objectMakeUrl());
         // Votes
-        if($_SESSION['current']->isLoggedIn())
-            $shVoteLink = ' &nbsp; <a href="'.$oM->makeUrl("edit", $_SESSION['current']->iUserId).'&iVersionId='.$this->iVersionId.'">Vote</a>';
-        else
-            $shVoteLink = '';
-        echo html_tr(array(
-            "<b>Votes</b>",
-            vote_count_version_total($this->iVersionId).$shVoteLink),
-            "color0");
+        if(!$this->iObsoleteBy)
+        {
+            $oM = new objectManager("voteManager", "Vote");
+            $oM->setReturnTo($this->objectMakeUrl());
+
+            if($_SESSION['current']->isLoggedIn())
+                $shVoteLink = ' &nbsp; <a href="'.$oM->makeUrl("edit", $_SESSION['current']->iUserId).'&iVersionId='.$this->iVersionId.'">Vote</a>';
+            else
+                $shVoteLink = '';
+
+            $shVoteText = vote_count_version_total($this->iVersionId).$shVoteLink;
+        } else
+        {
+            $shVoteText = 'Marked as obsolete';
+        }
+
+        echo html_tr(array('<b>Votes</b>', $shVoteText), 'color0');
 
         $sRating = $this->sTestedRating;
         $sRelease = $this->sTestedRelease;




More information about the wine-cvs mailing list