From b18869f6d769c18d19fd937683352e0ea7a54939 Mon Sep 17 00:00:00 2001 From: cweiske Date: Fri, 19 Mar 2010 07:43:42 +0000 Subject: [PATCH] remove another 9 queries for logged in users! git-svn-id: https://semanticscuttle.svn.sourceforge.net/svnroot/semanticscuttle/trunk@696 b3834d28-1941-0410-a4f8-b48e95affb8f --- data/templates/bookmarks.tpl.php | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/data/templates/bookmarks.tpl.php b/data/templates/bookmarks.tpl.php index 1caf0e7..a8299fd 100644 --- a/data/templates/bookmarks.tpl.php +++ b/data/templates/bookmarks.tpl.php @@ -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 = '';