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:30:33 +01:00
|
|
|
if ($row['hasVoted']) {
|
|
|
|
$classes = 'vote-badge vote-badge-inactive';
|
|
|
|
} else {
|
|
|
|
$classes = 'vote-badge';
|
|
|
|
}
|
|
|
|
echo '<span class="' . $classes . '">';
|
2009-10-26 22:55:43 +01:00
|
|
|
if (!$row['hasVoted']) {
|
|
|
|
echo '<a class="vote-for" href="'
|
|
|
|
. 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
|
|
|
}
|
|
|
|
echo '<span class="voting">' . $row['bVoting'] . '</span>';
|
|
|
|
if (!$row['hasVoted']) {
|
|
|
|
echo '<a class="vote-against" href="'
|
|
|
|
. 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>';
|
|
|
|
?>
|