From 05c23695077062ea6948b7c5603848e941c6e9df Mon Sep 17 00:00:00 2001 From: cweiske Date: Sat, 20 Feb 2010 11:04:51 +0000 Subject: replace some strange foreach constructs with the proper variant git-svn-id: https://semanticscuttle.svn.sourceforge.net/svnroot/semanticscuttle/trunk@660 b3834d28-1941-0410-a4f8-b48e95affb8f --- data/templates/bookmarks.tpl.php | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'data/templates') diff --git a/data/templates/bookmarks.tpl.php b/data/templates/bookmarks.tpl.php index 0e9ac95..0050ec8 100644 --- a/data/templates/bookmarks.tpl.php +++ b/data/templates/bookmarks.tpl.php @@ -217,8 +217,7 @@ if($currenttag!= '') { id="bookmarks"> &$row) { switch ($row['bStatus']) { case 0: $access = ''; @@ -234,9 +233,7 @@ if($currenttag!= '') { $cats = ''; $tagsForCopy = ''; $tags = $row['tags']; - foreach(array_keys($tags) as $key) { - - $tag =& $tags[$key]; + foreach ($tags as $tkey => &$tag) { $cats .= ''. filter($tag) .', '; $tagsForCopy.= $tag.','; } -- cgit v1.3-2-g0d8e From fe522e57197133d3a4a09425bf2067418a6f3c7c Mon Sep 17 00:00:00 2001 From: cweiske Date: Sat, 20 Feb 2010 11:06:12 +0000 Subject: first sql optimization: fetch countOthers() for all bookmarks at once instead of each single git-svn-id: https://semanticscuttle.svn.sourceforge.net/svnroot/semanticscuttle/trunk@661 b3834d28-1941-0410-a4f8-b48e95affb8f --- data/templates/bookmarks.tpl.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'data/templates') diff --git a/data/templates/bookmarks.tpl.php b/data/templates/bookmarks.tpl.php index 0050ec8..b1a6eb0 100644 --- a/data/templates/bookmarks.tpl.php +++ b/data/templates/bookmarks.tpl.php @@ -216,7 +216,13 @@ if($currenttag!= '') {
';
} else {
--
cgit v1.3-2-g0d8e
From 53f0a57de09b8a2b0155042eaa433afd06ac682e Mon Sep 17 00:00:00 2001
From: cweiske
Date: Sat, 20 Feb 2010 11:41:01 +0000
Subject: 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
---
data/templates/bookmarks.tpl.php | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
(limited to 'data/templates')
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 .= ' - ';
} else {
diff --git a/doc/ChangeLog b/doc/ChangeLog
index 05757ac..65ed2e2 100644
--- a/doc/ChangeLog
+++ b/doc/ChangeLog
@@ -5,6 +5,7 @@ ChangeLog for SemantiScuttle
-------------------
- Many SQL optimizations
- New config option to skip "SET NAMES UTF8" call: $dbneedssetnames
+- Do not highlight admin bookmarks when $enableAdminColors is disabled
0.96.1 - 2010-02-09
--
cgit v1.3-2-g0d8e
From b18869f6d769c18d19fd937683352e0ea7a54939 Mon Sep 17 00:00:00 2001
From: cweiske
Date: Fri, 19 Mar 2010 07:43:42 +0000
Subject: 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
---
data/templates/bookmarks.tpl.php | 14 +++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)
(limited to 'data/templates')
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 = '';
--
cgit v1.3-2-g0d8e
From 733304908251397114d8895df2603242a2b7043c Mon Sep 17 00:00:00 2001
From: cweiske
Date: Wed, 9 Jun 2010 05:59:51 +0000
Subject: prepare release of 0.97.0
git-svn-id: https://semanticscuttle.svn.sourceforge.net/svnroot/semanticscuttle/trunk@712 b3834d28-1941-0410-a4f8-b48e95affb8f
---
build.xml | 4 ++--
data/templates/about.tpl.php | 2 +-
doc/ChangeLog | 4 ++--
3 files changed, 5 insertions(+), 5 deletions(-)
(limited to 'data/templates')
diff --git a/build.xml b/build.xml
index 9cf4de9..c1db166 100644
--- a/build.xml
+++ b/build.xml
@@ -8,8 +8,8 @@
-->