From 8c80fe0bf51fa472ddf9bf225490e47ea1bf4a7f Mon Sep 17 00:00:00 2001 From: Michael Vogel Date: Sun, 20 May 2012 00:11:32 +0200 Subject: Performance tests --- mod/network.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'mod/network.php') diff --git a/mod/network.php b/mod/network.php index e59839ccc..c5347756c 100644 --- a/mod/network.php +++ b/mod/network.php @@ -413,7 +413,7 @@ function network_content(&$a, $update = 0) { $myurl = str_replace(array('www.','.'),array('','\\.'),$myurl); $diasp_url = str_replace('/profile/','/u/',$myurl); $sql_extra .= sprintf(" AND `item`.`parent` IN (SELECT distinct(`parent`) from item where ( `author-link` like '%s' or `tag` like '%s' or tag like '%s' )) ", - dbesc(protect_sprintf('%s' . $myurl)), + dbesc(protect_sprintf('%' . $myurl)), dbesc(protect_sprintf('%' . $myurl . '\\]%')), dbesc(protect_sprintf('%' . $diasp_url . '\\]%')) ); -- cgit v1.2.3 From 3ac7c4e8599266aba69bf521c7ba94393df3c728 Mon Sep 17 00:00:00 2001 From: friendica Date: Tue, 22 May 2012 21:20:31 -0700 Subject: keep FB out of private notes --- mod/network.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'mod/network.php') diff --git a/mod/network.php b/mod/network.php index e59839ccc..f43eeb67e 100644 --- a/mod/network.php +++ b/mod/network.php @@ -108,6 +108,10 @@ function network_content(&$a, $update = 0) { return login(false); } + $arr = array('query' => $a->query_string); + + call_hooks('network_content_init', $arr); + $o = ''; // item filter tabs @@ -157,7 +161,7 @@ function network_content(&$a, $update = 0) { $all_active = 'active'; } - + $postord_active = ''; if($all_active && x($_GET,'order') && $_GET['order'] !== 'comment') { -- cgit v1.2.3 From 49512105082dde72553f4250e6284920612cc6b8 Mon Sep 17 00:00:00 2001 From: Michael Vogel Date: Sat, 26 May 2012 03:21:07 +0200 Subject: Speed optimisation by enabling the posibility of the MySQL fulltext engine --- mod/network.php | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) (limited to 'mod/network.php') diff --git a/mod/network.php b/mod/network.php index c6f683b93..f54d055d3 100644 --- a/mod/network.php +++ b/mod/network.php @@ -416,11 +416,19 @@ function network_content(&$a, $update = 0) { $myurl = substr($myurl,strpos($myurl,'://')+3); $myurl = str_replace(array('www.','.'),array('','\\.'),$myurl); $diasp_url = str_replace('/profile/','/u/',$myurl); - $sql_extra .= sprintf(" AND `item`.`parent` IN (SELECT distinct(`parent`) from item where ( `author-link` like '%s' or `tag` like '%s' or tag like '%s' )) ", - dbesc(protect_sprintf('%' . $myurl)), - dbesc(protect_sprintf('%' . $myurl . '\\]%')), - dbesc(protect_sprintf('%' . $diasp_url . '\\]%')) - ); + if (get_config('system','use_fulltext_engine')) + $sql_extra .= sprintf(" AND `item`.`parent` IN (SELECT distinct(`parent`) from item where (MATCH(`author-link`) AGAINST ('".'"%s"'."' in boolean mode) or MATCH(`tag`) AGAINST ('".'"%s"'."' in boolean mode) or MATCH(tag) AGAINST ('".'"%s"'."' in boolean mode))) ", + dbesc(protect_sprintf($myurl)), + dbesc(protect_sprintf($myurl)), + dbesc(protect_sprintf($diasp_url)) + ); + else + $sql_extra .= sprintf(" AND `item`.`parent` IN (SELECT distinct(`parent`) from item where ( `author-link` like '%s' or `tag` like '%s' or tag like '%s' )) ", + dbesc(protect_sprintf('%' . $myurl)), + dbesc(protect_sprintf('%' . $myurl . '\\]%')), + dbesc(protect_sprintf('%' . $diasp_url . '\\]%')) + ); + } -- cgit v1.2.3 From f5290a5a107ef2d6c309c4a3205319c9b0d13994 Mon Sep 17 00:00:00 2001 From: friendica Date: Fri, 25 May 2012 18:29:06 -0700 Subject: missing entries on personal tab after sql text search optimise --- mod/network.php | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'mod/network.php') diff --git a/mod/network.php b/mod/network.php index f43eeb67e..fbfe2de4f 100644 --- a/mod/network.php +++ b/mod/network.php @@ -414,16 +414,15 @@ function network_content(&$a, $update = 0) { if($conv) { $myurl = $a->get_baseurl() . '/profile/'. $a->user['nickname']; $myurl = substr($myurl,strpos($myurl,'://')+3); - $myurl = str_replace(array('www.','.'),array('','\\.'),$myurl); + $myurl = str_replace('www.','',$myurl); $diasp_url = str_replace('/profile/','/u/',$myurl); $sql_extra .= sprintf(" AND `item`.`parent` IN (SELECT distinct(`parent`) from item where ( `author-link` like '%s' or `tag` like '%s' or tag like '%s' )) ", - dbesc(protect_sprintf('%s' . $myurl)), - dbesc(protect_sprintf('%' . $myurl . '\\]%')), - dbesc(protect_sprintf('%' . $diasp_url . '\\]%')) + dbesc(protect_sprintf('%' . $myurl)), + dbesc(protect_sprintf('%' . $myurl . ']%')), + dbesc(protect_sprintf('%' . $diasp_url . ']%')) ); } - if($update) { // only setup pagination on initial page view -- cgit v1.2.3 From a5dc41ab131d4235eb947ff00d7af0593bf0e460 Mon Sep 17 00:00:00 2001 From: Michael Vogel Date: Sat, 26 May 2012 11:51:48 +0200 Subject: Saved searches now can search for tags as well --- mod/network.php | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) (limited to 'mod/network.php') diff --git a/mod/network.php b/mod/network.php index f54d055d3..6b4fa9a5b 100644 --- a/mod/network.php +++ b/mod/network.php @@ -402,10 +402,22 @@ function network_content(&$a, $update = 0) { if(x($_GET,'search')) { $search = escape_tags($_GET['search']); - $sql_extra .= sprintf(" AND ( `item`.`body` like '%s' OR `item`.`tag` like '%s' ) ", - dbesc(protect_sprintf('%' . $search . '%')), - dbesc(protect_sprintf('%]' . $search . '[%')) - ); + if (get_config('system','use_fulltext_engine')) { + if(strpos($search,'#') === 0) + $sql_extra .= sprintf(" AND (MATCH(tag) AGAINST ('".'"%s"'."' in boolean mode)) ", + dbesc(protect_sprintf($search)) + ); + else + $sql_extra .= sprintf(" AND (MATCH(`item`.`body`) AGAINST ('".'"%s"'."' in boolean mode) or MATCH(tag) AGAINST ('".'"%s"'."' in boolean mode)) ", + dbesc(protect_sprintf($search)), + dbesc(protect_sprintf($search)) + ); + } else { + $sql_extra .= sprintf(" AND ( `item`.`body` like '%s' OR `item`.`tag` like '%s' ) ", + dbesc(protect_sprintf('%' . $search . '%')), + dbesc(protect_sprintf('%]' . $search . '[%')) + ); + } } if(strlen($file)) { $sql_extra .= file_tag_file_query('item',unxmlify($file)); -- cgit v1.2.3 From 29bdf432f012af9b1959d5b4a33b3c45d220fd64 Mon Sep 17 00:00:00 2001 From: friendica Date: Sat, 2 Jun 2012 00:40:38 -0700 Subject: fewer "bob smith to bob smith via wall-to-wall". --- mod/network.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'mod/network.php') diff --git a/mod/network.php b/mod/network.php index 7c4c1ac04..b998a3107 100644 --- a/mod/network.php +++ b/mod/network.php @@ -534,7 +534,7 @@ function network_content(&$a, $update = 0) { $parents_str = implode(', ', $parents_arr); $items = q("SELECT `item`.*, `item`.`id` AS `item_id`, - `contact`.`name`, `contact`.`photo`, `contact`.`url`, `contact`.`rel`, `contact`.`writable`, + `contact`.`name`, `contact`.`photo`, `contact`.`url`, `contact`.`alias`, `contact`.`rel`, `contact`.`writable`, `contact`.`network`, `contact`.`thumb`, `contact`.`dfrn-id`, `contact`.`self`, `contact`.`id` AS `cid`, `contact`.`uid` AS `contact-uid` FROM `item`, `contact` -- cgit v1.2.3