Location: PHPKode > projects > Gnew > Gnew-2013.1/admin/settings.php
<?php
// -----------------------------------------------------------------------------
// $Id: settings.php 682 2013-03-28 14:17:41Z raoul $
//
// Copyright (C) 2013 Raoul Proença
// License: GNU GPL version 3 (see copying.txt file)
// Website: http://www.gnew.fr/
// -----------------------------------------------------------------------------
// This program is free software: you can redistribute it and/or modify it under
// the terms of the GNU General Public License as published by the Free Software
// Foundation, either version 3 of the License, or (at your option) any later
// version.
//
// This program is distributed in the hope that it will be useful, but WITHOUT
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
// details.
//
// You should have received a copy of the GNU General Public License along with
// this program. If not, see <http://www.gnu.org/licenses/>.
// -----------------------------------------------------------------------------

include('./../includes/common.php');

page_header($lang['ADMIN_SETTINGS']);

// Administrator?
if ($users['user_level'] < 4)
{
    error_template($lang['ERROR_LEVEL_ACCESS']);
}
else
{
    // Edit?
    if (isset($_POST['edit_advanced_settings']))
    {
        $error = '';
        if (!trim($_POST['date_format']))
        {
            $error .= $lang['ERROR_NO_DATE_FORMAT'];
        }
        if (!preg_match('`^-?[0-9]{1,2}$`', $_POST['date_offset']))
        {
            $error .= $lang['ERROR_NO_DATE_OFFSET'];
        }
        if (!trim($_POST['sender_email']))
        {
            $error .= $lang['ERROR_NO_EMAIL'];
        }
        else
        {
            if (check_email($_POST['sender_email']))
            {
                $sender_email = $_POST['sender_email'];
            }
            else
            {
                $error .= $lang['ERROR_INVALID_USER_EMAIL'];
            }
        }
        if (!trim($_POST['sender_name']))
        {
            $error .= $lang['ERROR_NO_USERNAME'];
        }
        if (!trim($_POST['site_name']))
        {
            $error .= $lang['ERROR_NO_SITE_NAME'];
        }
        if (!trim($_POST['site_url']))
        {
            $error .= $lang['ERROR_NO_SITE_URL'];
        }
        if ($error)
        {
            error_template($error);
        }
        else
        {
            if (!preg_match('`^[0-9]{1,3}$`', $_POST['accounts_expiry']))
            {
                $_POST['accounts_expiry'] = 30;
            }
            if (!preg_match('`^[0-9]{1,2}$`', $_POST['articles_per_page']))
            {
                $_POST['articles_per_page'] = 20;
            }
            if (!preg_match('`^[0-9]{1,2}$`', $_POST['categories_per_page']))
            {
                $_POST['categories_per_page'] = 20;
            }
            if (!preg_match('`^[0-9]{1,2}$`', $_POST['comments_interval']))
            {
                $_POST['comments_interval'] = 30;
            }
            if (!preg_match('`^[0-9]{1,2}$`', $_POST['comments_per_page']))
            {
                $_POST['comments_per_page'] = 20;
            }
            if (!preg_match('`^[0-9]{1,3}$`', $_POST['cookies_expiry']))
            {
                $_POST['cookies_expiry'] = 30;
            }
            if (!preg_match('`^[0-9]{1,2}$`', $_POST['headlines_per_feed']))
            {
                $_POST['headlines_per_feed'] = 10;
            }
            if (!preg_match('`^[0-9]{1,3}$`', $_POST['max_avatars_pixels']))
            {
                $_POST['max_avatars_pixels'] = 64;
            }
            if (!preg_match('`^[0-9]{1,2}$`', $_POST['max_submissions_per_user']))
            {
                $_POST['max_submissions_per_user'] = 3;
            }
            if (!preg_match('`^[0-9]{1,5}$`', $_POST['max_texts_length']))
            {
                $_POST['max_texts_length'] = 1000;
            }
            if (!preg_match('`^[0-9]{1,2}$`', $_POST['min_passwords_length']))
            {
                $_POST['min_passwords_length'] = 6;
            }
            if (!preg_match('`^[0-9]{1,2}$`', $_POST['min_usernames_length']))
            {
                $_POST['min_usernames_length'] = 3;
            }
            if (!preg_match('`^[0-9]{1,2}$`', $_POST['news_per_page']))
            {
                $_POST['news_per_page'] = 10;
            }
            if (!preg_match('`^[0-9]{1,2}$`', $_POST['pages_limit']))
            {
                $_POST['pages_limit'] = 10;
            }
            if (!preg_match('`^[0-9]{1,2}$`', $_POST['posts_interval']))
            {
                $_POST['posts_interval'] = 30;
            }
            if (!preg_match('`^[0-9]{1,2}$`', $_POST['posts_per_page']))
            {
                $_POST['posts_per_page'] = 20;
            }
            if (!preg_match('`^[0-9]{1,2}$`', $_POST['questions_per_page']))
            {
                $_POST['questions_per_page'] = 20;
            }
            if (!preg_match('`^[0-9]{1,2}$`', $_POST['search_limit']))
            {
                $_POST['search_limit'] = 20;
            }
            if (!preg_match('`^[0-9]{1,3}$`', $_POST['stories_expiry']))
            {
                $_POST['stories_expiry'] = 730;
            }
            if (!preg_match('`^[0-9]{1,2}$`', $_POST['stories_per_page']))
            {
                $_POST['stories_per_page'] = 10;
            }
            if (!preg_match('`^[0-9]{1,3}$`', $_POST['threads_expiry']))
            {
                $_POST['threads_expiry'] = 730;
            }
            if (!preg_match('`^[0-9]{1,2}$`', $_POST['threads_per_page']))
            {
                $_POST['threads_per_page'] = 20;
            }
            if (!preg_match('`^[0-9]{1,2}$`', $_POST['users_per_page']))
            {
                $_POST['users_per_page'] = 20;
            }
            if (!preg_match('`^[0-9]{1,3}$`', $_POST['votes_interval']))
            {
                $_POST['votes_interval'] = 30;
            }
            $sql->query('UPDATE ' . TABLE_SETTINGS . '
                         SET accounts_expiry = \'' . $_POST['accounts_expiry'] . '\', allow_emoticons = \'' . $_POST['allow_emoticons'] . '\', allow_html = \'' . $_POST['allow_html'] . '\', articles_order = \'' . $_POST['articles_order'] . '\', articles_per_page = \'' . $_POST['articles_per_page'] . '\', articles_sorting = \'' . $_POST['articles_sorting'] . '\', categories_order = \'' . $_POST['categories_order'] . '\', categories_per_page = \'' . $_POST['categories_per_page'] . '\', categories_sorting = \'' . $_POST['categories_sorting'] . '\', comments_interval = \'' . $_POST['comments_interval'] . '\', comments_order = \'' . $_POST['comments_order'] . '\', comments_per_page = \'' . $_POST['comments_per_page'] . '\', comments_sorting = \'' . $_POST['comments_sorting'] . '\', cookies_expiry = \'' . $_POST['cookies_expiry'] . '\', date_format = \'' . utf8_entities($_POST['date_format']) . '\', date_offset = \'' . $_POST['date_offset'] . '\', headlines_per_feed = \'' . $_POST['headlines_per_feed'] . '\', language = \'' . $_POST['language'] . '\', language_unique = \'' . $_POST['language_unique'] . '\', max_avatars_pixels = \'' . $_POST['max_avatars_pixels'] . '\', max_submissions_per_user = \'' . $_POST['max_submissions_per_user'] . '\', max_texts_length = \'' . $_POST['max_texts_length'] . '\', min_passwords_length = \'' . $_POST['min_passwords_length'] . '\', min_usernames_length = \'' . $_POST['min_usernames_length'] . '\', news_commenting = \'' . $_POST['news_commenting'] . '\', news_order = \'' . $_POST['news_order'] . '\', news_per_page = \'' . $_POST['news_per_page'] . '\', news_sending = \'' . $_POST['news_sending'] . '\', news_sorting = \'' . $_POST['news_sorting'] . '\', news_submitting = \'' . $_POST['news_submitting'] . '\', pages_limit = \'' . $_POST['pages_limit'] . '\', posts_interval = \'' . $_POST['posts_interval'] . '\', posts_order = \'' . $_POST['posts_order'] . '\', posts_per_page = \'' . $_POST['posts_per_page'] . '\', posts_sorting = \'' . $_POST['posts_sorting'] . '\', questions_order = \'' . $_POST['questions_order'] . '\', questions_per_page = \'' . $_POST['questions_per_page'] . '\', questions_sorting = \'' . $_POST['questions_sorting'] . '\', search_limit = \'' . $_POST['search_limit'] . '\', sender_email = \'' . $sender_email . '\', sender_name = \'' . utf8_entities($_POST['sender_name']) . '\', site_name = \'' . utf8_entities($_POST['site_name']) . '\', site_url = \'' . rtrim(utf8_entities($_POST['site_url']), ' /') . '\', stories_expiry = \'' . $_POST['stories_expiry'] . '\', stories_per_page = \'' . $_POST['stories_per_page'] . '\', template = \'' . $_POST['template'] . '\', template_unique = \'' . $_POST['template_unique'] . '\', threads_expiry = \'' . $_POST['threads_expiry'] . '\', threads_per_page = \'' . $_POST['threads_per_page'] . '\', users_order = \'' . $_POST['users_order'] . '\', users_per_page = \'' . $_POST['users_per_page'] . '\', users_registering = \'' . $_POST['users_registering'] . '\', users_sorting = \'' . $_POST['users_sorting'] . '\', votes_interval = \'' . $_POST['votes_interval'] . '\'');
            make_articles_feed();
            make_comments_feed();
            make_news_feed();
            make_polls_feed();
            make_posts_feed();
            $GLOBALS['cache']->clean(TABLE_SETTINGS);
            success_template($lang['SETTINGS_EDITED'], './../admin/advanced.php');
        }
    }
    // Edit form
    else
    {
        if ($settings['allow_emoticons'])
        {
            $allow_emoticons_options = '<option value="0">' . $lang['NO'] . '</option><option value="1" selected="selected">' . $lang['YES'] . '</option>';
        }
        else
        {
            $allow_emoticons_options = '<option value="0" selected="selected">' . $lang['NO'] . '</option><option value="1">' . $lang['YES'] . '</option>';
        }

        if ($settings['allow_html'])
        {
            $allow_html_options = '<option value="0">' . $lang['NO'] . '</option><option value="1" selected="selected">' . $lang['YES'] . '</option>';
        }
        else
        {
            $allow_html_options = '<option value="0" selected="selected">' . $lang['NO'] . '</option><option value="1">' . $lang['YES'] . '</option>';
        }

        if ($settings['articles_order'] == 'ASC')
        {
            $articles_order_options = '<option value="ASC" selected="selected">' . $lang['ASCENDING'] . '</option><option value="DESC">' . $lang['DESCENDING'] . '</option>';
        }
        else
        {
            $articles_order_options = '<option value="ASC">' . $lang['ASCENDING'] . '</option><option value="DESC" selected="selected">' . $lang['DESCENDING'] . '</option>';
        }

        if ($settings['articles_sorting'] == 'article_creation')
        {
            $articles_sorting_options = '<option value="article_creation" selected="selected">' . $lang['CREATIONS'] . '</option><option value="article_edition">' . $lang['EDITIONS'] . '</option><option value="article_subject">' . $lang['SUBJECTS'] . '</option>';
        }
        elseif ($settings['articles_sorting'] == 'article_edition')
        {
            $articles_sorting_options = '<option value="article_creation">' . $lang['CREATIONS'] . '</option><option value="article_edition" selected="selected">' . $lang['EDITIONS'] . '</option><option value="article_subject">' . $lang['SUBJECTS'] . '</option>';
        }
        else
        {
            $articles_sorting_options = '<option value="article_creation">' . $lang['CREATIONS'] . '</option><option value="article_edition">' . $lang['EDITIONS'] . '</option><option value="article_subject" selected="selected">' . $lang['SUBJECTS'] . '</option>';
        }

        if ($settings['categories_order'] == 'ASC')
        {
            $categories_order_options = '<option value="ASC" selected="selected">' . $lang['ASCENDING'] . '</option><option value="DESC">' . $lang['DESCENDING'] . '</option>';
        }
        else
        {
            $categories_order_options = '<option value="ASC">' . $lang['ASCENDING'] . '</option><option value="DESC" selected="selected">' . $lang['DESCENDING'] . '</option>';
        }

        if ($settings['categories_sorting'] == 'category_creation')
        {
            $categories_sorting_options = '<option value="category_creation" selected="selected">' . $lang['CREATIONS'] . '</option><option value="category_edition">' . $lang['EDITIONS'] . '</option><option value="category_name">' . $lang['NAMES'] . '</option>';
        }
        elseif ($settings['categories_sorting'] == 'category_edition')
        {
            $categories_sorting_options = '<option value="category_creation">' . $lang['CREATIONS'] . '</option><option value="category_edition" selected="selected">' . $lang['EDITIONS'] . '</option><option value="category_name">' . $lang['NAMES'] . '</option>';
        }
        else
        {
            $categories_sorting_options = '<option value="category_creation">' . $lang['CREATIONS'] . '</option><option value="category_edition">' . $lang['EDITIONS'] . '</option><option value="category_name" selected="selected">' . $lang['NAMES'] . '</option>';
        }

        if ($settings['comments_order'] == 'ASC')
        {
            $comments_order_options = '<option value="ASC" selected="selected">' . $lang['ASCENDING'] . '</option><option value="DESC">' . $lang['DESCENDING'] . '</option>';
        }
        else
        {
            $comments_order_options = '<option value="ASC">' . $lang['ASCENDING'] . '</option><option value="DESC" selected="selected">' . $lang['DESCENDING'] . '</option>';
        }

        if ($settings['comments_sorting'] == 'comment_creation')
        {
            $comments_sorting_options = '<option value="comment_creation" selected="selected">' . $lang['CREATIONS'] . '</option><option value="comment_edition">' . $lang['EDITIONS'] . '</option><option value="comment_subject">' . $lang['SUBJECTS'] . '</option>';
        }
        elseif ($settings['comments_sorting'] == 'comment_edition')
        {
            $comments_sorting_options = '<option value="comment_creation">' . $lang['CREATIONS'] . '</option><option value="comment_edition" selected="selected">' . $lang['EDITIONS'] . '</option><option value="comment_subject">' . $lang['SUBJECTS'] . '</option>';
        }
        else
        {
            $comments_sorting_options = '<option value="comment_creation">' . $lang['CREATIONS'] . '</option><option value="comment_edition">' . $lang['EDITIONS'] . '</option><option value="comment_subject" selected="selected">' . $lang['SUBJECTS'] . '</option>';
        }

        $languages = get_languages_list();
        $language_options = '';
        $num_languages = count($languages);
        for ($i = 0; $i < $num_languages; $i++)
        {
            if ($languages[$i] != $settings['language'])
            {
                $language_options .= '<option value="' . $languages[$i] . '">' . $lang['' . strtoupper($languages[$i]) . ''] . '</option>';
            }
            else
            {
                $language_options .= '<option value="' . $languages[$i] . '" selected="selected">' . $lang['' . strtoupper($languages[$i]) . ''] . '</option>';
            }
        }

        if ($settings['language_unique'])
        {
            $language_unique_options = '<option value="0"></option><option value="1" selected="selected">' . $lang['ONLY'] . '</option>';
        }
        else
        {
            $language_unique_options = '<option value="0" selected="selected"></option><option value="1">' . $lang['ONLY'] . '</option>';
        }

        if ($settings['news_commenting'])
        {
            $news_commenting_options = '<option value="0">' . $lang['NO'] . '</option><option value="1" selected="selected">' . $lang['YES'] . '</option>';
        }
        else
        {
            $news_commenting_options = '<option value="0" selected="selected">' . $lang['NO'] . '</option><option value="1">' . $lang['YES'] . '</option>';
        }

        if ($settings['news_order'] == 'ASC')
        {
            $news_order_options = '<option value="ASC" selected="selected">' . $lang['ASCENDING'] . '</option><option value="DESC">' . $lang['DESCENDING'] . '</option>';
        }
        else
        {
            $news_order_options = '<option value="ASC">' . $lang['ASCENDING'] . '</option><option value="DESC" selected="selected">' . $lang['DESCENDING'] . '</option>';
        }

        if ($settings['news_sending'])
        {
            $news_sending_options = '<option value="0">' . $lang['NO'] . '</option><option value="1" selected="selected">' . $lang['YES'] . '</option>';
        }
        else
        {
            $news_sending_options = '<option value="0" selected="selected">' . $lang['NO'] . '</option><option value="1">' . $lang['YES'] . '</option>';
        }

        if ($settings['news_sorting'] == 'news_creation')
        {
            $news_sorting_options = '<option value="news_creation" selected="selected">' . $lang['CREATIONS'] . '</option><option value="news_edition">' . $lang['EDITIONS'] . '</option><option value="news_subject">' . $lang['SUBJECTS'] . '</option>';
        }
        elseif ($settings['news_sorting'] == 'news_edition')
        {
            $news_sorting_options = '<option value="news_creation">' . $lang['CREATIONS'] . '</option><option value="news_edition" selected="selected">' . $lang['EDITIONS'] . '</option><option value="news_subject">' . $lang['SUBJECTS'] . '</option>';
        }
        else
        {
            $news_sorting_options = '<option value="news_creation">' . $lang['CREATIONS'] . '</option><option value="news_edition">' . $lang['EDITIONS'] . '</option><option value="news_subject" selected="selected">' . $lang['SUBJECTS'] . '</option>';
        }

        if ($settings['news_submitting'])
        {
            $news_submitting_options = '<option value="0">' . $lang['NO'] . '</option><option value="1" selected="selected">' . $lang['YES'] . '</option>';
        }
        else
        {
            $news_submitting_options = '<option value="0" selected="selected">' . $lang['NO'] . '</option><option value="1">' . $lang['YES'] . '</option>';
        }

        if ($settings['posts_order'] == 'ASC')
        {
            $posts_order_options = '<option value="ASC" selected="selected">' . $lang['ASCENDING'] . '</option><option value="DESC">' . $lang['DESCENDING'] . '</option>';
        }
        else
        {
            $posts_order_options = '<option value="ASC">' . $lang['ASCENDING'] . '</option><option value="DESC" selected="selected">' . $lang['DESCENDING'] . '</option>';
        }

        if ($settings['posts_sorting'] == 'post_creation')
        {
            $posts_sorting_options = '<option value="post_creation" selected="selected">' . $lang['CREATIONS'] . '</option><option value="post_edition">' . $lang['EDITIONS'] . '</option>';
        }
        else
        {
            $posts_sorting_options = '<option value="post_creation">' . $lang['CREATIONS'] . '</option><option value="post_edition" selected="selected">' . $lang['EDITIONS'] . '</option>';
        }

        if ($settings['questions_order'] == 'ASC')
        {
            $questions_order_options = '<option value="ASC" selected="selected">' . $lang['ASCENDING'] . '</option><option value="DESC">' . $lang['DESCENDING'] . '</option>';
        }
        else
        {
            $questions_order_options = '<option value="ASC">' . $lang['ASCENDING'] . '</option><option value="DESC" selected="selected">' . $lang['DESCENDING'] . '</option>';
        }

        if ($settings['questions_sorting'] == 'question_creation')
        {
            $questions_sorting_options = '<option value="question_creation" selected="selected">' . $lang['CREATIONS'] . '</option><option value="question_edition">' . $lang['EDITIONS'] . '</option><option value="question_text">' . $lang['TEXTS'] . '</option>';
        }
        elseif ($settings['questions_sorting'] == 'question_edition')
        {
            $questions_sorting_options = '<option value="question_creation">' . $lang['CREATIONS'] . '</option><option value="question_edition" selected="selected">' . $lang['EDITIONS'] . '</option><option value="question_text">' . $lang['TEXTS'] . '</option>';
        }
        else
        {
            $questions_sorting_options = '<option value="question_creation">' . $lang['CREATIONS'] . '</option><option value="question_edition">' . $lang['EDITIONS'] . '</option><option value="question_text" selected="selected">' . $lang['TEXTS'] . '</option>';
        }

        $templates = get_templates_list();
        $template_options = '';
        $num_templates = count($templates);
        for ($i = 0; $i < $num_templates; $i++)
        {
            if ($templates[$i] != $settings['template'])
            {
                $template_options .= '<option value="' . $templates[$i] . '">' . $templates[$i] . '</option>';
            }
            else
            {
                $template_options .= '<option value="' . $templates[$i] . '" selected="selected">' . $templates[$i] . '</option>';
            }
        }

        if ($settings['template_unique'])
        {
            $template_unique_options = '<option value="0"></option><option value="1" selected="selected">' . $lang['ONLY'] . '</option>';
        }
        else
        {
            $template_unique_options = '<option value="0" selected="selected"></option><option value="1">' . $lang['ONLY'] . '</option>';
        }

        if ($settings['users_order'] == 'ASC')
        {
            $users_order_options = '<option value="ASC" selected="selected">' . $lang['ASCENDING'] . '</option><option value="DESC">' . $lang['DESCENDING'] . '</option>';
        }
        else
        {
            $users_order_options = '<option value="ASC">' . $lang['ASCENDING'] . '</option><option value="DESC" selected="selected">' . $lang['DESCENDING'] . '</option>';
        }

        if ($settings['users_registering'])
        {
            $users_registering_options = '<option value="0">' . $lang['NO'] . '</option><option value="1" selected="selected">' . $lang['YES'] . '</option>';
        }
        else
        {
            $users_registering_options = '<option value="0" selected="selected">' . $lang['NO'] . '</option><option value="1">' . $lang['YES'] . '</option>';
        }

        if ($settings['users_sorting'] == 'user_creation')
        {
            $users_sorting_options = '<option value="user_creation" selected="selected">' . $lang['CREATIONS'] . '</option><option value="user_edition">' . $lang['EDITIONS'] . '</option><option value="user_name">' . $lang['NAMES'] . '</option>';
        }
        elseif ($settings['users_sorting'] == 'user_edition')
        {
            $users_sorting_options = '<option value="user_creation">' . $lang['CREATIONS'] . '</option><option value="user_edition" selected="selected">' . $lang['EDITIONS'] . '</option><option value="user_name">' . $lang['NAMES'] . '</option>';
        }
        else
        {
            $users_sorting_options = '<option value="user_creation">' . $lang['CREATIONS'] . '</option><option value="user_edition">' . $lang['EDITIONS'] . '</option><option value="user_name" selected="selected">' . $lang['NAMES'] . '</option>';
        }

        $template->set_file('admin', 'admin/settings/edit.htpl');
        $template->set_var(array('ACCOUNTS_EXPIRY' => $settings['accounts_expiry'],
                                 'ALLOW_EMOTICONS_OPTIONS' => $allow_emoticons_options,
                                 'ALLOW_HTML_OPTIONS' => $allow_html_options,
                                 'ARTICLES_ORDER_OPTIONS' => $articles_order_options,
                                 'ARTICLES_PER_PAGE' => $settings['articles_per_page'],
                                 'ARTICLES_SORTING_OPTIONS' => $articles_sorting_options,
                                 'CATEGORIES_ORDER_OPTIONS' => $categories_order_options,
                                 'CATEGORIES_PER_PAGE' => $settings['categories_per_page'],
                                 'CATEGORIES_SORTING_OPTIONS' => $categories_sorting_options,
                                 'COMMENTS_INTERVAL' => $settings['comments_interval'],
                                 'COMMENTS_ORDER_OPTIONS' => $comments_order_options,
                                 'COMMENTS_PER_PAGE' => $settings['comments_per_page'],
                                 'COMMENTS_SORTING_OPTIONS' => $comments_sorting_options,
                                 'COOKIES_EXPIRY' => $settings['cookies_expiry'],
                                 'DATE_FORMAT' => $settings['date_format'],
                                 'DATE_OFFSET' => $settings['date_offset'],
                                 'HEADLINES_PER_FEED' => $settings['headlines_per_feed'],
                                 'LANGUAGE_OPTIONS' => $language_options,
                                 'LANGUAGE_UNIQUE_OPTIONS' => $language_unique_options,
                                 'MAX_AVATARS_PIXELS' => $settings['max_avatars_pixels'],
                                 'MAX_SUBMISSIONS_PER_USER' => $settings['max_submissions_per_user'],
                                 'MAX_TEXTS_LENGTH' => $settings['max_texts_length'],
                                 'MIN_PASSWORDS_LENGTH' => $settings['min_passwords_length'],
                                 'MIN_USERNAMES_LENGTH' => $settings['min_usernames_length'],
                                 'NEWS_COMMENTING_OPTIONS' => $news_commenting_options,
                                 'NEWS_ORDER_OPTIONS' => $news_order_options,
                                 'NEWS_PER_PAGE' => $settings['news_per_page'],
                                 'NEWS_SENDING_OPTIONS' => $news_sending_options,
                                 'NEWS_SORTING_OPTIONS' => $news_sorting_options,
                                 'NEWS_SUBMITTING_OPTIONS' => $news_submitting_options,
                                 'PAGES_LIMIT' => $settings['pages_limit'],
                                 'POSTS_INTERVAL' => $settings['posts_interval'],
                                 'POSTS_ORDER_OPTIONS' => $posts_order_options,
                                 'POSTS_PER_PAGE' => $settings['posts_per_page'],
                                 'POSTS_SORTING_OPTIONS' => $posts_sorting_options,
                                 'QUESTIONS_ORDER_OPTIONS' => $questions_order_options,
                                 'QUESTIONS_PER_PAGE' => $settings['questions_per_page'],
                                 'QUESTIONS_SORTING_OPTIONS' => $questions_sorting_options,
                                 'SEARCH_LIMIT' => $settings['search_limit'],
                                 'SENDER_EMAIL' => $settings['sender_email'],
                                 'SENDER_NAME' => $settings['sender_name'],
                                 'SITE_NAME' => $settings['site_name'],
                                 'SITE_URL' => $settings['site_url'],
                                 'STORIES_EXPIRY' => $settings['stories_expiry'],
                                 'STORIES_PER_PAGE' => $settings['stories_per_page'],
                                 'TEMPLATE_OPTIONS' => $template_options,
                                 'TEMPLATE_UNIQUE_OPTIONS' => $template_unique_options,
                                 'THREADS_EXPIRY' => $settings['threads_expiry'],
                                 'THREADS_PER_PAGE' => $settings['threads_per_page'],
                                 'USERS_ORDER_OPTIONS' => $users_order_options,
                                 'USERS_PER_PAGE' => $settings['users_per_page'],
                                 'USERS_REGISTERING_OPTIONS' => $users_registering_options,
                                 'USERS_SORTING_OPTIONS' => $users_sorting_options,
                                 'VOTES_INTERVAL' => $settings['votes_interval']));
        $template->parse('admin');
    }
}

page_footer();

?>
Return current item: Gnew