From 3cc756f3029e5f3b02008dac94a90e168d398c9a Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Sun, 4 Feb 2018 20:42:40 +0100 Subject: remove some never used indices which prevented our item queries to find the right query execution plan in mysql and adjust some queries to optimze the result --- Zotlabs/Widget/Forums.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'Zotlabs/Widget/Forums.php') diff --git a/Zotlabs/Widget/Forums.php b/Zotlabs/Widget/Forums.php index 44d95012f..b572444e3 100644 --- a/Zotlabs/Widget/Forums.php +++ b/Zotlabs/Widget/Forums.php @@ -64,7 +64,8 @@ class Forums { // There also should be a way to update this via ajax. for($x = 0; $x < count($r1); $x ++) { - $r = q("select sum(item_unseen) as unseen from item where owner_xchan = '%s' and uid = %d and item_unseen = 1 $perms_sql ", + $r = q("select sum(item_unseen) as unseen from item + where owner_xchan = '%s' and uid = %d and item_unseen = 1 $perms_sql ", dbesc($r1[$x]['xchan_hash']), intval(local_channel()) ); -- cgit v1.2.3 From 9d55a254dcd39e2a77a1c24625adba69d16acb7a Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Sun, 4 Feb 2018 22:37:30 +0100 Subject: this will fix the cards query and keep the rest intact --- Zotlabs/Widget/Forums.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Zotlabs/Widget/Forums.php') diff --git a/Zotlabs/Widget/Forums.php b/Zotlabs/Widget/Forums.php index b572444e3..f65a639ff 100644 --- a/Zotlabs/Widget/Forums.php +++ b/Zotlabs/Widget/Forums.php @@ -65,7 +65,7 @@ class Forums { for($x = 0; $x < count($r1); $x ++) { $r = q("select sum(item_unseen) as unseen from item - where owner_xchan = '%s' and uid = %d and item_unseen = 1 $perms_sql ", + where uid = %d and owner_xchan = '%s' and item_unseen = 1 $perms_sql ", dbesc($r1[$x]['xchan_hash']), intval(local_channel()) ); -- cgit v1.2.3