- if(x($a->data,'search'))
- $search = notags(trim($a->data['search']));
- else
- $search = ((x($_GET,'search')) ? notags(trim(rawurldecode($_GET['search']))) : '');
+ require_once 'include/bbcode.php';
+ require_once 'include/security.php';
+ require_once 'include/conversation.php';
+
+ if (!$update) {
+ $tabs = [];
+
+ if ((local_user() || in_array($page_style, [CP_USERS_AND_GLOBAL, CP_USERS_ON_SERVER])) && empty(Config::get('system','singleuser'))) {
+ $tabs[] = array(
+ 'label' => t('Community'),
+ 'url' => 'community/local',
+ 'sel' => $content == 'local' ? 'active' : '',
+ 'title' => t('Posts from local users on this server'),
+ 'id' => 'community-local-tab',
+ 'accesskey' => 'l'
+ );
+ }
+
+ if (local_user() || in_array($page_style, [CP_USERS_AND_GLOBAL, CP_GLOBAL_COMMUNITY])) {
+ $tabs[] = array(
+ 'label' => t('Global Timeline'),
+ 'url' => 'community/global',
+ 'sel' => $content == 'global' ? 'active' : '',
+ 'title' => t('Posts from users of the federated network'),
+ 'id' => 'community-global-tab',
+ 'accesskey' => 'g'
+ );
+ }
+
+ $tab_tpl = get_markup_template('common_tabs.tpl');
+ $o .= replace_macros($tab_tpl, array('$tabs' => $tabs));
+
+ nav_set_selected('community');