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:
parent
0f3c51ef7e
commit
b18869f6d7
1 changed files with 13 additions and 1 deletions
|
@ -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 = '';
|
||||||
|
|
Loading…
Reference in a new issue