Don't show vote link for obsolete versions

This commit is contained in:
Alexander Nicolaysen Sørnes
2008-01-18 17:24:17 +01:00
committed by Chris Morgan
parent 6808c187eb
commit 0f5bb1b0f9

View File

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