]> git.mxchange.org Git - friendica.git/blobdiff - mod/network.php
autocomplete contacts nickname while writting in a comment box.
[friendica.git] / mod / network.php
index 5aa39bf638c2d63b6a56e944c2142a59dae08522..9fed8592ec34b3a59491af9b7a76da2a511f292a 100644 (file)
@@ -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