Ignore:
Timestamp:
Mar 31, 2010, 6:32:40 PM (14 years ago)
Author:
george
Message:
  • Upraveno: Aktualizace fóra.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/forum/includes/acp/acp_board.php

    r400 r702  
    33*
    44* @package acp
    5 * @version $Id: acp_board.php 8911 2008-09-23 13:03:33Z acydburn $
     5* @version $Id$
    66* @copyright (c) 2005 phpBB Group
    77* @license http://opensource.org/licenses/gpl-license.php GNU Public License
     
    3030                global $db, $user, $auth, $template;
    3131                global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx;
     32                global $cache;
    3233
    3334                $user->add_lang('acp/board');
    3435
    3536                $action = request_var('action', '');
    36                 $submit = (isset($_POST['submit'])) ? true : false;
     37                $submit = (isset($_POST['submit']) || isset($_POST['allow_quick_reply_enable'])) ? true : false;
    3738
    3839                $form_key = 'acp_board';
     
    6566                                                'legend2'                               => 'WARNINGS',
    6667                                                'warnings_expire_days'  => array('lang' => 'WARNINGS_EXPIRE',           'validate' => 'int',    'type' => 'text:3:4', 'explain' => true, 'append' => ' ' . $user->lang['DAYS']),
     68
     69                                                'legend3'                                       => 'ACP_SUBMIT_CHANGES',
    6770                                        )
    6871                                );
     
    8083                                                'allow_attachments'             => array('lang' => 'ALLOW_ATTACHMENTS',         'validate' => 'bool',   'type' => 'radio:yes_no', 'explain' => false),
    8184                                                'allow_pm_attach'               => array('lang' => 'ALLOW_PM_ATTACHMENTS',      'validate' => 'bool',   'type' => 'radio:yes_no', 'explain' => false),
     85                                                'allow_pm_report'               => array('lang' => 'ALLOW_PM_REPORT',           'validate' => 'bool',   'type' => 'radio:yes_no', 'explain' => true),
    8286                                                'allow_bbcode'                  => array('lang' => 'ALLOW_BBCODE',                      'validate' => 'bool',   'type' => 'radio:yes_no', 'explain' => false),
    8387                                                'allow_smilies'                 => array('lang' => 'ALLOW_SMILIES',                     'validate' => 'bool',   'type' => 'radio:yes_no', 'explain' => false),
     
    8690                                                'allow_bookmarks'               => array('lang' => 'ALLOW_BOOKMARKS',           'validate' => 'bool',   'type' => 'radio:yes_no', 'explain' => true),
    8791                                                'allow_birthdays'               => array('lang' => 'ALLOW_BIRTHDAYS',           'validate' => 'bool',   'type' => 'radio:yes_no', 'explain' => true),
     92                                                'allow_quick_reply'             => array('lang' => 'ALLOW_QUICK_REPLY',         'validate' => 'bool',   'type' => 'custom', 'method' => 'quick_reply', 'explain' => true),
    8893
    8994                                                'legend2'                               => 'ACP_LOAD_SETTINGS',
     
    9499                                                'load_cpf_viewprofile'  => array('lang' => 'LOAD_CPF_VIEWPROFILE',      'validate' => 'bool',   'type' => 'radio:yes_no', 'explain' => false),
    95100                                                'load_cpf_viewtopic'    => array('lang' => 'LOAD_CPF_VIEWTOPIC',        'validate' => 'bool',   'type' => 'radio:yes_no', 'explain' => false),
     101
     102                                                'legend3'                                       => 'ACP_SUBMIT_CHANGES',
    96103                                        )
    97104                                );
     
    109116                                                'avatar_max_height'             => array('lang' => 'MAX_AVATAR_SIZE', 'validate' => 'int:0', 'type' => false, 'method' => false, 'explain' => false,),
    110117
     118                                                'allow_avatar'                  => array('lang' => 'ALLOW_AVATARS',                     'validate' => 'bool',   'type' => 'radio:yes_no', 'explain' => true),
    111119                                                'allow_avatar_local'    => array('lang' => 'ALLOW_LOCAL',                       'validate' => 'bool',   'type' => 'radio:yes_no', 'explain' => false),
    112120                                                'allow_avatar_remote'   => array('lang' => 'ALLOW_REMOTE',                      'validate' => 'bool',   'type' => 'radio:yes_no', 'explain' => true),
    113121                                                'allow_avatar_upload'   => array('lang' => 'ALLOW_UPLOAD',                      'validate' => 'bool',   'type' => 'radio:yes_no', 'explain' => false),
     122                                                'allow_avatar_remote_upload'=> array('lang' => 'ALLOW_REMOTE_UPLOAD', 'validate' => 'bool',     'type' => 'radio:yes_no', 'explain' => true),
    114123                                                'avatar_filesize'               => array('lang' => 'MAX_FILESIZE',                      'validate' => 'int:0',  'type' => 'text:4:10', 'explain' => true, 'append' => ' ' . $user->lang['BYTES']),
    115124                                                'avatar_min'                    => array('lang' => 'MIN_AVATAR_SIZE',           'validate' => 'int:0',  'type' => 'dimension:3:4', 'explain' => true, 'append' => ' ' . $user->lang['PIXEL']),
     
    144153                                                'auth_img_pm'                   => array('lang' => 'ALLOW_IMG_PM',                      'validate' => 'bool',   'type' => 'radio:yes_no', 'explain' => false),
    145154                                                'auth_flash_pm'                 => array('lang' => 'ALLOW_FLASH_PM',            'validate' => 'bool',   'type' => 'radio:yes_no', 'explain' => true),
    146                                                 'enable_pm_icons'               => array('lang' => 'ENABLE_PM_ICONS',           'validate' => 'bool',   'type' => 'radio:yes_no', 'explain' => false)
     155                                                'enable_pm_icons'               => array('lang' => 'ENABLE_PM_ICONS',           'validate' => 'bool',   'type' => 'radio:yes_no', 'explain' => false),
     156
     157                                                'legend3'                                       => 'ACP_SUBMIT_CHANGES',
    147158                                        )
    148159                                );
     
    163174                                                'allow_bookmarks'               => array('lang' => 'ALLOW_BOOKMARKS',           'validate' => 'bool',   'type' => 'radio:yes_no', 'explain' => true),
    164175                                                'enable_post_confirm'   => array('lang' => 'VISUAL_CONFIRM_POST',       'validate' => 'bool',   'type' => 'radio:yes_no', 'explain' => true),
     176                                                'allow_quick_reply'             => array('lang' => 'ALLOW_QUICK_REPLY',         'validate' => 'bool',   'type' => 'custom', 'method' => 'quick_reply', 'explain' => true),
    165177
    166178                                                'legend2'                               => 'POSTING',
    167                                                 'enable_queue_trigger'  => array('lang' => 'ENABLE_QUEUE_TRIGGER',      'validate' => 'bool',           'type' => 'radio:yes_no', 'explain' => true),
    168                                                 'queue_trigger_posts'   => array('lang' => 'QUEUE_TRIGGER_POSTS',       'validate' => 'int:0:250',      'type' => 'text:4:4', 'explain' => true),
    169179                                                'bump_type'                             => false,
    170180                                                'edit_time'                             => array('lang' => 'EDIT_TIME',                         'validate' => 'int:0',          'type' => 'text:5:5', 'explain' => true, 'append' => ' ' . $user->lang['MINUTES']),
     181                                                'delete_time'                   => array('lang' => 'DELETE_TIME',                       'validate' => 'int:0',          'type' => 'text:5:5', 'explain' => true, 'append' => ' ' . $user->lang['MINUTES']),
    171182                                                'display_last_edited'   => array('lang' => 'DISPLAY_LAST_EDITED',       'validate' => 'bool',           'type' => 'radio:yes_no', 'explain' => true),
    172183                                                'flood_interval'                => array('lang' => 'FLOOD_INTERVAL',            'validate' => 'int:0',          'type' => 'text:3:10', 'explain' => true, 'append' => ' ' . $user->lang['SECONDS']),
     
    174185                                                'topics_per_page'               => array('lang' => 'TOPICS_PER_PAGE',           'validate' => 'int:1',          'type' => 'text:3:4', 'explain' => false),
    175186                                                'posts_per_page'                => array('lang' => 'POSTS_PER_PAGE',            'validate' => 'int:1',          'type' => 'text:3:4', 'explain' => false),
     187                                                'smilies_per_page'              => array('lang' => 'SMILIES_PER_PAGE',          'validate' => 'int:1',          'type' => 'text:3:4', 'explain' => false),
    176188                                                'hot_threshold'                 => array('lang' => 'HOT_THRESHOLD',                     'validate' => 'int:0',          'type' => 'text:3:4', 'explain' => true),
    177189                                                'max_poll_options'              => array('lang' => 'MAX_POLL_OPTIONS',          'validate' => 'int:2:127',      'type' => 'text:4:4', 'explain' => false),
    178190                                                'max_post_chars'                => array('lang' => 'CHAR_LIMIT',                        'validate' => 'int:0',          'type' => 'text:4:6', 'explain' => true),
     191                                                'min_post_chars'                => array('lang' => 'MIN_CHAR_LIMIT',            'validate' => 'int:0',          'type' => 'text:4:6', 'explain' => true),
    179192                                                'max_post_smilies'              => array('lang' => 'SMILIES_LIMIT',                     'validate' => 'int:0',          'type' => 'text:4:4', 'explain' => true),
    180193                                                'max_post_urls'                 => array('lang' => 'MAX_POST_URLS',                     'validate' => 'int:0',          'type' => 'text:5:4', 'explain' => true),
     
    183196                                                'max_post_img_width'    => array('lang' => 'MAX_POST_IMG_WIDTH',        'validate' => 'int:0',          'type' => 'text:5:4', 'explain' => true, 'append' => ' ' . $user->lang['PIXEL']),
    184197                                                'max_post_img_height'   => array('lang' => 'MAX_POST_IMG_HEIGHT',       'validate' => 'int:0',          'type' => 'text:5:4', 'explain' => true, 'append' => ' ' . $user->lang['PIXEL']),
     198
     199                                                'legend3'                                       => 'ACP_SUBMIT_CHANGES',
    185200                                        )
    186201                                );
     
    206221                                                'max_sig_img_width'             => array('lang' => 'MAX_SIG_IMG_WIDTH',         'validate' => 'int:0',  'type' => 'text:5:4', 'explain' => true, 'append' => ' ' . $user->lang['PIXEL']),
    207222                                                'max_sig_img_height'    => array('lang' => 'MAX_SIG_IMG_HEIGHT',        'validate' => 'int:0',  'type' => 'text:5:4', 'explain' => true, 'append' => ' ' . $user->lang['PIXEL']),
     223
     224                                                'legend3'                                       => 'ACP_SUBMIT_CHANGES',
    208225                                        )
    209226                                );
     
    219236
    220237                                                'require_activation'    => array('lang' => 'ACC_ACTIVATION',    'validate' => 'int',    'type' => 'custom', 'method' => 'select_acc_activation', 'explain' => true),
     238                                                'new_member_post_limit' => array('lang' => 'NEW_MEMBER_POST_LIMIT', 'validate' => 'int:0:255', 'type' => 'text:4:4', 'explain' => true, 'append' => ' ' . $user->lang['POSTS']),
     239                                                'new_member_group_default'=> array('lang' => 'NEW_MEMBER_GROUP_DEFAULT', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
    221240                                                'min_name_chars'                => array('lang' => 'USERNAME_LENGTH',   'validate' => 'int:1',  'type' => 'custom:5:180', 'method' => 'username_length', 'explain' => true),
    222241                                                'min_pass_chars'                => array('lang' => 'PASSWORD_LENGTH',   'validate' => 'int:1',  'type' => 'custom', 'method' => 'password_length', 'explain' => true),
     
    236255                                                'coppa_mail'            => array('lang' => 'COPPA_MAIL',                'validate' => 'string', 'type' => 'textarea:5:40', 'explain' => true),
    237256                                                'coppa_fax'                     => array('lang' => 'COPPA_FAX',                 'validate' => 'string', 'type' => 'text:25:100', 'explain' => false),
     257
     258                                                'legend4'                       => 'ACP_SUBMIT_CHANGES',
     259                                        )
     260                                );
     261                        break;
     262
     263                        case 'feed':
     264                                $display_vars = array(
     265                                        'title' => 'ACP_FEED_MANAGEMENT',
     266                                        'vars'  => array(
     267                                                'legend1'                                       => 'ACP_FEED_GENERAL',
     268                                                'feed_enable'                           => array('lang' => 'ACP_FEED_ENABLE',                           'validate' => 'bool',   'type' => 'radio:enabled_disabled',     'explain' => true ),
     269                                                'feed_item_statistics'          => array('lang' => 'ACP_FEED_ITEM_STATISTICS',          'validate' => 'bool',   'type' => 'radio:enabled_disabled',     'explain' => true),
     270                                                'feed_http_auth'                        => array('lang' => 'ACP_FEED_HTTP_AUTH',                        'validate' => 'bool',   'type' => 'radio:enabled_disabled',     'explain' => true),
     271
     272                                                'legend2'                                       => 'ACP_FEED_POST_BASED',
     273                                                'feed_limit_post'                       => array('lang' => 'ACP_FEED_LIMIT',                            'validate' => 'int:5',  'type' => 'text:3:4',                           'explain' => true),
     274                                                'feed_overall'                          => array('lang' => 'ACP_FEED_OVERALL',                          'validate' => 'bool',   'type' => 'radio:enabled_disabled',     'explain' => true ),
     275                                                'feed_forum'                            => array('lang' => 'ACP_FEED_FORUM',                            'validate' => 'bool',   'type' => 'radio:enabled_disabled',     'explain' => true ),
     276                                                'feed_topic'                            => array('lang' => 'ACP_FEED_TOPIC',                            'validate' => 'bool',   'type' => 'radio:enabled_disabled',     'explain' => true ),
     277
     278                                                'legend3'                                       => 'ACP_FEED_TOPIC_BASED',
     279                                                'feed_limit_topic'                      => array('lang' => 'ACP_FEED_LIMIT',                            'validate' => 'int:5',  'type' => 'text:3:4',                           'explain' => true),
     280                                                'feed_topics_new'                       => array('lang' => 'ACP_FEED_TOPICS_NEW',                       'validate' => 'bool',   'type' => 'radio:enabled_disabled',     'explain' => true ),
     281                                                'feed_topics_active'            => array('lang' => 'ACP_FEED_TOPICS_ACTIVE',            'validate' => 'bool',   'type' => 'radio:enabled_disabled',     'explain' => true ),
     282                                                'feed_news_id'                          => array('lang' => 'ACP_FEED_NEWS',                                     'validate' => 'string', 'type' => 'custom', 'method' => 'select_news_forums', 'explain' => true),
     283
     284                                                'legend4'                                       => 'ACP_FEED_SETTINGS_OTHER',
     285                                                'feed_overall_forums'           => array('lang' => 'ACP_FEED_OVERALL_FORUMS',           'validate' => 'bool',   'type' => 'radio:enabled_disabled',     'explain' => true ),
     286                                                'feed_exclude_id'                       => array('lang' => 'ACP_FEED_EXCLUDE_ID',                       'validate' => 'string', 'type' => 'custom', 'method' => 'select_exclude_forums', 'explain' => true),
    238287                                        )
    239288                                );
     
    280329                                                'load_cpf_viewprofile'  => array('lang' => 'LOAD_CPF_VIEWPROFILE',      'validate' => 'bool',   'type' => 'radio:yes_no', 'explain' => false),
    281330                                                'load_cpf_viewtopic'    => array('lang' => 'LOAD_CPF_VIEWTOPIC',        'validate' => 'bool',   'type' => 'radio:yes_no', 'explain' => false),
     331
     332                                                'legend4'                                       => 'ACP_SUBMIT_CHANGES',
    282333                                        )
    283334                                );
     
    313364                                                'server_port'                   => array('lang' => 'SERVER_PORT',               'validate' => 'int:0',                  'type' => 'text:5:5', 'explain' => true),
    314365                                                'script_path'                   => array('lang' => 'SCRIPT_PATH',               'validate' => 'script_path',    'type' => 'text::255', 'explain' => true),
     366
     367                                                'legend4'                                       => 'ACP_SUBMIT_CHANGES',
    315368                                        )
    316369                                );
     
    361414                                                'smtp_auth_method'              => array('lang' => 'SMTP_AUTH_METHOD',          'validate' => 'string', 'type' => 'select', 'method' => 'mail_auth_select', 'explain' => true),
    362415                                                'smtp_username'                 => array('lang' => 'SMTP_USERNAME',                     'validate' => 'string', 'type' => 'text:25:255', 'explain' => true),
    363                                                 'smtp_password'                 => array('lang' => 'SMTP_PASSWORD',                     'validate' => 'string', 'type' => 'password:25:255', 'explain' => true)
     416                                                'smtp_password'                 => array('lang' => 'SMTP_PASSWORD',                     'validate' => 'string', 'type' => 'password:25:255', 'explain' => true),
     417
     418                                                'legend3'                                       => 'ACP_SUBMIT_CHANGES',
    364419                                        )
    365420                                );
     
    401456                        }
    402457
    403                         if ($config_name == 'auth_method')
     458                        if ($config_name == 'auth_method' || $config_name == 'feed_news_id' || $config_name == 'feed_exclude_id')
    404459                        {
    405460                                continue;
     
    418473                        {
    419474                                set_config($config_name, $config_value);
    420                         }
     475
     476                                if ($config_name == 'allow_quick_reply' && isset($_POST['allow_quick_reply_enable']))
     477                                {
     478                                        enable_bitfield_column_flag(FORUMS_TABLE, 'forum_flags', log(FORUM_FLAG_QUICK_REPLY, 2));
     479                                }
     480                        }
     481                }
     482
     483                // Store news and exclude ids
     484                if ($mode == 'feed' && $submit)
     485                {
     486                        $cache->destroy('_feed_news_forum_ids');
     487                        $cache->destroy('_feed_excluded_forum_ids');
     488
     489                        $this->store_feed_forums(FORUM_OPTION_FEED_NEWS, 'feed_news_id');
     490                        $this->store_feed_forums(FORUM_OPTION_FEED_EXCLUDE, 'feed_exclude_id');
    421491                }
    422492
     
    795865
    796866        /**
     867        * Global quick reply enable/disable setting and button to enable in all forums
     868        */
     869        function quick_reply($value, $key)
     870        {
     871                global $user;
     872
     873                $radio_ary = array(1 => 'YES', 0 => 'NO');
     874
     875                return h_radio('config[allow_quick_reply]', $radio_ary, $value) .
     876                        '<br /><br /><input class="button2" type="submit" id="' . $key . '_enable" name="' . $key . '_enable" value="' . $user->lang['ALLOW_QUICK_REPLY_BUTTON'] . '" />';
     877        }
     878
     879
     880        /**
    797881        * Select default dateformat
    798882        */
     
    831915                <input type=\"text\" name=\"config[$key]\" id=\"$key\" value=\"$value\" maxlength=\"30\" />";
    832916        }
     917
     918        /**
     919        * Select multiple forums
     920        */
     921        function select_news_forums($value, $key)
     922        {
     923                global $user, $config;
     924
     925                $forum_list = make_forum_select(false, false, true, true, true, false, true);
     926
     927                // Build forum options
     928                $s_forum_options = '<select id="' . $key . '" name="' . $key . '[]" multiple="multiple">';
     929                foreach ($forum_list as $f_id => $f_row)
     930                {
     931                        $f_row['selected'] = phpbb_optionget(FORUM_OPTION_FEED_NEWS, $f_row['forum_options']);
     932
     933                        $s_forum_options .= '<option value="' . $f_id . '"' . (($f_row['selected']) ? ' selected="selected"' : '') . (($f_row['disabled']) ? ' disabled="disabled" class="disabled-option"' : '') . '>' . $f_row['padding'] . $f_row['forum_name'] . '</option>';
     934                }
     935                $s_forum_options .= '</select>';
     936
     937                return $s_forum_options;
     938        }
     939
     940        function select_exclude_forums($value, $key)
     941        {
     942                global $user, $config;
     943
     944                $forum_list = make_forum_select(false, false, true, true, true, false, true);
     945
     946                // Build forum options
     947                $s_forum_options = '<select id="' . $key . '" name="' . $key . '[]" multiple="multiple">';
     948                foreach ($forum_list as $f_id => $f_row)
     949                {
     950                        $f_row['selected'] = phpbb_optionget(FORUM_OPTION_FEED_EXCLUDE, $f_row['forum_options']);
     951
     952                        $s_forum_options .= '<option value="' . $f_id . '"' . (($f_row['selected']) ? ' selected="selected"' : '') . (($f_row['disabled']) ? ' disabled="disabled" class="disabled-option"' : '') . '>' . $f_row['padding'] . $f_row['forum_name'] . '</option>';
     953                }
     954                $s_forum_options .= '</select>';
     955
     956                return $s_forum_options;
     957        }
     958
     959        function store_feed_forums($option, $key)
     960        {
     961                global $db, $cache;
     962
     963                // Get key
     964                $values = request_var($key, array(0 => 0));
     965
     966                // Empty option bit for all forums
     967                $sql = 'UPDATE ' . FORUMS_TABLE . '
     968                        SET forum_options = forum_options - ' . (1 << $option) . '
     969                        WHERE ' . $db->sql_bit_and('forum_options', $option, '<> 0');
     970                $db->sql_query($sql);
     971
     972                // Already emptied for all...
     973                if (sizeof($values))
     974                {
     975                        // Set for selected forums
     976                        $sql = 'UPDATE ' . FORUMS_TABLE . '
     977                                SET forum_options = forum_options + ' . (1 << $option) . '
     978                                WHERE ' . $db->sql_in_set('forum_id', $values);
     979                        $db->sql_query($sql);
     980                }
     981
     982                // Empty sql cache for forums table because options changed
     983                $cache->destroy('sql', FORUMS_TABLE);
     984        }
     985
    833986}
    834987
Note: See TracChangeset for help on using the changeset viewer.