2009-10-26 21:55:43 +00: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 20:36:43 +00:00
|
|
|
if (isset($row['hasVoted']) && !$row['hasVoted']) {
|
2009-10-27 20:30:33 +00:00
|
|
|
$classes = 'vote-badge vote-badge-inactive';
|
|
|
|
} else {
|
|
|
|
$classes = 'vote-badge';
|
|
|
|
}
|
|
|
|
echo '<span class="' . $classes . '">';
|
2009-10-27 20:36:43 +00:00
|
|
|
|
|
|
|
if (isset($row['hasVoted']) && !$row['hasVoted']) {
|
2009-10-27 20:40:12 +00:00
|
|
|
echo '<a class="vote-for" rel="nofollow" href="'
|
2009-10-26 21:55:43 +00:00
|
|
|
. createVoteURL(true, $row['bId']) . '">+</a>';
|
|
|
|
} else {
|
2009-10-27 20:30:33 +00:00
|
|
|
echo '<span class="vote-for-inactive">+</span>';
|
2009-10-26 21:55:43 +00:00
|
|
|
}
|
2009-10-27 20:36:43 +00:00
|
|
|
|
2009-10-26 21:55:43 +00:00
|
|
|
echo '<span class="voting">' . $row['bVoting'] . '</span>';
|
2009-10-27 20:36:43 +00:00
|
|
|
|
|
|
|
if (isset($row['hasVoted']) && !$row['hasVoted']) {
|
2009-10-27 20:40:12 +00:00
|
|
|
echo '<a class="vote-against" rel="nofollow" href="'
|
2009-10-26 21:55:43 +00:00
|
|
|
. createVoteURL(false, $row['bId']) . '">-</a>';
|
|
|
|
} else {
|
2009-10-27 20:30:33 +00:00
|
|
|
echo '<span class="vote-against-inactive">-</span>';
|
2009-10-26 21:55:43 +00:00
|
|
|
}
|
|
|
|
echo '</span>';
|
|
|
|
?>
|