sql optimization: reduce by 9 sql queries when logged in and looking at bookmarks
git-svn-id: https://semanticscuttle.svn.sourceforge.net/svnroot/semanticscuttle/trunk@681 b3834d28-1941-0410-a4f8-b48e95affb8f
This commit is contained in:
parent
17374001b8
commit
53f0a57de0
1 changed files with 6 additions and 1 deletions
|
@ -222,6 +222,11 @@ if($currenttag!= '') {
|
||||||
$addresses[$row['bId']] = $row['bAddress'];
|
$addresses[$row['bId']] = $row['bAddress'];
|
||||||
}
|
}
|
||||||
$otherCounts = $bookmarkservice->countOthers($addresses);
|
$otherCounts = $bookmarkservice->countOthers($addresses);
|
||||||
|
if ($userservice->isLoggedOn()) {
|
||||||
|
$existence = $bookmarkservice->bookmarksExist(
|
||||||
|
$addresses, $currentUser->getId()
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
foreach ($bookmarks as $key => &$row) {
|
foreach ($bookmarks as $key => &$row) {
|
||||||
switch ($row['bStatus']) {
|
switch ($row['bStatus']) {
|
||||||
|
@ -284,7 +289,7 @@ if($currenttag!= '') {
|
||||||
// Copy link
|
// Copy link
|
||||||
if ($userservice->isLoggedOn()
|
if ($userservice->isLoggedOn()
|
||||||
&& ($currentUser->getId() != $row['uId'])
|
&& ($currentUser->getId() != $row['uId'])
|
||||||
&& !$bookmarkservice->bookmarkExists($row['bAddress'], $currentUser->getId())
|
&& !$existence[$row['bAddress']]
|
||||||
) {
|
) {
|
||||||
$copy .= ' - <a href="'
|
$copy .= ' - <a href="'
|
||||||
. createURL('bookmarks', $currentUser->getUsername() .'?action=add&copyOf='. $row['bId'])
|
. createURL('bookmarks', $currentUser->getUsername() .'?action=add&copyOf='. $row['bId'])
|
||||||
|
|
Loading…
Reference in a new issue