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
This commit is contained in:
cweiske 2010-03-19 07:43:42 +00:00
parent 0f3c51ef7e
commit b18869f6d7

View file

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