2009-10-26 22:55:43 +01:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* Bookmark voting badge.
|
|
|
|
* Shows the number of votes and buttons to vote for or
|
|
|
|
* against a bookmark.
|
|
|
|
* Expects a $row variable with bookmark data
|
|
|
|
*/
|
|
|
|
if (!$GLOBALS['enableVoting']) {
|
|
|
|
return;
|
|
|
|
}
|
2009-10-27 21:36:43 +01:00
|
|
|
if (isset($row['hasVoted']) && !$row['hasVoted']) {
|
2009-10-27 21:30:33 +01:00
|
|
|
$classes = 'vote-badge vote-badge-inactive';
|
|
|
|
} else {
|
|
|
|
$classes = 'vote-badge';
|
|
|
|
}
|
|
|
|
echo '<span class="' . $classes . '">';
|
2009-10-27 21:36:43 +01:00
|
|
|
|
|
|
|
if (isset($row['hasVoted']) && !$row['hasVoted']) {
|
2009-10-27 21:40:12 +01:00
|
|
|
echo '<a class="vote-for" rel="nofollow" href="'
|
2009-10-26 22:55:43 +01:00
|
|
|
. createVoteURL(true, $row['bId']) . '">+</a>';
|
|
|
|
} else {
|
2009-10-27 21:30:33 +01:00
|
|
|
echo '<span class="vote-for-inactive">+</span>';
|
2009-10-26 22:55:43 +01:00
|
|
|
}
|
2009-10-27 21:36:43 +01:00
|
|
|
|
2009-10-26 22:55:43 +01:00
|
|
|
echo '<span class="voting">' . $row['bVoting'] . '</span>';
|
2009-10-27 21:36:43 +01:00
|
|
|
|
|
|
|
if (isset($row['hasVoted']) && !$row['hasVoted']) {
|
2009-10-27 21:40:12 +01:00
|
|
|
echo '<a class="vote-against" rel="nofollow" href="'
|
2009-10-26 22:55:43 +01:00
|
|
|
. createVoteURL(false, $row['bId']) . '">-</a>';
|
|
|
|
} else {
|
2009-10-27 21:30:33 +01:00
|
|
|
echo '<span class="vote-against-inactive">-</span>';
|
2009-10-26 22:55:43 +01:00
|
|
|
}
|
|
|
|
echo '</span>';
|
|
|
|
?>
|