]> git.mxchange.org Git - friendica.git/blobdiff - mod/settings.php
Merge branch 'master', remote-tracking branch 'remotes/upstream/master'
[friendica.git] / mod / settings.php
old mode 100755 (executable)
new mode 100644 (file)
index 59ede47..5f5b2ab
@@ -1,11 +1,20 @@
 <?php
 
 
-function settings_init(&$a) {
-       if(local_user()) {
-               profile_load($a,$a->user['nickname']);
+function get_theme_config_file($theme){
+       $a = get_app();
+       $base_theme = $a->theme_info['extends'];
+       
+       if (file_exists("view/theme/$theme/config.php")){
+               return "view/theme/$theme/config.php";
+       } 
+       if (file_exists("view/theme/$base_theme/config.php")){
+               return "view/theme/$base_theme/config.php";
        }
+       return null;
+}
 
+function settings_init(&$a) {
        // These lines provide the javascript needed by the acl selector
 
        $a->page['htmlhead'] .= "<script> var ispublic = '" . t('everybody') . "';" ;
@@ -34,6 +43,52 @@ function settings_init(&$a) {
 EOT;
 
 
+
+       $tabs = array(
+               array(
+                       'label' => t('Account settings'),
+                       'url'   => $a->get_baseurl(true).'/settings',
+                       'selected'      => (($a->argc == 1)?'active':''),
+               ),      
+               array(
+                       'label' => t('Display settings'),
+                       'url'   => $a->get_baseurl(true).'/settings/display',
+                       'selected'      => (($a->argc > 1) && ($a->argv[1] === 'display')?'active':''),
+               ),      
+               
+               array(
+                       'label' => t('Connector settings'),
+                       'url'   => $a->get_baseurl(true).'/settings/connectors',
+                       'selected'      => (($a->argc > 1) && ($a->argv[1] === 'connectors')?'active':''),
+               ),
+               array(
+                       'label' => t('Plugin settings'),
+                       'url'   => $a->get_baseurl(true).'/settings/addon',
+                       'selected'      => (($a->argc > 1) && ($a->argv[1] === 'addon')?'active':''),
+               ),
+               array(
+                       'label' => t('Connected apps'),
+                       'url' => $a->get_baseurl(true) . '/settings/oauth',
+                       'selected' => (($a->argc > 1) && ($a->argv[1] === 'oauth')?'active':''),
+               ),
+               array(
+                       'label' => t('Export personal data'),
+                       'url' => $a->get_baseurl(true) . '/uexport',
+                       'selected' => ''
+               ),
+               array(
+                       'label' => t('Remove account'),
+                       'url' => $a->get_baseurl(true) . '/removeme',
+                       'selected' => ''
+               )
+       );
+       
+       $tabtpl = get_markup_template("generic_links_widget.tpl");
+       $a->page['aside'] = replace_macros($tabtpl, array(
+               '$title' => t('Settings'),
+               '$items' => $tabs,
+       ));
+
 }
 
 
@@ -193,6 +248,46 @@ function settings_post(&$a) {
                call_hooks('connector_settings_post', $_POST);
                return;
        }
+       
+       if(($a->argc > 1) && ($a->argv[1] == 'display')) {
+               
+               check_form_security_token_redirectOnErr('/settings/display', 'settings_display');
+
+               $theme = ((x($_POST,'theme')) ? notags(trim($_POST['theme']))  : $a->user['theme']);
+               $nosmile = ((x($_POST,'nosmile')) ? intval($_POST['nosmile'])  : 0);  
+               $browser_update   = ((x($_POST,'browser_update')) ? intval($_POST['browser_update']) : 0);
+               $browser_update   = $browser_update * 1000;
+               if($browser_update < 10000)
+                       $browser_update = 40000;
+
+               $itemspage_network   = ((x($_POST,'itemspage_network')) ? intval($_POST['itemspage_network']) : 40);
+               if($itemspage_network > 100)
+                                       $itemspage_network = 40;
+
+
+               set_pconfig(local_user(),'system','update_interval', $browser_update);
+               set_pconfig(local_user(),'system','itemspage_network', $itemspage_network);
+               set_pconfig(local_user(),'system','no_smilies',$nosmile);
+
+
+               if ($theme == $a->user['theme']){
+                       // call theme_post only if theme has not been changed
+                       if( ($themeconfigfile = get_theme_config_file($theme)) != null){
+                               require_once($themeconfigfile);
+                               theme_post($a);
+                       }
+               }
+
+
+               $r = q("UPDATE `user` SET `theme` = '%s' WHERE `uid` = %d LIMIT 1",
+                               dbesc($theme),
+                               intval(local_user())
+               );
+       
+               call_hooks('display_settings_post', $_POST);
+               goaway($a->get_baseurl(true) . '/settings/display' );
+               return; // NOTREACHED
+       }
 
        check_form_security_token_redirectOnErr('/settings', 'settings');
        
@@ -227,7 +322,7 @@ function settings_post(&$a) {
                }
        }
 
-       $theme            = ((x($_POST,'theme'))      ? notags(trim($_POST['theme']))        : $a->user['theme']);
+       
        $username         = ((x($_POST,'username'))   ? notags(trim($_POST['username']))     : '');
        $email            = ((x($_POST,'email'))      ? notags(trim($_POST['email']))        : '');
        $timezone         = ((x($_POST,'timezone'))   ? notags(trim($_POST['timezone']))     : '');
@@ -242,14 +337,6 @@ function settings_post(&$a) {
        $expire_starred   = ((x($_POST,'expire_starred')) ? intval($_POST['expire_starred']) : 0);
        $expire_photos    = ((x($_POST,'expire_photos'))? intval($_POST['expire_photos'])        : 0);
 
-       $browser_update   = ((x($_POST,'browser_update')) ? intval($_POST['browser_update']) : 0);
-       $browser_update   = $browser_update * 1000;
-       if($browser_update < 10000)
-               $browser_update = 40000;
-
-       $itemspage_network   = ((x($_POST,'itemspage_network')) ? intval($_POST['itemspage_network']) : 40);
-       if($itemspage_network > 100)
-                $itemspage_network = 40;
 
 
        $allow_location   = (((x($_POST,'allow_location')) && (intval($_POST['allow_location']) == 1)) ? 1: 0);
@@ -259,10 +346,14 @@ function settings_post(&$a) {
        $page_flags       = (((x($_POST,'page-flags')) && (intval($_POST['page-flags']))) ? intval($_POST['page-flags']) : 0);
        $blockwall        = (((x($_POST,'blockwall')) && (intval($_POST['blockwall']) == 1)) ? 0: 1); // this setting is inverted!
        $blocktags        = (((x($_POST,'blocktags')) && (intval($_POST['blocktags']) == 1)) ? 0: 1); // this setting is inverted!
-
+       $unkmail          = (((x($_POST,'unkmail')) && (intval($_POST['unkmail']) == 1)) ? 1: 0);
+       $cntunkmail       = ((x($_POST,'cntunkmail')) ? intval($_POST['cntunkmail']) : 0);
        $suggestme        = ((x($_POST,'suggestme')) ? intval($_POST['suggestme'])  : 0);  
        $hide_friends     = (($_POST['hide-friends'] == 1) ? 1: 0);
        $hidewall         = (($_POST['hidewall'] == 1) ? 1: 0);
+       $post_newfriend   = (($_POST['post_newfriend'] == 1) ? 1: 0);
+       $post_joingroup   = (($_POST['post_joingroup'] == 1) ? 1: 0);
+       $post_profilechange   = (($_POST['post_profilechange'] == 1) ? 1: 0);
 
 
        $notify = 0;
@@ -345,10 +436,12 @@ function settings_post(&$a) {
        set_pconfig(local_user(),'expire','photos', $expire_photos);
 
        set_pconfig(local_user(),'system','suggestme', $suggestme);
-       set_pconfig(local_user(),'system','update_interval', $browser_update);
-       set_pconfig(local_user(),'system','itemspage_network', $itemspage_network);
+       set_pconfig(local_user(),'system','post_newfriend', $post_newfriend);
+       set_pconfig(local_user(),'system','post_joingroup', $post_joingroup);
+       set_pconfig(local_user(),'system','post_profilechange', $post_profilechange);
+
 
-       $r = q("UPDATE `user` SET `username` = '%s', `email` = '%s', `openid` = '%s', `timezone` = '%s',  `allow_cid` = '%s', `allow_gid` = '%s', `deny_cid` = '%s', `deny_gid` = '%s', `notify-flags` = %d, `page-flags` = %d, `default-location` = '%s', `allow_location` = %d, `theme` = '%s', `maxreq` = %d, `expire` = %d, `openidserver` = '%s', `blockwall` = %d, `hidewall` = %d, `blocktags` = %d  WHERE `uid` = %d LIMIT 1",
+       $r = q("UPDATE `user` SET `username` = '%s', `email` = '%s', `openid` = '%s', `timezone` = '%s',  `allow_cid` = '%s', `allow_gid` = '%s', `deny_cid` = '%s', `deny_gid` = '%s', `notify-flags` = %d, `page-flags` = %d, `default-location` = '%s', `allow_location` = %d, `maxreq` = %d, `expire` = %d, `openidserver` = '%s', `blockwall` = %d, `hidewall` = %d, `blocktags` = %d, `unkmail` = %d, `cntunkmail` = %d  WHERE `uid` = %d LIMIT 1",
                        dbesc($username),
                        dbesc($email),
                        dbesc($openid),
@@ -361,13 +454,14 @@ function settings_post(&$a) {
                        intval($page_flags),
                        dbesc($defloc),
                        intval($allow_location),
-                       dbesc($theme),
                        intval($maxreq),
                        intval($expire),
                        dbesc($openidserver),
                        intval($blockwall),
                        intval($hidewall),
                        intval($blocktags),
+                       intval($unkmail),
+                       intval($cntunkmail),
                        intval(local_user())
        );
        if($r)
@@ -433,38 +527,7 @@ function settings_content(&$a) {
                return;
        }
        
-       $tabs = array(
-               array(
-                       'label' => t('Account settings'),
-                       'url'   => $a->get_baseurl(true).'/settings',
-                       'sel'   => (($a->argc == 1)?'active':''),
-               ),      
-               array(
-                       'label' => t('Connector settings'),
-                       'url'   => $a->get_baseurl(true).'/settings/connectors',
-                       'sel'   => (($a->argc > 1) && ($a->argv[1] === 'connectors')?'active':''),
-               ),
-               array(
-                       'label' => t('Plugin settings'),
-                       'url'   => $a->get_baseurl(true).'/settings/addon',
-                       'sel'   => (($a->argc > 1) && ($a->argv[1] === 'addon')?'active':''),
-               ),
-               array(
-                       'label' => t('Connections'),
-                       'url' => $a->get_baseurl(true) . '/settings/oauth',
-                       'sel' => (($a->argc > 1) && ($a->argv[1] === 'oauth')?'active':''),
-               ),
-               array(
-                       'label' => t('Export personal data'),
-                       'url' => $a->get_baseurl(true) . '/uexport',
-                       'sel' => ''
-               )
-       );
-       
-       $tabtpl = get_markup_template("common_tabs.tpl");
-       $tabs = replace_macros($tabtpl, array(
-               '$tabs' => $tabs,
-       ));
+
                
        if(($a->argc > 1) && ($a->argv[1] === 'oauth')) {
                
@@ -472,7 +535,6 @@ function settings_content(&$a) {
                        $tpl = get_markup_template("settings_oauth_edit.tpl");
                        $o .= replace_macros($tpl, array(
                                '$form_security_token' => get_form_security_token("settings_oauth"),
-                               '$tabs'         => $tabs,
                                '$title'        => t('Add application'),
                                '$submit'       => t('Submit'),
                                '$cancel'       => t('Cancel'),
@@ -499,7 +561,6 @@ function settings_content(&$a) {
                        $tpl = get_markup_template("settings_oauth_edit.tpl");
                        $o .= replace_macros($tpl, array(
                                '$form_security_token' => get_form_security_token("settings_oauth"),
-                               '$tabs'         => $tabs,
                                '$title'        => t('Add application'),
                                '$submit'       => t('Update'),
                                '$cancel'       => t('Cancel'),
@@ -542,7 +603,6 @@ function settings_content(&$a) {
                        '$consumerkey' => t('Client key starts with'),
                        '$noname'       => t('No name'),
                        '$remove'       => t('Remove authorization'),
-                       '$tabs'         => $tabs,
                        '$apps'         => $r,
                ));
                return $o;
@@ -562,7 +622,6 @@ function settings_content(&$a) {
                $o .= replace_macros($tpl, array(
                        '$form_security_token' => get_form_security_token("settings_addon"),
                        '$title'        => t('Plugin Settings'),
-                       '$tabs'         => $tabs,
                        '$settings_addons' => $settings_addons
                ));
                return $o;
@@ -577,36 +636,35 @@ function settings_content(&$a) {
                $diasp_enabled = sprintf( t('Built-in support for %s connectivity is %s'), t('Diaspora'), ((get_config('system','diaspora_enabled')) ? t('enabled') : t('disabled')));
                $ostat_enabled = sprintf( t('Built-in support for %s connectivity is %s'), t('StatusNet'), ((get_config('system','ostatus_disabled')) ? t('disabled') : t('enabled')));
 
-       $mail_disabled = ((function_exists('imap_open') && (! get_config('system','imap_disabled'))) ? 0 : 1);
-       if(get_config('system','dfrn_only'))
-               $mail_disabled = 1;
+               $mail_disabled = ((function_exists('imap_open') && (! get_config('system','imap_disabled'))) ? 0 : 1);
+               if(get_config('system','dfrn_only'))
+                       $mail_disabled = 1;
 
-       if(! $mail_disabled) {
-               $r = q("SELECT * FROM `mailacct` WHERE `uid` = %d LIMIT 1",
-                       local_user()
-               );
-       }
-       else {
-               $r = null;
-       }
+               if(! $mail_disabled) {
+                       $r = q("SELECT * FROM `mailacct` WHERE `uid` = %d LIMIT 1",
+                               local_user()
+                       );
+               }
+               else {
+                       $r = null;
+               }
 
-       $mail_server       = ((count($r)) ? $r[0]['server'] : '');
-       $mail_port         = ((count($r) && intval($r[0]['port'])) ? intval($r[0]['port']) : '');
-       $mail_ssl          = ((count($r)) ? $r[0]['ssltype'] : '');
-       $mail_user         = ((count($r)) ? $r[0]['user'] : '');
-       $mail_replyto      = ((count($r)) ? $r[0]['reply_to'] : '');
-       $mail_pubmail      = ((count($r)) ? $r[0]['pubmail'] : 0);
-       $mail_action       = ((count($r)) ? $r[0]['action'] : 0);
-       $mail_movetofolder = ((count($r)) ? $r[0]['movetofolder'] : '');
-       $mail_chk          = ((count($r)) ? $r[0]['last_check'] : '0000-00-00 00:00:00');
+               $mail_server       = ((count($r)) ? $r[0]['server'] : '');
+               $mail_port         = ((count($r) && intval($r[0]['port'])) ? intval($r[0]['port']) : '');
+               $mail_ssl          = ((count($r)) ? $r[0]['ssltype'] : '');
+               $mail_user         = ((count($r)) ? $r[0]['user'] : '');
+               $mail_replyto      = ((count($r)) ? $r[0]['reply_to'] : '');
+               $mail_pubmail      = ((count($r)) ? $r[0]['pubmail'] : 0);
+               $mail_action       = ((count($r)) ? $r[0]['action'] : 0);
+               $mail_movetofolder = ((count($r)) ? $r[0]['movetofolder'] : '');
+               $mail_chk          = ((count($r)) ? $r[0]['last_check'] : '0000-00-00 00:00:00');
 
 
-       $tpl = get_markup_template("settings_connectors.tpl");
+               $tpl = get_markup_template("settings_connectors.tpl");
                $o .= replace_macros($tpl, array(
                        '$form_security_token' => get_form_security_token("settings_connectors"),
                        
                        '$title'        => t('Connector Settings'),
-                       '$tabs'         => $tabs,
 
                        '$diasp_enabled' => $diasp_enabled,
                        '$ostat_enabled' => $ostat_enabled,
@@ -617,7 +675,7 @@ function settings_content(&$a) {
                        '$mail_disabled' => (($mail_disabled) ? t('Email access is disabled on this site.') : ''),
                        '$mail_server'  => array('mail_server',  t('IMAP server name:'), $mail_server, ''),
                        '$mail_port'    => array('mail_port',    t('IMAP port:'), $mail_port, ''),
-                       '$mail_ssl'             => array('mail_ssl',     t('Security:'), strtoupper($mail_ssl), '', array( ''=>t('None'), 'TLS'=>'TLS', 'SSL'=>'SSL')),
+                       '$mail_ssl'             => array('mail_ssl',     t('Security:'), strtoupper($mail_ssl), '', array( 'notls'=>t('None'), 'TLS'=>'TLS', 'SSL'=>'SSL')),
                        '$mail_user'    => array('mail_user',    t('Email login name:'), $mail_user, ''),
                        '$mail_pass'    => array('mail_pass',    t('Email password:'), '', ''),
                        '$mail_replyto' => array('mail_replyto', t('Reply-to address:'), '', 'Optional'),
@@ -628,9 +686,82 @@ function settings_content(&$a) {
 
                        '$settings_connectors' => $settings_connectors
                ));
+
+               call_hooks('display_settings', $o);
                return $o;
        }
 
+       /*
+        * DISPLAY SETTINGS
+        */
+       if(($a->argc > 1) && ($a->argv[1] === 'display')) {
+               $default_theme = get_config('system','theme');
+               if(! $default_theme)
+                       $default_theme = 'default';
+
+               $allowed_themes_str = get_config('system','allowed_themes');
+               $allowed_themes_raw = explode(',',$allowed_themes_str);
+               $allowed_themes = array();
+               if(count($allowed_themes_raw))
+                       foreach($allowed_themes_raw as $x) 
+                               if(strlen(trim($x)) && is_dir("view/theme/$x"))
+                                       $allowed_themes[] = trim($x);
+
+               
+               $themes = array();
+               $files = glob('view/theme/*');
+               if($allowed_themes) {
+                       foreach($allowed_themes as $th) {
+                               $f = $th;
+                               $is_experimental = file_exists('view/theme/' . $th . '/experimental');
+                               $unsupported = file_exists('view/theme/' . $th . '/unsupported');
+                               if (!$is_experimental or ($is_experimental && (get_config('experimentals','exp_themes')==1 or get_config('experimentals','exp_themes')===false))){ 
+                                       $theme_name = (($is_experimental) ?  sprintf("%s - \x28Experimental\x29", $f) : $f);
+                                       $themes[$f]=$theme_name;
+                               }
+                       }
+               }
+               $theme_selected = (!x($_SESSION,'theme')? $default_theme : $_SESSION['theme']);
+               
+               $browser_update = intval(get_pconfig(local_user(), 'system','update_interval'));
+               $browser_update = (($browser_update == 0) ? 40 : $browser_update / 1000); // default if not set: 40 seconds
+
+               $itemspage_network = intval(get_pconfig(local_user(), 'system','itemspage_network'));
+               $itemspage_network = (($itemspage_network > 0 && $itemspage_network < 101) ? $itemspage_network : 40); // default if not set: 40 items
+               
+               $nosmile = get_pconfig(local_user(),'system','no_smilies');
+               $nosmile = (($nosmile===false)? '0': $nosmile); // default if not set: 0
+
+
+               $theme_config = "";
+               if( ($themeconfigfile = get_theme_config_file($theme_selected)) != null){
+                       require_once($themeconfigfile);
+                       $theme_config = theme_content($a);
+               }
+               
+               $tpl = get_markup_template("settings_display.tpl");
+               $o = replace_macros($tpl, array(
+                       '$ptitle'       => t('Display Settings'),
+                       '$form_security_token' => get_form_security_token("settings_display"),
+                       '$submit'       => t('Submit'),
+                       '$baseurl' => $a->get_baseurl(true),
+                       '$uid' => local_user(),
+               
+                       '$theme'        => array('theme', t('Display Theme:'), $theme_selected, '', $themes),
+                       '$ajaxint'   => array('browser_update',  t("Update browser every xx seconds"), $browser_update, t('Minimum of 10 seconds, no maximum')),
+                       '$itemspage_network'   => array('itemspage_network',  t("Number of items to display on the network page:"), $itemspage_network, t('Maximum of 100 items')),
+                       '$nosmile'      => array('nosmile', t("Don't show emoticons"), $nosmile, ''),
+                       
+                       '$theme_config' => $theme_config,
+               ));
+               
+               return $o;
+       }
+       
+       
+       /*
+        * ACCOUNT SETTINGS
+        */
 
        require_once('include/acl_selectors.php');
 
@@ -640,17 +771,19 @@ function settings_content(&$a) {
        if(count($p))
                $profile = $p[0];
 
-       $username = $a->user['username'];
-       $email    = $a->user['email'];
-       $nickname = $a->user['nickname'];
-       $timezone = $a->user['timezone'];
-       $notify   = $a->user['notify-flags'];
-       $defloc   = $a->user['default-location'];
-       $openid   = $a->user['openid'];
-       $maxreq   = $a->user['maxreq'];
-       $expire   = ((intval($a->user['expire'])) ? $a->user['expire'] : '');
-       $blockwall = $a->user['blockwall'];
-       $blocktags = $a->user['blocktags'];
+       $username   = $a->user['username'];
+       $email      = $a->user['email'];
+       $nickname   = $a->user['nickname'];
+       $timezone   = $a->user['timezone'];
+       $notify     = $a->user['notify-flags'];
+       $defloc     = $a->user['default-location'];
+       $openid     = $a->user['openid'];
+       $maxreq     = $a->user['maxreq'];
+       $expire     = ((intval($a->user['expire'])) ? $a->user['expire'] : '');
+       $blockwall  = $a->user['blockwall'];
+       $blocktags  = $a->user['blocktags'];
+       $unkmail    = $a->user['unkmail'];
+       $cntunkmail = $a->user['cntunkmail'];
 
        $expire_items = get_pconfig(local_user(), 'expire','items');
        $expire_items = (($expire_items===false)? '1' : $expire_items); // default if not set: 1
@@ -668,11 +801,15 @@ function settings_content(&$a) {
        $suggestme = get_pconfig(local_user(), 'system','suggestme');
        $suggestme = (($suggestme===false)? '0': $suggestme); // default if not set: 0
 
-       $browser_update = intval(get_pconfig(local_user(), 'system','update_interval'));
-       $browser_update = (($browser_update == 0) ? 40 : $browser_update / 1000); // default if not set: 40 seconds
+       $post_newfriend = get_pconfig(local_user(), 'system','post_newfriend');
+       $post_newfriend = (($post_newfriend===false)? '0': $post_newfriend); // default if not set: 0
+
+       $post_joingroup = get_pconfig(local_user(), 'system','post_joingroup');
+       $post_joingroup = (($post_joingroup===false)? '0': $post_joingroup); // default if not set: 0
+
+       $post_profilechange = get_pconfig(local_user(), 'system','post_profilechange');
+       $post_profilechange = (($post_profilechange===false)? '0': $post_profilechange); // default if not set: 0
 
-       $itemspage_network = intval(get_pconfig(local_user(), 'system','itemspage_network'));
-       $itemspage_network = (($itemspage_network > 0 && $itemspage_network < 101) ? $itemspage_network : 40); // default if not set: 40 items
        
        if(! strlen($a->user['timezone']))
                $timezone = date_default_timezone_get();
@@ -754,6 +891,14 @@ function settings_content(&$a) {
        ));
 
 
+       $unkmail = replace_macros($opt_tpl,array(
+                       '$field'        => array('unkmail',  t('Permit unknown people to send you private mail?'), $unkmail, '', array(t('No'),t('Yes'))),
+
+       ));
+
+
+
+
        $invisible = (((! $profile['publish']) && (! $profile['net-publish']))
                ? true : false);
 
@@ -761,33 +906,7 @@ function settings_content(&$a) {
                info( t('Profile is <strong>not published</strong>.') . EOL );
 
        
-       $default_theme = get_config('system','theme');
-       if(! $default_theme)
-               $default_theme = 'default';
-
-       $allowed_themes_str = get_config('system','allowed_themes');
-       $allowed_themes_raw = explode(',',$allowed_themes_str);
-       $allowed_themes = array();
-       if(count($allowed_themes_raw))
-               foreach($allowed_themes_raw as $x)
-                       if(strlen(trim($x)))
-                               $allowed_themes[] = trim($x);
 
-       
-       $themes = array();
-       $files = glob('view/theme/*');
-       if($allowed_themes) {
-               foreach($allowed_themes as $th) {
-                       $f = $th;
-                       $is_experimental = file_exists('view/theme/' . $th . '/experimental');
-                       $unsupported = file_exists('view/theme/' . $th . '/unsupported');
-                       if (!$is_experimental or ($is_experimental && (get_config('experimentals','exp_themes')==1 or get_config('experimentals','exp_themes')===false))){ 
-                               $theme_name = (($is_experimental) ?  sprintf("%s - \x28Experimental\x29", $f) : $f);
-                               $themes[$f]=$theme_name;
-                       }
-               }
-       }
-       $theme_selected = (!x($_SESSION,'theme')? $default_theme : $_SESSION['theme']);
 
 
        $subdir = ((strlen($a->get_path())) ? '<br />' . t('or') . ' ' . $a->get_baseurl(true) . '/profile/' . $nickname : '');
@@ -816,7 +935,6 @@ function settings_content(&$a) {
        );
 
        $o .= replace_macros($stpl,array(
-               '$tabs'         => $tabs,
                '$ptitle'       => t('Account Settings'),
 
                '$submit'       => t('Submit'),
@@ -838,9 +956,7 @@ function settings_content(&$a) {
                '$timezone' => array('timezone_select' , t('Your Timezone:'), select_timezone($timezone), ''),
                '$defloc'       => array('defloc', t('Default Post Location:'), $defloc, ''),
                '$allowloc' => array('allow_location', t('Use Browser Location:'), ($a->user['allow_location'] == 1), ''),
-               '$theme'        => array('theme', t('Display Theme:'), $theme_selected, '', $themes),
-               '$ajaxint'   => array('browser_update',  t("Update browser every xx seconds"), $browser_update, t('Minimum of 10 seconds, no maximum')),
-               '$itemspage_network'   => array('itemspage_network',  t("Number of items to display on the network page:"), $itemspage_network, t('Maximum of 100 items')),
+               
 
                '$h_prv'        => t('Security and Privacy Settings'),
 
@@ -858,10 +974,15 @@ function settings_content(&$a) {
                '$profile_in_net_dir' => $profile_in_net_dir,
                '$hide_friends' => $hide_friends,
                '$hide_wall' => $hide_wall,
-               
+               '$unkmail' => $unkmail,         
+               '$cntunkmail'   => array('cntunkmail', t('Maximum private messages per day from unknown people:'), $cntunkmail ,t("\x28to prevent spam abuse\x29")),
                
                
                '$h_not'        => t('Notification Settings'),
+               '$activity_options' => t('By default post a status message when:'),
+               '$post_newfriend' => array('post_newfriend',  t('accepting a friend request'), $post_newfriend, ''),
+               '$post_joingroup' => array('post_joingroup',  t('joining a forum/community'), $post_joingroup, ''),
+               '$post_profilechange' => array('post_profilechange',  t('making an <em>interesting</em> profile change'), $post_profilechange, ''),
                '$lbl_not'      => t('Send a notification email when:'),
                '$notify1'      => array('notify1', t('You receive an introduction'), ($notify & NOTIFY_INTRO), NOTIFY_INTRO, ''),
                '$notify2'      => array('notify2', t('Your introductions are confirmed'), ($notify & NOTIFY_CONFIRM), NOTIFY_CONFIRM, ''),