X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=mod%2Fnetwork.php;h=763b3693f4191a6aee018308d8e6e1f782613ca0;hb=cb05e677a96e1312263c0a1c63ee10cea62268b1;hp=04c2a1782b39afd82c6d7433143b720b59763edd;hpb=19129e06c39da10b7b026ab8c2176322102a95cf;p=friendica.git diff --git a/mod/network.php b/mod/network.php index 04c2a1782b..763b3693f4 100644 --- a/mod/network.php +++ b/mod/network.php @@ -71,21 +71,30 @@ function saved_searches($search) { intval(local_user()) ); - $o .= '
'; - $o .= '' . "\r\n"; - $o .= search($search,'netsearch-box',$srchurl,true); + $saved = array(); + + if(count($r)) { - $o .= ''; } - $o .= '
'; - - $o .= '
' . "\r\n"; + + $tpl = get_markup_template("saved_searches_aside.tpl"); + $o = replace_macros($tpl, array( + '$title' => t('Saved Searches'), + '$add' => t('add'), + '$searchbox' => search($search,'netsearch-box',$srchurl,true), + '$saved' => $saved, + )); + return $o; } @@ -102,7 +111,7 @@ function network_content(&$a, $update = 0) { // item filter tabs // TODO: fix this logic, reduce duplication - $a->page['content'] .= '
'; + //$a->page['content'] .= '
'; $starred_active = ''; $new_active = ''; @@ -328,15 +337,21 @@ function network_content(&$a, $update = 0) { } } - if((! $group) && (! $cid) && (! $update)) + if((! $group) && (! $cid) && (! $update)) { $o .= get_birthdays(); + $o .= get_events(); + } $sql_extra2 = (($nouveau) ? '' : " AND `item`.`parent` = `item`.`id` "); - if(x($_GET,'search')) - $sql_extra .= " AND `item`.`body` REGEXP '" . dbesc(escape_tags($_GET['search'])) . "' "; + if(x($_GET,'search')) { + $search = escape_tags($_GET['search']); + $sql_extra .= sprintf(" AND ( `item`.`body` REGEXP '%s' OR `item`.`tag` REGEXP '%s' ) ", + dbesc($search), + dbesc('\\]' . $search . '\\[') + ); + } - $r = q("SELECT COUNT(*) AS `total` FROM `item` LEFT JOIN `contact` ON `contact`.`id` = `item`.`contact-id` WHERE `item`.`uid` = %d AND `item`.`visible` = 1 AND `item`.`deleted` = 0