diff options
author | cweiske <cweiske@b3834d28-1941-0410-a4f8-b48e95affb8f> | 2009-10-27 20:26:24 +0000 |
---|---|---|
committer | cweiske <cweiske@b3834d28-1941-0410-a4f8-b48e95affb8f> | 2009-10-27 20:26:24 +0000 |
commit | 10f59ea7718e30804ceaffec807b184d838d5ed0 (patch) | |
tree | 05a222ca3151f8fdb149a59d93ed4b4a75a0569e | |
parent | 1ea488babea9bfd8b9b25e8ee025495c2befe655 (diff) | |
download | semanticscuttle-10f59ea7718e30804ceaffec807b184d838d5ed0.tar.gz semanticscuttle-10f59ea7718e30804ceaffec807b184d838d5ed0.tar.bz2 |
fix user-specific tags
git-svn-id: https://semanticscuttle.svn.sourceforge.net/svnroot/semanticscuttle/trunk@435 b3834d28-1941-0410-a4f8-b48e95affb8f
-rw-r--r-- | src/SemanticScuttle/Service/Bookmark.php | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/src/SemanticScuttle/Service/Bookmark.php b/src/SemanticScuttle/Service/Bookmark.php index 34a819c..3a7edd9 100644 --- a/src/SemanticScuttle/Service/Bookmark.php +++ b/src/SemanticScuttle/Service/Bookmark.php @@ -527,6 +527,18 @@ class SemanticScuttle_Service_Bookmark extends SemanticScuttle_DbService $query_5.= ' GROUP BY B.bHash'; } + + //Voting system + //needs to be directly after FROM bookmarks + if ($GLOBALS['enableVoting'] && $userservice->isLoggedOn()) { + $currentuser = $userservice->getCurrentUser(); + $vs = SemanticScuttle_Service_Factory::get('Vote'); + $query_1 .= ', !ISNULL(V.bId) as hasVoted, V.vote as vote'; + $query_2 .= ' LEFT JOIN ' . $vs->getTableName() . ' AS V' + . ' ON B.bId = V.bId' + . ' AND V.uId = ' . (int)$currentuser['uId']; + } + switch($sortOrder) { case 'date_asc': $query_5.= ' ORDER BY B.bModified ASC '; @@ -606,16 +618,6 @@ class SemanticScuttle_Service_Bookmark extends SemanticScuttle_DbService $query_4 .= ' AND B.bHash = "'. $hash .'"'; } - //Voting system - if ($GLOBALS['enableVoting'] && $userservice->isLoggedOn()) { - $currentuser = $userservice->getCurrentUser(); - $vs = SemanticScuttle_Service_Factory::get('Vote'); - $query_1 .= ', !ISNULL(V.bId) as hasVoted, V.vote as vote'; - $query_2 .= ' LEFT JOIN ' . $vs->getTableName() . ' AS V' - . ' ON B.bId = V.bId' - . ' AND V.uId = ' . (int)$currentuser['uId']; - } - $query = $query_1 . $query_2 . $query_3 . $query_4 . $query_5; |