aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Module
diff options
context:
space:
mode:
authorMario Vavti <mario@mariovavti.com>2018-09-29 18:00:14 +0200
committerMario Vavti <mario@mariovavti.com>2018-09-29 18:00:14 +0200
commit5906d6cce373df81458bf16d461bee9705fed3a6 (patch)
treeb20a6616ca94d5ae781a4fa44d25a93d6fde838e /Zotlabs/Module
parent8265dac9c0127c55c378094b5ccceddc1d66bea4 (diff)
downloadvolse-hubzilla-5906d6cce373df81458bf16d461bee9705fed3a6.tar.gz
volse-hubzilla-5906d6cce373df81458bf16d461bee9705fed3a6.tar.bz2
volse-hubzilla-5906d6cce373df81458bf16d461bee9705fed3a6.zip
improve network search
Diffstat (limited to 'Zotlabs/Module')
-rw-r--r--Zotlabs/Module/Network.php19
1 files changed, 4 insertions, 15 deletions
diff --git a/Zotlabs/Module/Network.php b/Zotlabs/Module/Network.php
index e7b150faf..73f09f90b 100644
--- a/Zotlabs/Module/Network.php
+++ b/Zotlabs/Module/Network.php
@@ -84,18 +84,7 @@ class Network extends \Zotlabs\Web\Controller {
$search = (($_GET['search']) ? $_GET['search'] : '');
if($search) {
- $_GET['netsearch'] = escape_tags($search);
- if(strpos($search,'@') === 0) {
- $r = q("select abook_id from abook left join xchan on abook_xchan = xchan_hash where xchan_name = '%s' and abook_channel = %d limit 1",
- dbesc(substr($search,1)),
- intval(local_channel())
- );
- if($r) {
- $_GET['cid'] = $r[0]['abook_id'];
- $search = $_GET['search'] = '';
- }
- }
- elseif(strpos($search,'#') === 0) {
+ if(strpos($search,'#') === 0) {
$hashtags = substr($search,1);
$search = $_GET['search'] = '';
}
@@ -143,7 +132,7 @@ class Network extends \Zotlabs\Web\Controller {
$deftag = '';
- if(x($_GET,'search') || $file || (!$pf && $cid))
+ if(x($_GET,'search') || $file || (!$pf && $cid) || $hashtags || $verb || $category)
$nouveau = true;
if($cid) {
@@ -169,9 +158,9 @@ class Network extends \Zotlabs\Web\Controller {
if(! $update) {
// search terms header
- if($search) {
+ if($search || $hashtags) {
$o .= replace_macros(get_markup_template("section_title.tpl"),array(
- '$title' => t('Search Results For:') . ' ' . htmlspecialchars($search, ENT_COMPAT,'UTF-8')
+ '$title' => t('Search Results For:') . ' ' . (($search) ? htmlspecialchars($search, ENT_COMPAT,'UTF-8') : '#' . htmlspecialchars($hashtags, ENT_COMPAT,'UTF-8'))
));
}