summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcweiske <cweiske@b3834d28-1941-0410-a4f8-b48e95affb8f>2009-11-02 09:42:53 +0000
committercweiske <cweiske@b3834d28-1941-0410-a4f8-b48e95affb8f>2009-11-02 09:42:53 +0000
commit79b28ed45cd0f5e2fcc043bf716d011c6571642e (patch)
treebf999f1b386efc78961802d840e96bb9a7b666f1
parented1636cb5164aa6b14c3dd5f95ad3fea79939a4a (diff)
downloadsemanticscuttle-79b28ed45cd0f5e2fcc043bf716d011c6571642e.tar.gz
semanticscuttle-79b28ed45cd0f5e2fcc043bf716d011c6571642e.tar.bz2
hide bookmarks below a configurable threshold
git-svn-id: https://semanticscuttle.svn.sourceforge.net/svnroot/semanticscuttle/trunk@507 b3834d28-1941-0410-a4f8-b48e95affb8f
-rw-r--r--data/config.default.php8
-rw-r--r--doc/ChangeLog1
-rw-r--r--doc/developers/TODO1
-rw-r--r--src/SemanticScuttle/Service/Bookmark.php10
4 files changed, 18 insertions, 2 deletions
diff --git a/data/config.default.php b/data/config.default.php
index 76c8856..6eda4e7 100644
--- a/data/config.default.php
+++ b/data/config.default.php
@@ -431,6 +431,14 @@ $enableVoting = true;
*/
$votingMode = 2;
+/**
+ * Hide bookmarks below a certain voting from all users.
+ * Null to deactivate it.
+ *
+ * @var integer
+ */
+$hideBelowVoting = null;
+
/****************************
* Website Thumbnails
diff --git a/doc/ChangeLog b/doc/ChangeLog
index 459ee8d..6d27572 100644
--- a/doc/ChangeLog
+++ b/doc/ChangeLog
@@ -8,6 +8,7 @@ ChangeLog for SemantiScuttle
- Configuration option to disable registration
- Implement request #2874049: "Feeling lucky" button
just add "?lucky=1" as parameter to search page
+- Hide bookmarks with vote < $threshold from users (not admins)
0.94 - 2009-10-02
diff --git a/doc/developers/TODO b/doc/developers/TODO
index 72ab582..b56cfaa 100644
--- a/doc/developers/TODO
+++ b/doc/developers/TODO
@@ -6,7 +6,6 @@
logged in anymore (name not shown on top right)
- Make users inactive by default when registered newly
- have to be activated by admins
-- Hide bookmarks with vote < 0 (or threshold) from unregistered users
- Add RDFa to user profile page
- use recaptcha or alike
diff --git a/src/SemanticScuttle/Service/Bookmark.php b/src/SemanticScuttle/Service/Bookmark.php
index 949b073..afc4c89 100644
--- a/src/SemanticScuttle/Service/Bookmark.php
+++ b/src/SemanticScuttle/Service/Bookmark.php
@@ -550,9 +550,17 @@ class SemanticScuttle_Service_Bookmark extends SemanticScuttle_DbService
}
$query_1 .= 'B.*, U.'. $userservice->getFieldName('username');
- $query_2 = ' FROM '. $userservice->getTableName() .' AS U, '. $this->getTableName() .' AS B';
+ $query_2 = ' FROM '. $userservice->getTableName() .' AS U'
+ . ', '. $this->getTableName() .' AS B';
$query_3 = ' WHERE B.uId = U.'. $userservice->getFieldName('primary') . $privacy;
+
+ if ($GLOBALS['enableVoting'] && $GLOBALS['hideBelowVoting'] !== null
+ && !$userservice->isAdmin($userservice->getCurrentUserId())
+ ) {
+ $query_3 .= ' AND B.bVoting >= ' . (int)$GLOBALS['hideBelowVoting'];
+ }
+
if (is_null($watched)) {
if (!is_null($user)) {
$query_3 .= ' AND B.uId = '. $user;