summaryrefslogtreecommitdiffstatshomepage
path: root/data/templates/bookmarks-vote.inc.tpl.php
diff options
context:
space:
mode:
authorGravatar cweiske2009-10-26 21:55:43 +0000
committerGravatar cweiske2009-10-26 21:55:43 +0000
commitaf157c6bb72518f8ee3096f6370c920ef9b965a3 (patch)
tree74c2ef2e92825ac5b8bae214fb93680774733724 /data/templates/bookmarks-vote.inc.tpl.php
parent44fd0e29f4d856058f3bac3a3581d00919420169 (diff)
downloadscuttle-af157c6bb72518f8ee3096f6370c920ef9b965a3.tar.gz
scuttle-af157c6bb72518f8ee3096f6370c920ef9b965a3.zip
basic voting system works; but layout is missing
git-svn-id: https://semanticscuttle.svn.sourceforge.net/svnroot/semanticscuttle/trunk@432 b3834d28-1941-0410-a4f8-b48e95affb8f
Diffstat (limited to 'data/templates/bookmarks-vote.inc.tpl.php')
-rw-r--r--data/templates/bookmarks-vote.inc.tpl.php26
1 files changed, 26 insertions, 0 deletions
diff --git a/data/templates/bookmarks-vote.inc.tpl.php b/data/templates/bookmarks-vote.inc.tpl.php
new file mode 100644
index 0000000..89818f8
--- /dev/null
+++ b/data/templates/bookmarks-vote.inc.tpl.php
@@ -0,0 +1,26 @@
+<?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;
+}
+echo '<span class="vote-badge">';
+if (!$row['hasVoted']) {
+ echo '<a class="vote-for" href="'
+ . createVoteURL(true, $row['bId']) . '">+</a>';
+} else {
+ echo '<span class="vote-against-i">+</span>';
+}
+echo '<span class="voting">' . $row['bVoting'] . '</span>';
+if (!$row['hasVoted']) {
+ echo '<a class="vote-against" href="'
+ . createVoteURL(false, $row['bId']) . '">-</a>';
+} else {
+ echo '<span class="vote-against-i">-</span>';
+}
+echo '</span>';
+?> \ No newline at end of file