]> git.mxchange.org Git - friendica.git/blobdiff - mod/admin.php
Update the `thr-parent` field in the `item` table
[friendica.git] / mod / admin.php
index 2810c8a8ab47c6be902d9a5f4f537ca7181955a6..1752b3fe8fd8f6291a0935df5c44f98fdfc24ef3 100644 (file)
@@ -98,7 +98,7 @@ function admin_content(&$a) {
                'plugins'=>     Array($a->get_baseurl(true)."/admin/plugins/", t("Plugins") , "plugins"),
                'themes' =>     Array($a->get_baseurl(true)."/admin/themes/", t("Themes") , "themes"),
                'dbsync' => Array($a->get_baseurl(true)."/admin/dbsync/", t('DB updates'), "dbsync"),
-               'update' =>     Array($a->get_baseurl(true)."/admin/update/", t("Software Update") , "update")
+               //'update' =>   Array($a->get_baseurl(true)."/admin/update/", t("Software Update") , "update")
        );
        
        /* get plugins admin page */
@@ -115,8 +115,11 @@ function admin_content(&$a) {
        $aside['logs'] = Array($a->get_baseurl(true)."/admin/logs/", t("Logs"), "logs");
 
        $t = get_markup_template("admin_aside.tpl");
-       $a->page['aside'] = replace_macros( $t, array(
+       $a->page['aside'] .= replace_macros( $t, array(
                        '$admin' => $aside, 
+                       '$admtxt' => t('Admin'),
+                       '$plugadmtxt' => t('Plugin Features'),
+                       '$logtxt' => t('Logs'),
                        '$h_pending' => t('User registrations waiting for confirmation'),
                        '$admurl'=> $a->get_baseurl(true)."/admin/"
        ));
@@ -180,20 +183,35 @@ function admin_page_summary(&$a) {
                Array( t('Normal Account'), 0),
                Array( t('Soapbox Account'), 0),
                Array( t('Community/Celebrity Account'), 0),
-               Array( t('Automatic Friend Account'), 0)
+               Array( t('Automatic Friend Account'), 0),
+               Array( t('Blog Account'), 0),
+               Array( t('Private Forum'), 0)
        );
+
        $users=0;
        foreach ($r as $u){ $accounts[$u['page-flags']][1] = $u['count']; $users+= $u['count']; }
 
-       logger('accounts: ' . print_r($accounts,true));
+       logger('accounts: ' . print_r($accounts,true),LOGGER_DATA);
 
        $r = q("SELECT COUNT(id) as `count` FROM `register`");
        $pending = $r[0]['count'];
                
+       $r = q("select count(*) as total from deliverq where 1");
+       $deliverq = (($r) ? $r[0]['total'] : 0);
+
+       $r = q("select count(*) as total from queue where 1");
+       $queue = (($r) ? $r[0]['total'] : 0);
+
+       // We can do better, but this is a quick queue status
+
+       $queues = array( 'label' => t('Message queues'), 'deliverq' => $deliverq, 'queue' => $queue );
+
+
        $t = get_markup_template("admin_summary.tpl");
        return replace_macros($t, array(
                '$title' => t('Administration'),
                '$page' => t('Summary'),
+               '$queues' => $queues,
                '$users' => Array( t('Registered users'), $users),
                '$accounts' => $accounts,
                '$pending' => Array( t('Pending registrations'), $pending),
@@ -232,6 +250,7 @@ function admin_page_site_post(&$a){
        $block_public           =       ((x($_POST,'block_public'))             ? True  :       False);
        $force_publish          =       ((x($_POST,'publish_all'))              ? True  :       False);
        $global_directory       =       ((x($_POST,'directory_submit_url'))     ? notags(trim($_POST['directory_submit_url']))  : '');
+       $thread_allow           =       ((x($_POST,'thread_allow'))             ? True  :       False);
        $no_multi_reg           =       ((x($_POST,'no_multi_reg'))             ? True  :       False);
        $no_openid                      =       !((x($_POST,'no_openid'))               ? True  :       False);
        $no_regfullname         =       !((x($_POST,'no_regfullname'))  ? True  :       False);
@@ -324,6 +343,7 @@ function admin_page_site_post(&$a){
        } else {
                set_config('system','directory_submit_url', $global_directory);
        }
+       set_config('system','thread_allow', $thread_allow);
 
        set_config('system','block_extended_register', $no_multi_reg);
        set_config('system','no_openid', $no_openid);
@@ -417,13 +437,14 @@ function admin_page_site(&$a) {
                '$maximagesize'         => array('maximagesize', t("Maximum image size"), get_config('system','maximagesize'), t("Maximum size in bytes of uploaded images. Default is 0, which means no limits.")),
 
                '$register_policy'      => array('register_policy', t("Register policy"), $a->config['register_policy'], "", $register_choices),
-               '$register_text'        => array('register_text', t("Register text"), htmlentities($a->config['register_text'], ENT_QUOTES), t("Will be displayed prominently on the registration page.")),
+               '$register_text'        => array('register_text', t("Register text"), htmlentities($a->config['register_text'], ENT_QUOTES, 'UTF-8'), t("Will be displayed prominently on the registration page.")),
                '$abandon_days'     => array('abandon_days', t('Accounts abandoned after x days'), get_config('system','account_abandon_days'), t('Will not waste system resources polling external sites for abandonded accounts. Enter 0 for no time limit.')),
                '$allowed_sites'        => array('allowed_sites', t("Allowed friend domains"), get_config('system','allowed_sites'), t("Comma separated list of domains which are allowed to establish friendships with this site. Wildcards are accepted. Empty to allow any domains")),
                '$allowed_email'        => array('allowed_email', t("Allowed email domains"), get_config('system','allowed_email'), t("Comma separated list of domains which are allowed in email addresses for registrations to this site. Wildcards are accepted. Empty to allow any domains")),
                '$block_public'         => array('block_public', t("Block public"), get_config('system','block_public'), t("Check to block public access to all otherwise public personal pages on this site unless you are currently logged in.")),
                '$force_publish'        => array('publish_all', t("Force publish"), get_config('system','publish_all'), t("Check to force all profiles on this site to be listed in the site directory.")),
                '$global_directory'     => array('directory_submit_url', t("Global directory update URL"), get_config('system','directory_submit_url'), t("URL to update the global directory. If this is not set, the global directory is completely unavailable to the application.")),
+               '$thread_allow'         => array('thread_allow', t("Allow threaded items"), get_config('system','thread_allow'), t("Allow infinite level threading for items on this site.")),
                        
                '$no_multi_reg'         => array('no_multi_reg', t("Block multiple registrations"),  get_config('system','block_extended_register'), t("Disallow users to register additional accounts for use as pages.")),
                '$no_openid'            => array('no_openid', t("OpenID support"), !get_config('system','no_openid'), t("OpenID support for registration and logins.")),
@@ -453,6 +474,9 @@ function admin_page_dbsync(&$a) {
 
        if($a->argc > 3 && intval($a->argv[3]) && $a->argv[2] === 'mark') {
                set_config('database', 'update_' . intval($a->argv[3]), 'success');
+               $curr = get_config('system','build');
+               if(intval($curr) == intval($a->argv[3]))
+                       set_config('system','build',intval($curr) + 1);
                info( t('Update has been marked successful') . EOL);
                goaway($a->get_baseurl(true) . '/admin/dbsync');
        }