X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=inline;f=mod%2Fnetwork.php;h=9fed8592ec34b3a59491af9b7a76da2a511f292a;hb=bcb672e7ff859168b639ffffc38553bbcf7e918c;hp=5aa39bf638c2d63b6a56e944c2142a59dae08522;hpb=2116943964e0c10984976f6d38eba044e35f983a;p=friendica.git diff --git a/mod/network.php b/mod/network.php index 5aa39bf638..9fed8592ec 100644 --- a/mod/network.php +++ b/mod/network.php @@ -133,14 +133,28 @@ function network_content(&$a, $update = 0) { && ($search_active == '')) { $all_active = 'active'; } + $postord_active = ''; + + if($all_active && x($_GET,'order') && $_GET['order'] !== 'comment') { + $all_active = ''; + $postord_active = 'active'; + } + + // tabs $tabs = array( array( - 'label' => t('All'), + 'label' => t('Commented Order'), 'url'=>$a->get_baseurl() . '/' . str_replace('/new', '', $a->cmd) . ((x($_GET,'cid')) ? '?cid=' . $_GET['cid'] : ''), 'sel'=>$all_active, ), + array( + 'label' => t('Posted Order'), + 'url'=>$a->get_baseurl() . '/' . str_replace('/new', '', $a->cmd) . '?order=post' . ((x($_GET,'cid')) ? '&cid=' . $_GET['cid'] : ''), + 'sel'=>$postord_active, + ), + array( 'label' => t('New'), 'url' => $a->get_baseurl() . '/' . str_replace('/new', '', $a->cmd) . '/new' . ((x($_GET,'cid')) ? '/?cid=' . $_GET['cid'] : ''), @@ -314,15 +328,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