]> gitweb.fluxo.info Git - semanticscuttle.git/commitdiff
remove another 9 queries for logged in users!
authorcweiske <cweiske@b3834d28-1941-0410-a4f8-b48e95affb8f>
Fri, 19 Mar 2010 07:43:42 +0000 (07:43 +0000)
committercweiske <cweiske@b3834d28-1941-0410-a4f8-b48e95affb8f>
Fri, 19 Mar 2010 07:43:42 +0000 (07:43 +0000)
git-svn-id: https://semanticscuttle.svn.sourceforge.net/svnroot/semanticscuttle/trunk@696 b3834d28-1941-0410-a4f8-b48e95affb8f

data/templates/bookmarks.tpl.php

index 1caf0e71004f8a7fadf80f3450d423b90b6fb3f7..a8299fd1be30b857c6ad64afe9a1535ab7171e5a 100644 (file)
@@ -228,6 +228,14 @@ if($currenttag!= '') {
         );
     }
 
+    if ($userservice->isLoggedOn()) {
+        $watchedNames = $userservice->getWatchNames(
+            $currentUser->getId(), true
+        );
+    } else {
+        $watchedNames = null;
+    }
+
        foreach ($bookmarks as $key => &$row) {
                switch ($row['bStatus']) {
                        case 0:
@@ -321,7 +329,11 @@ if($currenttag!= '') {
                }
 
                // Private Note (just visible by the owner and his/her contacts)
-               if($userservice->isLoggedOn() && ($currentUser->getId() == $row['uId'] || in_array($row['username'], $userservice->getWatchNames($currentUser->getId(), true)))) {
+        if ($watchedNames !== null
+            && ($currentUser->getId() == $row['uId']
+                || in_array($row['username'], $watchedNames)
+            )
+        ) {
                        $privateNoteField = $row['bPrivateNote'];
                } else {
                        $privateNoteField = '';