X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=sidebyside;f=mod%2Fnetwork.php;h=0d37d4d2e25db10b2a0e4afe46992f507580da16;hb=47bd3243cdb4a4840ca4d40452402a86b792ce1b;hp=23cf098b65b25913ad3bc95bd0ec2f3ac6d3411d;hpb=0c22e9a1fe32ad3e1ff27d72bf4f9a54c07d5d7a;p=friendica.git diff --git a/mod/network.php b/mod/network.php index 23cf098b65..0d37d4d2e2 100644 --- a/mod/network.php +++ b/mod/network.php @@ -1,4 +1,7 @@ argc > 1 && is_numeric($a->argv[1])) ? intval($a->argv[1]) : 0); set_pconfig(local_user(), 'network.view', 'group.selected', $group_id); - require_once('include/group.php'); - require_once('include/contact_widgets.php'); - require_once('include/items.php'); - require_once('include/ForumManager.php'); + require_once 'include/group.php'; + require_once 'include/contact_widgets.php'; + require_once 'include/items.php'; + require_once 'include/ForumManager.php'; - if(! x($a->page,'aside')) + if (! x($a->page, 'aside')) { $a->page['aside'] = ''; + } - $search = ((x($_GET,'search')) ? escape_tags($_GET['search']) : ''); + $search = ((x($_GET, 'search')) ? escape_tags($_GET['search']) : ''); - if(x($_GET,'save')) { + if (x($_GET, 'save')) { $r = qu("SELECT * FROM `search` WHERE `uid` = %d AND `term` = '%s' LIMIT 1", intval(local_user()), dbesc($search) @@ -132,7 +141,7 @@ function network_init(App $a) { ); } } - if(x($_GET,'remove')) { + if (x($_GET, 'remove')) { q("DELETE FROM `search` WHERE `uid` = %d AND `term` = '%s'", intval(local_user()), dbesc($search) @@ -140,7 +149,7 @@ function network_init(App $a) { } // search terms header - if(x($_GET,'search')) { + if (x($_GET, 'search')) { $a->page['content'] .= replace_macros(get_markup_template("section_title.tpl"),array( '$title' => sprintf( t('Results for: %s'), $search) )); @@ -157,8 +166,9 @@ function network_init(App $a) { function saved_searches($search) { - if(! feature_enabled(local_user(),'savedsearch')) + if (! feature_enabled(local_user(),'savedsearch')) { return ''; + } $a = get_app(); @@ -574,11 +584,7 @@ function network_content(App $a, $update = 0) { $sql_order = "`item`.`id`"; $order_mode = "id"; } else { - // Disabled until final decision what to do with this - //if (get_config('system','use_fulltext_engine')) - // $sql_extra = sprintf(" AND MATCH (`item`.`body`, `item`.`title`) AGAINST ('%s' in boolean mode) ", dbesc(protect_sprintf($search))); - //else - $sql_extra = sprintf(" AND `item`.`body` REGEXP '%s' ", dbesc(protect_sprintf(preg_quote($search)))); + $sql_extra = sprintf(" AND `item`.`body` REGEXP '%s' ", dbesc(protect_sprintf(preg_quote($search)))); $sql_order = "`item`.`id`"; $order_mode = "id"; } @@ -599,21 +605,6 @@ function network_content(App $a, $update = 0) { $pager_sql = ''; } else { - if(get_config('system', 'old_pager')) { - $r = qu("SELECT COUNT(*) AS `total` - FROM $sql_table $sql_post_table INNER JOIN `contact` ON `contact`.`id` = $sql_table.`contact-id` - AND (NOT `contact`.`blocked` OR `contact`.`pending`) - WHERE $sql_table.`uid` = %d AND $sql_table.`visible` AND NOT $sql_table.`deleted` - $sql_extra2 $sql_extra3 - $sql_extra $sql_nets ", - intval($_SESSION['uid']) - ); - - if (dbm::is_result($r)) { - $a->set_pager_total($r[0]['total']); - } - } - // check if we serve a mobile device and get the user settings // accordingly if ($a->is_mobile) { @@ -788,15 +779,13 @@ function network_content(App $a, $update = 0) { $mode = (($nouveau) ? 'network-new' : 'network'); - $o .= conversation($a,$items,$mode,$update); + $o .= conversation($a, $items, $mode, $update); if (!$update) { - if (get_pconfig(local_user(),'system','infinite_scroll')) { + if (get_pconfig(local_user(), 'system', 'infinite_scroll')) { $o .= scroll_loader(); - } elseif (!get_config('system', 'old_pager')) { - $o .= alt_pager($a,count($items)); } else { - $o .= paginate($a); + $o .= alt_pager($a, count($items)); } } @@ -806,7 +795,7 @@ function network_content(App $a, $update = 0) { /** * @brief Get the network tabs menu * - * @param app $a The global App + * @param App $a The global App * @return string Html of the networktab */ function network_tabs(App $a) { @@ -852,10 +841,10 @@ function network_tabs(App $a) { ); } - if(feature_enabled(local_user(),'new_tab')) { + if (feature_enabled(local_user(),'new_tab')) { $tabs[] = array( 'label' => t('New'), - 'url' => str_replace('/new', '', $cmd) . ($len_naked_cmd ? '/' : '') . 'new' . ((x($_GET,'cid')) ? '/?f=&cid=' . $_GET['cid'] : ''), + 'url' => 'network/new' . ((x($_GET,'cid')) ? '/?f=&cid=' . $_GET['cid'] : ''), 'sel' => $new_active, 'title' => t('Activity Stream - by date'), 'id' => 'activitiy-by-date-tab',