summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcweiske <cweiske@b3834d28-1941-0410-a4f8-b48e95affb8f>2010-02-20 11:41:01 +0000
committercweiske <cweiske@b3834d28-1941-0410-a4f8-b48e95affb8f>2010-02-20 11:41:01 +0000
commit53f0a57de09b8a2b0155042eaa433afd06ac682e (patch)
tree1f84e5310a60426b453da40d406962d3fa314330
parent17374001b8ccfe806851862c91b29671ba998828 (diff)
downloadsemanticscuttle-53f0a57de09b8a2b0155042eaa433afd06ac682e.tar.gz
semanticscuttle-53f0a57de09b8a2b0155042eaa433afd06ac682e.tar.bz2
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
-rw-r--r--data/templates/bookmarks.tpl.php7
1 files changed, 6 insertions, 1 deletions
diff --git a/data/templates/bookmarks.tpl.php b/data/templates/bookmarks.tpl.php
index 8f502d3..ad2ecd3 100644
--- a/data/templates/bookmarks.tpl.php
+++ b/data/templates/bookmarks.tpl.php
@@ -222,6 +222,11 @@ if($currenttag!= '') {
$addresses[$row['bId']] = $row['bAddress'];
}
$otherCounts = $bookmarkservice->countOthers($addresses);
+ if ($userservice->isLoggedOn()) {
+ $existence = $bookmarkservice->bookmarksExist(
+ $addresses, $currentUser->getId()
+ );
+ }
foreach ($bookmarks as $key => &$row) {
switch ($row['bStatus']) {
@@ -284,7 +289,7 @@ if($currenttag!= '') {
// Copy link
if ($userservice->isLoggedOn()
&& ($currentUser->getId() != $row['uId'])
- && !$bookmarkservice->bookmarkExists($row['bAddress'], $currentUser->getId())
+ && !$existence[$row['bAddress']]
) {
$copy .= ' - <a href="'
. createURL('bookmarks', $currentUser->getUsername() .'?action=add&amp;copyOf='. $row['bId'])