diff options
author | cweiske <cweiske@b3834d28-1941-0410-a4f8-b48e95affb8f> | 2010-03-19 07:43:42 +0000 |
---|---|---|
committer | cweiske <cweiske@b3834d28-1941-0410-a4f8-b48e95affb8f> | 2010-03-19 07:43:42 +0000 |
commit | b18869f6d769c18d19fd937683352e0ea7a54939 (patch) | |
tree | cc675db22adbaed9cf2d346f57a29c0310f63761 | |
parent | 0f3c51ef7ebb18919a65ccdc25782f9550a1c680 (diff) | |
download | semanticscuttle-b18869f6d769c18d19fd937683352e0ea7a54939.tar.gz semanticscuttle-b18869f6d769c18d19fd937683352e0ea7a54939.tar.bz2 |
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
-rw-r--r-- | data/templates/bookmarks.tpl.php | 14 |
1 files changed, 13 insertions, 1 deletions
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 = ''; |