hide bookmarks below a configurable threshold

git-svn-id: https://semanticscuttle.svn.sourceforge.net/svnroot/semanticscuttle/trunk@507 b3834d28-1941-0410-a4f8-b48e95affb8f
This commit is contained in:
cweiske 2009-11-02 09:42:53 +00:00
parent ed1636cb51
commit 79b28ed45c
4 changed files with 18 additions and 2 deletions

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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;