コード例 #1
0
 function main($id, $mode)
 {
     global $config, $user, $template, $request;
     $this->tpl_name = 'acp_linkmenu_config';
     $this->page_title = $user->lang['ACP_LINKMENU_SETTINGS'];
     add_form_key('acp_linkmenu_config');
     $submit = $request->is_set_post('submit');
     if ($submit) {
         if (!check_form_key('acp_linkmenu_config')) {
             trigger_error('FORM_INVALID');
         }
         $config->set('linkmenu_enable', $request->variable('linkmenu_enable', 0));
         $config->set('linkmenu_enable_first', $request->variable('linkmenu_enable_first', 0));
         $config->set('linkmenu_name_field_first', utf8_normalize_nfc($request->variable('linkmenu_name_field_first', '', true)));
         $config->set('linkmenu_text_field_first', utf8_normalize_nfc($request->variable('linkmenu_text_field_first', '', true)));
         $config->set('linkmenu_enable_second', $request->variable('linkmenu_enable_second', 0));
         $config->set('linkmenu_name_field_second', utf8_normalize_nfc($request->variable('linkmenu_name_field_second', '', true)));
         $config->set('linkmenu_text_field_second', utf8_normalize_nfc($request->variable('linkmenu_text_field_second', '', true)));
         $config->set('linkmenu_enable_third', $request->variable('linkmenu_enable_third', 0));
         $config->set('linkmenu_name_field_third', utf8_normalize_nfc($request->variable('linkmenu_name_field_third', '', true)));
         $config->set('linkmenu_text_field_third', utf8_normalize_nfc($request->variable('linkmenu_text_field_third', '', true)));
         trigger_error($user->lang['ACP_LINKMENU_CONFIG_SAVED'] . adm_back_link($this->u_action));
     }
     $template->assign_vars(array('ACP_LINKMENU_VERSION' => isset($config['linkmenu_version']) ? $config['linkmenu_version'] : '', 'ACP_LINKMENU_ENABLE' => !empty($config['linkmenu_enable']) ? true : false, 'ACP_LINKMENU_ENABLE_FIRST' => !empty($config['linkmenu_enable_first']) ? true : false, 'LINKMENU_NAME_FIELD_FIRST' => isset($config['linkmenu_name_field_first']) ? $config['linkmenu_name_field_first'] : '', 'LINKMENU_TEXT_FIELD_FIRST' => isset($config['linkmenu_text_field_first']) ? $config['linkmenu_text_field_first'] : '', 'ACP_LINKMENU_ENABLE_SECOND' => !empty($config['linkmenu_enable_second']) ? true : false, 'LINKMENU_NAME_FIELD_SECOND' => isset($config['linkmenu_name_field_second']) ? $config['linkmenu_name_field_second'] : '', 'LINKMENU_TEXT_FIELD_SECOND' => isset($config['linkmenu_text_field_second']) ? $config['linkmenu_text_field_second'] : '', 'ACP_LINKMENU_ENABLE_THIRD' => !empty($config['linkmenu_enable_third']) ? true : false, 'LINKMENU_NAME_FIELD_THIRD' => isset($config['linkmenu_name_field_third']) ? $config['linkmenu_name_field_third'] : '', 'LINKMENU_TEXT_FIELD_THIRD' => isset($config['linkmenu_text_field_third']) ? $config['linkmenu_text_field_third'] : '', 'U_ACTION' => $this->u_action));
 }
コード例 #2
0
    /**
     * Display the options a user can configure for this extension
     *
     * @return null
     * @access public
     */
    public function display_options()
    {
        add_form_key('acp_donation');
        // Is the form being submitted to us?
        if ($this->request->is_set_post('submit')) {
            if (!check_form_key('acp_donation')) {
                $error[] = 'FORM_INVALID';
            }
            $donation_row = array('donation_body' => $this->request->variable('donation_body', '', true), 'donation_cancel' => $this->request->variable('donation_cancel', '', true), 'donation_success' => $this->request->variable('donation_success', '', true));
            foreach ($donation_row as $this->config_name => $this->config_value) {
                $sql = 'UPDATE ' . $this->donation_table . "\n\t\t\t\t\tSET config_value = '" . $this->db->sql_escape($this->config_value) . "'\n\t\t\t\t\tWHERE config_name = '" . $this->db->sql_escape($this->config_name) . "'";
                $this->db->sql_query($sql);
            }
            // Set the options the user configured
            $this->set_options();
            // Add option settings change action to the admin log
            $this->phpbb_log->add('admin', $this->user->data['user_id'], $this->user->ip, 'DONATION_SAVED');
            trigger_error($this->user->lang['DONATION_SAVED'] . adm_back_link($this->u_action));
        }
        // let's get it on
        $sql = 'SELECT *
		FROM ' . $this->donation_table;
        $result = $this->db->sql_query($sql);
        $donation = array();
        while ($row = $this->db->sql_fetchrow($result)) {
            $donation[$row['config_name']] = $row['config_value'];
        }
        $this->db->sql_freeresult($result);
        $donation_body = isset($donation['donation_body']) ? $donation['donation_body'] : '';
        $donation_cancel = isset($donation['donation_cancel']) ? $donation['donation_cancel'] : '';
        $donation_success = isset($donation['donation_success']) ? $donation['donation_success'] : '';
        $donation_version = isset($this->config['donation_version']) ? $this->config['donation_version'] : '';
        $this->template->assign_vars(array('DONATION_VERSION' => $donation_version, 'DONATION_ENABLE' => $this->config['donation_enable'], 'DONATION_INDEX_ENABLE' => $this->config['donation_index_enable'], 'DONATION_INDEX_TOP' => $this->config['donation_index_top'], 'DONATION_INDEX_BOTTOM' => $this->config['donation_index_bottom'], 'DONATION_EMAIL' => $this->config['donation_email'], 'DONATION_ACHIEVEMENT_ENABLE' => $this->config['donation_achievement_enable'], 'DONATION_ACHIEVEMENT' => $this->config['donation_achievement'], 'DONATION_GOAL_ENABLE' => $this->config['donation_goal_enable'], 'DONATION_GOAL' => $this->config['donation_goal'], 'DONATION_GOAL_CURRENCY_ENABLE' => $this->config['donation_goal_currency_enable'], 'DONATION_GOAL_CURRENCY' => $this->config['donation_goal_currency'], 'DONATION_BODY' => $donation_body, 'DONATION_CANCEL' => $donation_cancel, 'DONATION_SUCCESS' => $donation_success, 'U_ACTION' => $this->u_action));
    }
コード例 #3
0
 /**
  * Display the options a user can configure for this extension
  *
  * @return null
  * @access public
  */
 public function display_options()
 {
     // Create a form key for preventing CSRF attacks
     $form_key = 'sitelogo';
     add_form_key($form_key);
     // Is the form being submitted
     if ($this->request->is_set_post('submit')) {
         // Is the submitted form is valid
         if (!check_form_key($form_key)) {
             trigger_error($this->user->lang('FORM_INVALID') . adm_back_link($this->u_action), E_USER_WARNING);
         }
         // If no errors, process the form data
         // Set the options the user configured
         $this->set_options();
         // Add option settings change action to the admin log
         $phpbb_log = $this->container->get('log');
         $phpbb_log->add('admin', $this->user->data['user_id'], $this->user->ip, 'SITE_LOGO_LOG');
         // Option settings have been updated and logged
         // Confirm this to the user and provide link back to previous page
         trigger_error($this->user->lang('CONFIG_UPDATED') . adm_back_link($this->u_action));
     }
     // Set output vars for display in the template
     // Positions
     $positions = array();
     $positions[] = $this->user->lang('LOGO_LEFT');
     $positions[] = $this->user->lang('LOGO_CENTRE');
     $positions[] = $this->user->lang('LOGO_RIGHT');
     foreach ($positions as $value => $label) {
         $this->template->assign_block_vars('positions', array('S_CHECKED' => $this->config['site_logo_position'] == $value ? true : false, 'LABEL' => $label, 'VALUE' => $value));
     }
     $this->template->assign_vars(array('SITE_LOGO_HEIGHT' => isset($this->config['site_logo_height']) ? $this->config['site_logo_height'] : '', 'SITE_LOGO_IMAGE' => isset($this->config['site_logo_image']) ? $this->config['site_logo_image'] : '', 'SITE_LOGO_LEFT' => isset($this->config['site_logo_left']) ? $this->config['site_logo_left'] : '', 'SITE_LOGO_PIXELS' => isset($this->config['site_logo_pixels']) ? $this->config['site_logo_pixels'] : '', 'SITE_LOGO_REMOVE' => isset($this->config['site_logo_remove']) ? $this->config['site_logo_remove'] : '', 'SITE_LOGO_RIGHT' => isset($this->config['site_logo_right']) ? $this->config['site_logo_right'] : '', 'SITE_LOGO_WIDTH' => isset($this->config['site_logo_width']) ? $this->config['site_logo_width'] : '', 'SITE_NAME_SUPRESS' => isset($this->config['site_name_supress']) ? $this->config['site_name_supress'] : '', 'SITE_SEARCH_REMOVE' => isset($this->config['site_search_remove']) ? $this->config['site_search_remove'] : '', 'U_ACTION' => $this->u_action));
 }
コード例 #4
0
 public function main($id, $mode)
 {
     global $config, $user, $template, $request;
     $user->add_lang_ext('rinsrans/textbox', 'common');
     $this->tpl_name = 'acp_textbox_body';
     $this->page_title = $user->lang('ACP_TEXTBOX_TITLE');
     add_form_key('acp_textbox');
     // Form is submitted
     if ($request->is_set_post('submit')) {
         if (!check_form_key('acp_textbox')) {
             trigger_error($user->lang('FORM_INVALID') . adm_back_link($this->u_action), E_USER_WARNING);
         }
         // Set the new settings to config
         $uid = $bitfield = $options = '';
         $textbox_content = $request->variable('textbox_content', '', true);
         generate_text_for_storage($textbox_content, $uid, $bitfield, $options, true, true, true);
         $config->set('textbox_content', $textbox_content);
         $config->set('textbox_bbcode_uid', $uid);
         $config->set('textbox_bbcode_bitfield', $bitfield);
         trigger_error($user->lang('ACP_TEXTBOX_SAVED') . adm_back_link($this->u_action));
     }
     $textbox_content = generate_text_for_edit($config['textbox_content'], $config['textbox_bbcode_uid'], 3);
     // Send the curent settings to template
     $template->assign_vars(array('U_ACTION' => $this->u_action, 'TEXTBOX_CONTENT' => $textbox_content['text']));
 }
コード例 #5
0
ファイル: main_module.php プロジェクト: d120/phpbb-banner
 function main($id, $mode)
 {
     global $db, $user, $auth, $template, $cache, $request;
     global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx;
     $this->pool_root = $phpbb_root_path . 'store/d120de/banner/';
     $user->add_lang('acp/common');
     $this->tpl_name = 'banner_settings';
     $this->page_title = $user->lang('ACP_D120DE_BANNER_SETTINGS_DEFAULT');
     add_form_key('d120de/banner');
     $this->load_banner_list('default');
     $this->load_banner_list('event');
     if ($request->is_set_post('submit')) {
         if (!check_form_key('d120de/banner')) {
             trigger_error('FORM_INVALID');
         }
         $filename = $request->variable('d120de_banner_picture', '');
         $filepath = $this->pool_root . $filename;
         if (is_file($filepath)) {
             $image_dimension = getimagesize($filepath);
             $config->set('d120de_banner_width', $image_dimension[0]);
             $config->set('d120de_banner_height', $image_dimension[1]);
         } elseif ($filename != '') {
             trigger_error('The selected Image does not exist!', E_USER_WARNING);
         }
         $config->set('d120de_banner_link_default', $request->variable('d120de_banner_link_default', ''));
         $config->set('d120de_banner_picture', $request->variable('d120de_banner_picture', ''));
         $config->set('d120de_banner_alt_text_default', $request->variable('d120de_banner_alt_text_default', ''));
         $config->set('d120de_banner_hidesearchbox', $request->Is_set('d120de_banner_hidesearchbox'));
         $config->set('d120de_banner_hidesearchbox_default', $request->Is_set('d120de_banner_hidesearchbox_default'));
         trigger_error($user->lang('ACP_D120DE_BANNER_SETTING_SAVED') . adm_back_link($this->u_action));
     }
     $template->assign_vars(array('U_ACTION' => $this->u_action, 'D120DE_BANNER_LINK_DEFAULT' => $config['d120de_banner_link_default'], 'D120DE_BANNER_PICTURE' => $config['d120de_banner_picture'], 'D120DE_BANNER_ALT_TEXT_DEFAULT' => $config['d120de_banner_alt_text_default'], 'D120DE_BANNER_HIDESEARCHBOX' => $config['d120de_banner_hidesearchbox'], 'D120DE_BANNER_HIDESEARCHBOX_DEFAULT' => $config['d120de_banner_hidesearchbox_default']));
 }
コード例 #6
0
 function main($id, $mode)
 {
     global $db, $config, $request, $template, $user;
     global $phpbb_root_path, $phpbb_admin_path, $phpEx;
     $this->page_title = $user->lang['SFS_CONTROL'];
     $this->tpl_name = 'stopforumspam_body';
     add_form_key('sfs');
     $allow_sfs = $this->allow_sfs();
     if ($request->is_set_post('submit')) {
         // Test if form key is valid
         if (!check_form_key('sfs')) {
             trigger_error($user->lang['FORM_INVALID'] . adm_back_link($this->u_action), E_USER_WARNING);
         }
         if (!function_exists('validate_data')) {
             include $phpbb_root_path . 'includes/functions_user.' . $phpEx;
         }
         $check_row = array('sfs_threshold' => $request->variable('sfs_threshold', 0));
         $validate_row = array('sfs_threshold' => array('num', false, 1, 99));
         $error = validate_data($check_row, $validate_row);
         // Replace "error" strings with their real, localised form
         $error = array_map(array($user, 'lang'), $error);
         if (!sizeof($error)) {
             // Set the options the user configured
             $this->set_options();
             trigger_error($user->lang['SFS_SETTINGS_SUCCESS'] . adm_back_link($this->u_action));
         }
     }
     $template->assign_vars(array('ERROR' => isset($error) ? sizeof($error) ? implode('<br />', $error) : '' : '', 'ALLOW_SFS' => $config['allow_sfs'] ? true : false, 'CURL_ACTIVE' => !empty($allow_sfs) ? '' : '<br /><span class="error">' . $user->lang['LOG_SFS_NEED_CURL'] . '</span>', 'SFS_THRESHOLD' => (int) $config['sfs_threshold'], 'SFS_BAN_IP' => $config['sfs_ban_ip'] ? true : false, 'SFS_LOG_MESSAGE' => $config['sfs_log_message'] ? true : false, 'SFS_DOWN' => $config['sfs_down'] ? true : false, 'SFS_BY_NAME' => $config['sfs_by_name'] ? true : false, 'SFS_BY_EMAIL' => $config['sfs_by_email'] ? true : false, 'SFS_BY_IP' => $config['sfs_by_ip'] ? true : false, 'SFS_BAN_REASON' => $config['sfs_ban_reason'] ? true : false, 'SFS_VERSION' => $config['sfs_version'], 'U_ACTION' => $this->u_action));
 }
コード例 #7
0
 function main($id, $mode)
 {
     global $config, $request, $template, $user, $phpbb_log;
     $user->add_lang('acp/common');
     $this->tpl_name = 'acp_markpostunread';
     $this->page_title = $user->lang('MARKPOSTUNREAD_TITLE');
     add_form_key('acp_markpostunread');
     if ($request->is_set_post('submit')) {
         if (!check_form_key('acp_markpostunread')) {
             trigger_error($user->lang('FORM_INVALID') . adm_back_link($this->u_action));
         }
         foreach ($this->settings as $setting => $default) {
             if (!is_null($default)) {
                 $value = $request->variable($setting, $default, is_string($default));
                 if ($setting === 'enabled' && $value && !$config['load_db_lastread']) {
                     trigger_error($user->lang('MARKPOSTUNREAD_ENABLE_FAILED') . adm_back_link($this->u_action), E_USER_WARNING);
                 }
                 $config->set($this->setting_prefix . $setting, $value);
             }
         }
         $user_id = empty($user->data) ? ANONYMOUS : $user->data['user_id'];
         $user_ip = empty($user->ip) ? '' : $user->ip;
         $phpbb_log->add('admin', $user_id, $user_ip, 'MARKPOSTUNREAD_CONFIG_UPDATED');
         trigger_error($user->lang('CONFIG_UPDATED') . adm_back_link($this->u_action));
     }
     $template_vars = array();
     foreach ($this->settings as $setting => $default) {
         $setting_full = $this->setting_prefix . $setting;
         $key = strtoupper(str_replace('.', '_', $setting_full));
         $template_vars[$key] = isset($config[$setting_full]) ? $config[$setting_full] : $default;
     }
     $template->assign_vars($template_vars);
 }
コード例 #8
0
ファイル: dejure_module.php プロジェクト: tas2580/dejure
 public function main($id, $mode)
 {
     global $config, $user, $template, $request, $db, $table_prefix;
     $user->add_lang_ext('tas2580/dejure', 'common');
     $this->tpl_name = 'acp_dejure_body';
     $this->page_title = $user->lang('ACP_DEJURE_TITLE');
     add_form_key('acp_dejure');
     // Form is submitted
     if ($request->is_set_post('submit')) {
         if (!check_form_key('acp_dejure')) {
             trigger_error($user->lang('FORM_INVALID') . adm_back_link($this->u_action), E_USER_WARNING);
         }
         // Set the new settings to config
         $config->set('tas2580_dejure_link_style', $request->variable('link_style', 'weit'));
         $config->set('tas2580_dejure_class', $request->variable('class', ''));
         $config->set('tas2580_dejure_buzer', $request->variable('buzer', 0));
         $config->set('tas2580_dejure_cache_time', $request->variable('cache_time', 4));
         $config->set('tas2580_dejure_target', $request->variable('target', ''));
         $sql = 'DELETE FROM ' . $table_prefix . 'dejure';
         $db->sql_query($sql);
         trigger_error($user->lang('ACP_SAVED') . adm_back_link($this->u_action));
     }
     // Send the curent settings to template
     $template->assign_vars(array('U_ACTION' => $this->u_action, 'LINK_STYLE_WEIT' => $config['tas2580_dejure_link_style'] === 'weit' ? ' selected="selected"' : '', 'LINK_STYLE_SCHMAL' => $config['tas2580_dejure_link_style'] === 'schmal' ? ' selected="selected"' : '', 'CLASS' => $config['tas2580_dejure_class'], 'TARGET' => $config['tas2580_dejure_target'], 'BUZER' => $config['tas2580_dejure_buzer'] == 1 ? ' checked="checked"' : '', 'CACHE_TIME' => $config['tas2580_dejure_cache_time']));
 }
コード例 #9
0
 public function main($id, $mode)
 {
     global $config, $request, $template, $user;
     $this->config = $config;
     $this->request = $request;
     $this->template = $template;
     $this->user = $user;
     // Add the common lang file
     $this->user->add_lang(array('acp/common'));
     // Add the board snowstormlights ACP lang file
     $this->user->add_lang_ext('prosk8er/snowstormlights', 'info_acp_snowstorm_lights');
     // Load a template from adm/style for our ACP page
     $this->tpl_name = 'snowstorm_lights';
     // Set the page title for our ACP page
     $this->page_title = $user->lang['ACP_SNOWSTORM_LIGHTS'];
     // Define the name of the form for use as a form key
     $form_key = 'acp_snowstorm_lights';
     add_form_key($form_key);
     // If form is submitted or previewed
     if ($this->request->is_set_post('submit')) {
         // Test if form key is valid
         if (!check_form_key($form_key)) {
             trigger_error('FORM_INVALID');
         }
         // Store the config enable/disable state
         $scl_enabled = $this->request->variable('scl_enabled', 0);
         $this->config->set('scl_enabled', $scl_enabled);
         $snow_enabled = $request->variable('snow_enabled', 0);
         $this->config->set('snow_enabled', $snow_enabled);
         // Output message to user for the update
         trigger_error($this->user->lang('SNOWSTORM_LIGHTS_SAVED') . adm_back_link($this->u_action));
     }
     // Output data to the template
     $this->template->assign_vars(array('SCL_ENABLED' => isset($this->config['scl_enabled']) ? $this->config['scl_enabled'] : '', 'SNOW_ENABLED' => isset($this->config['snow_enabled']) ? $this->config['snow_enabled'] : '', 'U_ACTION' => $this->u_action));
 }
コード例 #10
0
 function main($id, $mode)
 {
     global $user, $config, $request, $template;
     add_form_key('wwh');
     $user->add_lang('ucp');
     $this->tpl_name = 'acp_wwh';
     $this->page_title = $user->lang['WWH_TITLE'];
     $submit = $request->is_set_post('submit');
     if ($submit) {
         if (!check_form_key('wwh')) {
             trigger_error('FORM_INVALID');
         }
         $config->set('wwh_disp_bots', $request->variable('wwh_disp_bots', 0));
         $config->set('wwh_disp_guests', $request->variable('wwh_disp_guests', 0));
         $config->set('wwh_disp_hidden', $request->variable('wwh_disp_hidden', 0));
         $config->set('wwh_disp_time', $request->variable('wwh_disp_time', 0));
         $config->set('wwh_disp_time_format', $request->variable('wwh_disp_time_format', 'H:i'));
         $config->set('wwh_disp_ip', $request->variable('wwh_disp_ip', 0));
         $config->set('wwh_version', $request->variable('wwh_version', 0));
         $config->set('wwh_del_time_h', $request->variable('wwh_del_time_h', 0));
         $config->set('wwh_del_time_m', $request->variable('wwh_del_time_m', 0));
         $config->set('wwh_del_time_s', $request->variable('wwh_del_time_s', 0));
         $config->set('wwh_sort_by', $request->variable('wwh_sort_by', 0));
         $config->set('wwh_record', $request->variable('wwh_record', 0));
         $config->set('wwh_record_timestamp', $request->variable('wwh_record_timestamp', 'D j. M Y'));
         if ($request->variable('wwh_reset', 0) > 0) {
             $config->set('wwh_record_ips', 1);
             $config->set('wwh_record_time', time());
             $config->set('wwh_reset_time', time());
         }
         trigger_error($user->lang['WWH_SAVED_SETTINGS'] . adm_back_link($this->u_action));
     }
     $template->assign_vars(array('WWH_MOD_VERSION' => sprintf($user->lang['WWH_INSTALLED'], $config['wwh_mod_version']), 'WWH_DISP_BOTS' => $config['wwh_disp_bots'], 'WWH_DISP_GUESTS' => $config['wwh_disp_guests'], 'WWH_DISP_HIDDEN' => $config['wwh_disp_hidden'], 'WWH_DISP_TIME' => $config['wwh_disp_time'], 'WWH_DISP_TIME_FORMAT' => $config['wwh_disp_time_format'], 'WWH_DISP_IP' => $config['wwh_disp_ip'], 'WWH_VERSION' => $config['wwh_version'], 'WWH_DEL_TIME_H' => $config['wwh_del_time_h'], 'WWH_DEL_TIME_M' => $config['wwh_del_time_m'], 'WWH_DEL_TIME_S' => $config['wwh_del_time_s'], 'WWH_SORT_BY' => $config['wwh_sort_by'], 'WWH_RECORD' => $config['wwh_record'], 'WWH_RECORD_TIMESTAMP' => $config['wwh_record_timestamp'], 'U_ACTION' => $this->u_action));
 }
コード例 #11
0
 /**
  * @param string $list_name whitelist or blacklist
  * @param string $u_action phpbb acp-u_action
  */
 private function manage_list($u_action, $list_name)
 {
     $list_name_upper = strtoupper($list_name);
     // Define the name of the form for use as a form key
     $form_name = 'topictags';
     add_form_key($form_name);
     $errors = array();
     if ($this->request->is_set_post('submit')) {
         if (!check_form_key($form_name)) {
             trigger_error('FORM_INVALID');
         }
         $this->config->set(prefixes::CONFIG . '_' . $list_name . '_enabled', $this->request->variable(prefixes::CONFIG . '_' . $list_name . '_enabled', 0));
         $list = rawurldecode(base64_decode($this->request->variable(prefixes::CONFIG . '_' . $list_name, '')));
         if (!empty($list)) {
             $list = json_decode($list, true);
             $tags = array();
             for ($i = 0, $size = sizeof($list); $i < $size; $i++) {
                 $tags[] = $list[$i]['text'];
             }
             $list = json_encode($tags);
         }
         // store the list
         $this->config_text->set(prefixes::CONFIG . '_' . $list_name, $list);
         trigger_error($this->user->lang('TOPICTAGS_' . $list_name_upper . '_SAVED') . adm_back_link($u_action));
     }
     // display
     $list = $this->config_text->get(prefixes::CONFIG . '_' . $list_name);
     $list = base64_encode(rawurlencode($list));
     $this->template->assign_vars(array('TOPICTAGS_VERSION' => $this->user->lang('TOPICTAGS_INSTALLED', $this->config[prefixes::CONFIG . '_version']), 'TOPICTAGS_' . $list_name_upper . '_ENABLED' => $this->config[prefixes::CONFIG . '_' . $list_name . '_enabled'], 'TOPICTAGS_' . $list_name_upper => $list, 'S_RH_TOPICTAGS_INCLUDE_NG_TAGS_INPUT' => true, 'S_RH_TOPICTAGS_INCLUDE_CSS' => true, 'TOPICTAGS_CONVERT_SPACE_TO_MINUS' => $this->config[prefixes::CONFIG . '_convert_space_to_minus'] ? 'true' : 'false', 'S_ERROR' => sizeof($errors) ? true : false, 'ERROR_MSG' => implode('<br />', $errors), 'U_ACTION' => $u_action));
 }
コード例 #12
0
 public function main($id, $mode)
 {
     global $config, $user, $template, $request, $phpbb_container, $phpbb_root_path, $phpEx;
     $user->add_lang_ext('tas2580/mobilenotifier', 'common');
     $wa = $phpbb_container->get('tas2580.mobilenotifier.src.helper');
     $this->tpl_name = 'acp_mobilenotifier_body';
     $this->page_title = $user->lang('ACP_MOBILENOTIFIER_TITLE');
     add_form_key('acp_mobilenotifier');
     // Form is submitted
     if ($request->is_set_post('submit')) {
         if (!check_form_key('acp_mobilenotifier')) {
             trigger_error($user->lang('FORM_INVALID') . adm_back_link($this->u_action), E_USER_WARNING);
         }
         $config->set('whatsapp_sender', $request->variable('sender', ''));
         $config->set('whatsapp_password', $request->variable('password', ''));
         $config->set('whatsapp_status', $request->variable('status', ''));
         $config->set('whatsapp_default_cc', $request->variable('default_cc', ''));
         $wa->update_status($config['whatsapp_status']);
         if ($request->file('image')) {
             include_once $phpbb_root_path . 'includes/functions_upload.' . $phpEx;
             $upload = new \fileupload();
             $upload->set_allowed_extensions(array('jpg', 'png', 'gif'));
             $file = $upload->form_upload('image');
             if ($file->filename) {
                 $wa->update_picture($file->filename);
             }
         }
         trigger_error($user->lang('ACP_SAVED') . adm_back_link($this->u_action));
     }
     $template->assign_vars(array('WA_VERSION' => WA_VER, 'U_ACTION' => $this->u_action, 'SENDER' => isset($config['whatsapp_sender']) ? $config['whatsapp_sender'] : '', 'PASSWORD' => isset($config['whatsapp_password']) ? $config['whatsapp_password'] : '', 'STATUS' => isset($config['whatsapp_status']) ? $config['whatsapp_status'] : '', 'CC_SELECT' => $wa->cc_select(isset($config['whatsapp_default_cc']) ? $config['whatsapp_default_cc'] : '')));
 }
コード例 #13
0
ファイル: acp_shareon.php プロジェクト: Galixte/share-on
 function main($id, $mode)
 {
     global $db, $user, $auth, $template, $cache;
     global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx;
     $user->add_lang('acp/common');
     $this->tpl_name = 'acp_shareon';
     $this->page_title = $user->lang['SHARE_ON_MOD'];
     add_form_key('acp_shareon');
     // Version Check
     $config['SHAREON_VERSION'] = isset($config['SHAREON_VERSION']) ? $config['SHAREON_VERSION'] : '2.2.0';
     $submit = isset($_POST['submit']) ? true : false;
     if ($submit) {
         if (!check_form_key('acp_shareon')) {
             trigger_error('FORM_INVALID');
         }
         set_config('so_status', request_var('so_status', true));
         set_config('so_position', request_var('so_position', true));
         set_config('so_type', request_var('so_type', true));
         set_config('so_facebook', request_var('so_facebook', true));
         set_config('so_twitter', request_var('so_twitter', true));
         set_config('so_tuenti', request_var('so_tuenti', true));
         set_config('so_sonico', request_var('so_sonico', true));
         set_config('so_friendfeed', request_var('so_friendfeed', true));
         set_config('so_orkut', request_var('so_orkut', true));
         set_config('so_digg', request_var('so_digg', true));
         set_config('so_reddit', request_var('so_reddit', true));
         set_config('so_delicious', request_var('so_delicious', true));
         set_config('so_vk', request_var('so_vk', true));
         set_config('so_tumblr', request_var('so_tumblr', true));
         set_config('so_google', request_var('so_google', true));
         set_config('so_myspace', request_var('so_myspace', true));
         trigger_error($user->lang['SO_SAVED'] . adm_back_link($this->u_action));
     }
     $template->assign_vars(array('SO_STATUS' => !empty($config['so_status']) ? true : false, 'SO_POSITION' => !empty($config['so_position']) ? true : false, 'SO_TYPE' => !empty($config['so_type']) ? true : false, 'SO_FACEBOOK' => !empty($config['so_facebook']) ? true : false, 'SO_TWITTER' => !empty($config['so_twitter']) ? true : false, 'SO_TUENTI' => !empty($config['so_tuenti']) ? true : false, 'SO_SONICO' => !empty($config['so_sonico']) ? true : false, 'SO_FRIENDFEED' => !empty($config['so_friendfeed']) ? true : false, 'SO_ORKUT' => !empty($config['so_orkut']) ? true : false, 'SO_DIGG' => !empty($config['so_digg']) ? true : false, 'SO_REDDIT' => !empty($config['so_reddit']) ? true : false, 'SO_DELICIOUS' => !empty($config['so_delicious']) ? true : false, 'SO_VK' => !empty($config['so_vk']) ? true : false, 'SO_TUMBLR' => !empty($config['so_tumblr']) ? true : false, 'SO_GOOGLE' => !empty($config['so_google']) ? true : false, 'SO_MYSPACE' => !empty($config['so_myspace']) ? true : false, 'U_ACTION' => $this->u_action, 'SHAREON_VERSION' => $config['SHAREON_VERSION'], 'S_VERSION_UP_TO_DATE' => $this->shareon_version_compare($config['SHAREON_VERSION'])));
 }
コード例 #14
0
ファイル: paypal_module.php プロジェクト: Talk19Zehn/paypal
 public function main($id, $mode)
 {
     global $config, $user, $template, $request;
     $user->add_lang_ext('tas2580/paypal', 'common');
     switch ($mode) {
         case 'settings':
             $this->tpl_name = 'acp_paypal_body';
             $this->page_title = $user->lang('ACP_PAYPAL_TITLE');
             add_form_key('acp_paypal');
             // Form is submitted
             if ($request->is_set_post('submit')) {
                 if (!check_form_key('acp_paypal')) {
                     trigger_error($user->lang('FORM_INVALID') . adm_back_link($this->u_action), E_USER_WARNING);
                 }
                 $config->set('paypal_email', $request->variable('paypal_email', ''));
                 $config->set('paypal_default_item', $request->variable('paypal_default_item', ''));
                 $config->set('paypal_description', $request->variable('paypal_description', ''));
                 trigger_error($user->lang('ACP_SAVED') . adm_back_link($this->u_action));
             }
             $template->assign_vars(array('U_ACTION' => $this->u_action, 'PAYPAL_EMAIL' => isset($config['paypal_email']) ? $config['paypal_email'] : '', 'PAYPAL_DEFAULT_ITEM' => isset($config['paypal_default_item']) ? $config['paypal_default_item'] : '', 'PAYPAL_DESCRIPTION' => isset($config['paypal_description']) ? $config['paypal_description'] : ''));
             break;
         case 'items':
             $this->tpl_name = 'acp_paypal_items_body';
             $this->page_title = $user->lang('ACP_PAYPAL_ITEMS');
             break;
     }
 }
コード例 #15
0
ファイル: acp_captcha.php プロジェクト: html/PI
 function main($id, $mode)
 {
     global $db, $user, $auth, $template;
     global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx;
     $user->add_lang('acp/board');
     $captcha_vars = array('captcha_gd_x_grid' => 'CAPTCHA_GD_X_GRID', 'captcha_gd_y_grid' => 'CAPTCHA_GD_Y_GRID', 'captcha_gd_foreground_noise' => 'CAPTCHA_GD_FOREGROUND_NOISE', 'captcha_gd' => 'CAPTCHA_GD_PREVIEWED', 'captcha_gd_wave' => 'CAPTCHA_GD_WAVE', 'captcha_gd_3d_noise' => 'CAPTCHA_GD_3D_NOISE', 'captcha_gd_fonts' => 'CAPTCHA_GD_FONTS');
     if (isset($_GET['demo'])) {
         $captcha_vars = array_keys($captcha_vars);
         foreach ($captcha_vars as $captcha_var) {
             $config[$captcha_var] = isset($_REQUEST[$captcha_var]) ? request_var($captcha_var, 0) : $config[$captcha_var];
         }
         if ($config['captcha_gd']) {
             include $phpbb_root_path . 'includes/captcha/captcha_gd.' . $phpEx;
         } else {
             include $phpbb_root_path . 'includes/captcha/captcha_non_gd.' . $phpEx;
         }
         $captcha = new captcha();
         $captcha->execute(gen_rand_string(mt_rand(CAPTCHA_MIN_CHARS, CAPTCHA_MAX_CHARS)), time());
         exit;
     }
     $config_vars = array('enable_confirm' => 'REG_ENABLE', 'enable_post_confirm' => 'POST_ENABLE', 'confirm_refresh' => 'CONFIRM_REFRESH', 'captcha_gd' => 'CAPTCHA_GD');
     $this->tpl_name = 'acp_captcha';
     $this->page_title = 'ACP_VC_SETTINGS';
     $form_key = 'acp_captcha';
     add_form_key($form_key);
     $submit = request_var('submit', '');
     if ($submit && check_form_key($form_key)) {
         $config_vars = array_keys($config_vars);
         foreach ($config_vars as $config_var) {
             set_config($config_var, request_var($config_var, ''));
         }
         $captcha_vars = array_keys($captcha_vars);
         foreach ($captcha_vars as $captcha_var) {
             $value = request_var($captcha_var, 0);
             if ($value >= 0) {
                 set_config($captcha_var, $value);
             }
         }
         add_log('admin', 'LOG_CONFIG_VISUAL');
         trigger_error($user->lang['CONFIG_UPDATED'] . adm_back_link($this->u_action));
     } else {
         if ($submit) {
             trigger_error($user->lang['FORM_INVALID'] . adm_back_link($this->u_action));
         } else {
             $preview_image_src = append_sid(append_sid("{$phpbb_admin_path}index.{$phpEx}", "i={$id}&amp;demo=demo"));
             if (@extension_loaded('gd')) {
                 $template->assign_var('GD', true);
             }
             foreach ($config_vars as $config_var => $template_var) {
                 $template->assign_var($template_var, isset($_REQUEST[$config_var]) ? request_var($config_var, '') : $config[$config_var]);
             }
             foreach ($captcha_vars as $captcha_var => $template_var) {
                 $var = isset($_REQUEST[$captcha_var]) ? request_var($captcha_var, 0) : $config[$captcha_var];
                 $template->assign_var($template_var, $var);
                 $preview_image_src .= "&amp;{$captcha_var}=" . $var;
             }
             $template->assign_vars(array('CAPTCHA_PREVIEW' => $preview_image_src, 'PREVIEW' => isset($_POST['preview'])));
         }
     }
 }
コード例 #16
0
 public function main($id, $mode)
 {
     global $phpbb_container;
     // Initialization
     $this->config = $phpbb_container->get('config');
     $this->db = $phpbb_container->get('dbal.conn');
     $this->user = $phpbb_container->get('user');
     $this->template = $phpbb_container->get('template');
     $this->request = $phpbb_container->get('request');
     $action = $this->request->variable('action', '', true);
     $submit = $this->request->is_set_post('submit') ? true : false;
     $this->form_key = 'acp_advancedpolls';
     add_form_key($this->form_key);
     $display_vars = array('title' => 'AP_TITLE_ACP', 'vars' => array('legend1' => 'AP_GLOBAL_SETTINGS', 'wolfsblvt.advancedpolls.activate_incremental_votes' => array('lang' => 'AP_ACT_INCREMENTAL_VOTES', 'validate' => 'bool', 'type' => 'radio:enabled_disabled', 'explain' => true), 'wolfsblvt.advancedpolls.activate_closed_voting' => array('lang' => 'AP_ACT_CLOSED_VOTING', 'validate' => 'bool', 'type' => 'radio:enabled_disabled', 'explain' => true), 'wolfsblvt.advancedpolls.activate_no_vote' => array('lang' => 'AP_ACT_POLL_NO_VOTE', 'validate' => 'bool', 'type' => 'radio:enabled_disabled', 'explain' => true), 'wolfsblvt.advancedpolls.activate_poll_end' => array('lang' => 'AP_ACT_POLL_END', 'validate' => 'bool', 'type' => 'radio:enabled_disabled', 'explain' => true), 'wolfsblvt.advancedpolls.activate_notifications' => array('lang' => 'AP_ACT_POLL_NOTIFICATIONS', 'validate' => 'bool', 'type' => 'radio:enabled_disabled', 'explain' => true), 'legend2' => 'AP_PER_POLL_SETTINGS', 'wolfsblvt.advancedpolls.activate_poll_scoring' => array('lang' => 'AP_ACT_POLL_SCORING', 'validate' => 'bool', 'type' => 'radio:enabled_disabled', 'explain' => true), 'wolfsblvt.advancedpolls.default_poll_votes_change' => array('lang' => 'AP_DEFAULT_VOTES_CHANGE', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), 'wolfsblvt.advancedpolls.activate_poll_votes_hide' => array('lang' => 'AP_ACT_VOTES_HIDE', 'validate' => 'bool', 'type' => 'radio:enabled_disabled', 'explain' => true), 'wolfsblvt.advancedpolls.default_poll_votes_hide' => array('lang' => 'AP_DEFAULT_VOTES_HIDE', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), 'wolfsblvt.advancedpolls.activate_poll_voters_show' => array('lang' => 'AP_ACT_VOTERS_SHOW', 'validate' => 'bool', 'type' => 'radio:enabled_disabled', 'explain' => true), 'wolfsblvt.advancedpolls.default_poll_voters_show' => array('lang' => 'AP_DEFAULT_VOTERS_SHOW', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), 'wolfsblvt.advancedpolls.activate_poll_voters_limit' => array('lang' => 'AP_ACT_VOTERS_LIMIT', 'validate' => 'bool', 'type' => 'radio:enabled_disabled', 'explain' => true), 'wolfsblvt.advancedpolls.default_poll_voters_limit' => array('lang' => 'AP_DEFAULT_VOTERS_LIMIT', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), 'wolfsblvt.advancedpolls.activate_poll_show_ordered' => array('lang' => 'AP_ACT_SHOW_ORDERED', 'validate' => 'bool', 'type' => 'radio:enabled_disabled', 'explain' => true), 'wolfsblvt.advancedpolls.default_poll_show_ordered' => array('lang' => 'AP_DEFAULT_SHOW_ORDERED', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), 'legend3' => 'ACP_SUBMIT_CHANGES'));
     #region Submit
     if ($submit) {
         $submit = $this->do_submit_stuff($display_vars);
         // If the submit was valid, so still submitted
         if ($submit) {
             trigger_error($this->user->lang('CONFIG_UPDATED') . adm_back_link($this->u_action), E_USER_NOTICE);
         }
     }
     #endregion
     $this->generate_stuff_for_cfg_template($display_vars);
     // Output page template file
     $this->tpl_name = 'acp_advancedpolls';
     $this->page_title = $this->user->lang($display_vars['title']);
 }
コード例 #17
0
 function main($id, $mode)
 {
     global $db, $user, $auth, $template, $cache, $request;
     global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx, $lang;
     $template->assign_vars(array('ACTUAL_STYLE' => $user->style['style_path'], 'MODE' => $mode));
     $submit = request_var('submit', '');
     $form_key = 'gantry';
     add_form_key($form_key);
     $this->new_config = $config;
     $this->request = $request;
     $cfg_array = isset($_REQUEST['config']) ? request_var('config', array('' => '')) : $this->new_config;
     $error = array();
     $this->tpl_name = 'acp_gantryadmin';
     // Save values
     if ($request->is_set_post('submit')) {
         if (!check_form_key($form_key)) {
             trigger_error('FORM_INVALID');
         }
         foreach ($item_list as $item) {
             $config->set((string) $style_prefix . $item, $request->variable((string) $item, ''));
         }
         trigger_error($user->lang['CONFIG_UPDATED'] . adm_back_link($this->u_action));
     }
     // Assign saved values into template
     $template->assign_vars(array('U_ACTION' => $this->u_action));
 }
コード例 #18
0
 function main($id, $mode)
 {
     global $db, $user, $auth, $template, $cache, $request;
     global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx;
     $this->config = $config;
     $this->request = $request;
     $user->add_lang('acp/common');
     $user->add_lang_ext('vinny/shareon', 'acp/info_acp_shareon');
     $this->tpl_name = 'acp_shareon';
     $this->page_title = $user->lang['SHARE_ON_MOD'];
     add_form_key('acp_shareon');
     if ($request->is_set_post('submit')) {
         if (!check_form_key('acp_shareon')) {
             trigger_error('FORM_INVALID');
         }
         $config->set('so_status', $request->variable('so_status', true));
         $config->set('so_type', $request->variable('so_type', true));
         $config->set('so_facebook', $request->variable('so_facebook', true));
         $config->set('so_twitter', $request->variable('so_twitter', true));
         $config->set('so_tuenti', $request->variable('so_tuenti', true));
         $config->set('so_sonico', $request->variable('so_sonico', true));
         $config->set('so_friendfeed', $request->variable('so_friendfeed', true));
         $config->set('so_digg', $request->variable('so_digg', true));
         $config->set('so_reddit', $request->variable('so_reddit', true));
         $config->set('so_delicious', $request->variable('so_delicious', true));
         $config->set('so_vk', $request->variable('so_vk', true));
         $config->set('so_tumblr', $request->variable('so_tumblr', true));
         $config->set('so_google', $request->variable('so_google', true));
         trigger_error($user->lang['SO_SAVED'] . adm_back_link($this->u_action));
     }
     $template->assign_vars(array('SO_STATUS' => !empty($this->config['so_status']) ? true : false, 'SO_TYPE' => !empty($this->config['so_type']) ? true : false, 'SO_FACEBOOK' => !empty($this->config['so_facebook']) ? true : false, 'SO_TWITTER' => !empty($this->config['so_twitter']) ? true : false, 'SO_TUENTI' => !empty($this->config['so_tuenti']) ? true : false, 'SO_SONICO' => !empty($this->config['so_sonico']) ? true : false, 'SO_FRIENDFEED' => !empty($this->config['so_friendfeed']) ? true : false, 'SO_DIGG' => !empty($this->config['so_digg']) ? true : false, 'SO_REDDIT' => !empty($this->config['so_reddit']) ? true : false, 'SO_DELICIOUS' => !empty($this->config['so_delicious']) ? true : false, 'SO_VK' => !empty($this->config['so_vk']) ? true : false, 'SO_TUMBLR' => !empty($this->config['so_tumblr']) ? true : false, 'SO_GOOGLE' => !empty($this->config['so_google']) ? true : false, 'U_ACTION' => $this->u_action));
 }
コード例 #19
0
 function main($id, $mode)
 {
     global $config, $request, $template, $user, $phpbb_log;
     $user->add_lang('acp/common');
     $this->tpl_name = 'acp_postnumbers';
     $this->page_title = $user->lang('POSTNUMBERS_TITLE');
     add_form_key('acp_postnumbers');
     if ($request->is_set_post('submit')) {
         if (!check_form_key('acp_postnumbers')) {
             trigger_error($user->lang('FORM_INVALID') . adm_back_link($this->u_action));
         }
         $config->set('kasimi.postnumbers.enabled.viewtopic', $request->variable('postnumbers_enabled_viewtopic', 0));
         $config->set('kasimi.postnumbers.enabled.review_reply', $request->variable('postnumbers_enabled_review_reply', 0));
         $config->set('kasimi.postnumbers.enabled.review_mcp', $request->variable('postnumbers_enabled_review_mcp', 0));
         $config->set('kasimi.postnumbers.skip_nonapproved', $request->variable('postnumbers_skip_nonapproved', 0));
         $config->set('kasimi.postnumbers.display_ids', $request->variable('postnumbers_display_ids', 0));
         $config->set('kasimi.postnumbers.clipboard', $request->variable('postnumbers_clipboard', 0));
         $config->set('kasimi.postnumbers.bold', $request->variable('postnumbers_bold', 0));
         $user_id = empty($user->data) ? ANONYMOUS : $user->data['user_id'];
         $user_ip = empty($user->ip) ? '' : $user->ip;
         $phpbb_log->add('admin', $user_id, $user_ip, 'POSTNUMBERS_CONFIG_UPDATED');
         trigger_error($user->lang('CONFIG_UPDATED') . adm_back_link($this->u_action));
     }
     $template->assign_vars(array('POSTNUMBERS_VERSION' => isset($config['kasimi.postnumbers.version']) ? $config['kasimi.postnumbers.version'] : 'X.Y.Z', 'POSTNUMBERS_ENABLED_VIEWTOPIC' => isset($config['kasimi.postnumbers.enabled.viewtopic']) ? $config['kasimi.postnumbers.enabled.viewtopic'] : 0, 'POSTNUMBERS_ENABLED_REVIEW_REPLY' => isset($config['kasimi.postnumbers.enabled.review_reply']) ? $config['kasimi.postnumbers.enabled.review_reply'] : 0, 'POSTNUMBERS_ENABLED_REVIEW_MCP' => isset($config['kasimi.postnumbers.enabled.review_mcp']) ? $config['kasimi.postnumbers.enabled.review_mcp'] : 0, 'POSTNUMBERS_SKIP_NONAPPROVED' => isset($config['kasimi.postnumbers.skip_nonapproved']) ? $config['kasimi.postnumbers.skip_nonapproved'] : 0, 'POSTNUMBERS_DISPLAY_IDS' => isset($config['kasimi.postnumbers.display_ids']) ? $config['kasimi.postnumbers.display_ids'] : 0, 'POSTNUMBERS_CLIPBOARD' => isset($config['kasimi.postnumbers.clipboard']) ? $config['kasimi.postnumbers.clipboard'] : 0, 'POSTNUMBERS_BOLD' => isset($config['kasimi.postnumbers.bold']) ? $config['kasimi.postnumbers.bold'] : 0, 'U_ACTION' => $this->u_action));
 }
コード例 #20
0
ファイル: usermap_module.php プロジェクト: tas2580/usermap
 public function main($id, $mode)
 {
     global $config, $user, $template, $request;
     $user->add_lang_ext('tas2580/usermap', 'acp');
     $user->add_lang_ext('tas2580/usermap', 'country_codes');
     $this->user = $user;
     add_form_key('acp_usermap');
     switch ($mode) {
         case 'settings':
             $this->tpl_name = 'acp_usermap_settings';
             $this->page_title = $user->lang('ACP_USERMAP_TITLE');
             // Form is submitted
             if ($request->is_set_post('submit')) {
                 if (!check_form_key('acp_usermap')) {
                     trigger_error($user->lang('FORM_INVALID') . adm_back_link($this->u_action), E_USER_WARNING);
                 }
                 // Set the new settings to config
                 $config->set('tas2580_usermap_lon', substr($request->variable('usermap_lon', ''), 0, 10));
                 $config->set('tas2580_usermap_lat', substr($request->variable('usermap_lat', ''), 0, 10));
                 $config->set('tas2580_usermap_zoom', $request->variable('usermap_zoom', 0));
                 $config->set('tas2580_usermap_map_type', $request->variable('map_type', ''));
                 $config->set('tas2580_usermap_google_api_key', $request->variable('google_api_key', ''));
                 $config->set('tas2580_usermap_bing_api_key', $request->variable('bing_api_key', ''));
                 $config->set('tas2580_usermap_search_distance', $request->variable('search_distance', 0));
                 $config->set('tas2580_usermap_map_in_viewprofile', $request->variable('map_in_viewprofile', 0));
                 $config->set('tas2580_usermap_distance_in_viewtopic', $request->variable('distance_in_viewtopic', 0));
                 $config->set('tas2580_usermap_distance_format', $request->variable('distance_format', 0));
                 $config->set('tas2580_usermap_max_marker', $request->variable('max_marker', 100));
                 $config->set('tas2580_usermap_input_method', $request->variable('input_method', 'zip'));
                 $config->set('tas2580_usermap_force_on_register', $request->variable('force_on_register', 0));
                 $config->set('tas2580_usermap_show_on_register', $request->variable('show_on_register', 0));
                 $config->set('tas2580_usermap_display_coordinates', $request->variable('display_coordinates', 0));
                 $config->set('tas2580_usermap_default_country', $request->variable('default_country', ''));
                 trigger_error($user->lang('ACP_SAVED') . adm_back_link($this->u_action));
             }
             // Send the curent settings to template
             $template->assign_vars(array('U_ACTION' => $this->u_action, 'USERMAP_LON' => $config['tas2580_usermap_lon'], 'USERMAP_LAT' => $config['tas2580_usermap_lat'], 'USERMAP_ZOOM' => $config['tas2580_usermap_zoom'], 'MAP_TYPE_SELECT' => $this->map_select($config['tas2580_usermap_map_type']), 'GOOGLE_API_KEY' => $config['tas2580_usermap_google_api_key'], 'BING_API_KEY' => $config['tas2580_usermap_bing_api_key'], 'SEARCH_DISTANCE' => $config['tas2580_usermap_search_distance'], 'MAP_IN_VIEWPROFILE' => $config['tas2580_usermap_map_in_viewprofile'], 'DISTANCE_IN_VIEWTOPIC' => $config['tas2580_usermap_distance_in_viewtopic'], 'DISTANCE_FORMAT' => $config['tas2580_usermap_distance_format'], 'MAX_MARKER' => $config['tas2580_usermap_max_marker'], 'INPUT_METHOD' => $config['tas2580_usermap_input_method'], 'SHOW_ON_REGISTER' => $config['tas2580_usermap_show_on_register'], 'FORCE_ON_REGISTER' => $config['tas2580_usermap_force_on_register'], 'DISPLAY_COORDINATES' => $config['tas2580_usermap_display_coordinates'], 'COUNTRY_SELECT' => $this->country_code_select($config['tas2580_usermap_default_country'])));
             break;
         case 'things':
             $this->tpl_name = 'acp_usermap_things';
             $this->page_title = $user->lang('ACP_USERMAP_TITLE');
             // Form is submitted
             if ($request->is_set_post('submit')) {
                 if (!check_form_key('acp_usermap')) {
                     trigger_error($user->lang('FORM_INVALID') . adm_back_link($this->u_action), E_USER_WARNING);
                 }
                 // Set the new settings to config
                 $config->set('tas2580_usermap_thing_name', $request->variable('thing_name', '', true));
                 $config->set('tas2580_usermap_allow_bbcode', $request->variable('allow_bbcode', '', true));
                 $config->set('tas2580_usermap_allow_smilies', $request->variable('allow_smilies', '', true));
                 $config->set('tas2580_usermap_allow_urls', $request->variable('allow_urls', '', true));
                 $config->set('tas2580_usermap_allow_img', $request->variable('allow_img', '', true));
                 $config->set('tas2580_usermap_allow_flash', $request->variable('allow_flash', '', true));
                 trigger_error($user->lang('ACP_SAVED') . adm_back_link($this->u_action));
             }
             // Send the curent settings to template
             $template->assign_vars(array('U_ACTION' => $this->u_action, 'THING_NAME' => $config['tas2580_usermap_thing_name'], 'ALLOW_BBCODE' => $config['tas2580_usermap_allow_bbcode'], 'ALLOW_SMILIES' => $config['tas2580_usermap_allow_smilies'], 'ALLOW_URL' => $config['tas2580_usermap_allow_urls'], 'ALLOW_IMG' => $config['tas2580_usermap_allow_img'], 'ALLOW_FLASH' => $config['tas2580_usermap_allow_flash']));
             break;
     }
 }
コード例 #21
0
 function acp_page($id, &$module)
 {
     global $config, $db, $template, $user;
     $captcha_vars = array('recaptcha_pubkey' => 'RECAPTCHA_PUBKEY', 'recaptcha_privkey' => 'RECAPTCHA_PRIVKEY');
     $module->tpl_name = 'captcha_recaptcha_acp';
     $module->page_title = 'ACP_VC_SETTINGS';
     $form_key = 'acp_captcha';
     add_form_key($form_key);
     $submit = request_var('submit', '');
     if ($submit && check_form_key($form_key)) {
         $captcha_vars = array_keys($captcha_vars);
         foreach ($captcha_vars as $captcha_var) {
             $value = request_var($captcha_var, '');
             if ($value) {
                 set_config($captcha_var, $value);
             }
         }
         add_log('admin', 'LOG_CONFIG_VISUAL');
         trigger_error($user->lang['CONFIG_UPDATED'] . adm_back_link($module->u_action));
     } else {
         if ($submit) {
             trigger_error($user->lang['FORM_INVALID'] . adm_back_link($module->u_action));
         } else {
             foreach ($captcha_vars as $captcha_var => $template_var) {
                 $var = isset($_REQUEST[$captcha_var]) ? request_var($captcha_var, '') : (isset($config[$captcha_var]) ? $config[$captcha_var] : '');
                 $template->assign_var($template_var, $var);
             }
             $template->assign_vars(array('CAPTCHA_PREVIEW' => $this->get_demo_template($id), 'CAPTCHA_NAME' => $this->get_service_name(), 'U_ACTION' => $module->u_action));
         }
     }
 }
コード例 #22
0
ファイル: acp_disallow.php プロジェクト: hgchen/phpbb
    function main($id, $mode)
    {
        global $db, $user, $auth, $template, $cache, $phpbb_log, $request;
        global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx;
        include $phpbb_root_path . 'includes/functions_user.' . $phpEx;
        $user->add_lang('acp/posting');
        // Set up general vars
        $this->tpl_name = 'acp_disallow';
        $this->page_title = 'ACP_DISALLOW_USERNAMES';
        $form_key = 'acp_disallow';
        add_form_key($form_key);
        $disallow = isset($_POST['disallow']) ? true : false;
        $allow = isset($_POST['allow']) ? true : false;
        if (($allow || $disallow) && !check_form_key($form_key)) {
            trigger_error($user->lang['FORM_INVALID'] . adm_back_link($this->u_action), E_USER_WARNING);
        }
        if ($disallow) {
            $disallowed_user = str_replace('*', '%', $request->variable('disallowed_user', '', true));
            if (!$disallowed_user) {
                trigger_error($user->lang['NO_USERNAME_SPECIFIED'] . adm_back_link($this->u_action), E_USER_WARNING);
            }
            $sql = 'SELECT disallow_id
				FROM ' . DISALLOW_TABLE . "\n\t\t\t\tWHERE disallow_username = '******'";
            $result = $db->sql_query($sql);
            $row = $db->sql_fetchrow($result);
            $db->sql_freeresult($result);
            if ($row) {
                trigger_error($user->lang['DISALLOWED_ALREADY'] . adm_back_link($this->u_action), E_USER_WARNING);
            }
            $sql = 'INSERT INTO ' . DISALLOW_TABLE . ' ' . $db->sql_build_array('INSERT', array('disallow_username' => $disallowed_user));
            $db->sql_query($sql);
            $cache->destroy('_disallowed_usernames');
            $message = $user->lang['DISALLOW_SUCCESSFUL'];
            $phpbb_log->add('admin', $user->data['user_id'], $user->ip, 'LOG_DISALLOW_ADD', false, array(str_replace('%', '*', $disallowed_user)));
            trigger_error($message . adm_back_link($this->u_action));
        } else {
            if ($allow) {
                $disallowed_id = $request->variable('disallowed_id', 0);
                if (!$disallowed_id) {
                    trigger_error($user->lang['NO_USERNAME_SPECIFIED'] . adm_back_link($this->u_action), E_USER_WARNING);
                }
                $sql = 'DELETE FROM ' . DISALLOW_TABLE . '
				WHERE disallow_id = ' . $disallowed_id;
                $db->sql_query($sql);
                $cache->destroy('_disallowed_usernames');
                $phpbb_log->add('admin', $user->data['user_id'], $user->ip, 'LOG_DISALLOW_DELETE');
                trigger_error($user->lang['DISALLOWED_DELETED'] . adm_back_link($this->u_action));
            }
        }
        // Grab the current list of disallowed usernames...
        $sql = 'SELECT *
			FROM ' . DISALLOW_TABLE;
        $result = $db->sql_query($sql);
        $disallow_select = '';
        while ($row = $db->sql_fetchrow($result)) {
            $disallow_select .= '<option value="' . $row['disallow_id'] . '">' . str_replace('%', '*', $row['disallow_username']) . '</option>';
        }
        $db->sql_freeresult($result);
        $template->assign_vars(array('U_ACTION' => $this->u_action, 'S_DISALLOWED_NAMES' => $disallow_select));
    }
コード例 #23
0
 public function main($id, $mode)
 {
     global $config, $request, $template, $user;
     $this->config = $config;
     $this->request = $request;
     $this->template = $template;
     $this->user = $user;
     $this->user->add_lang('acp/common');
     $this->user->add_lang_ext('phpbbmodders/holidayflare', 'holidayflare_acp');
     $this->tpl_name = 'acp_holidayflare';
     $this->page_title = $this->user->lang('ACP_HOLIDAYFLARE');
     $form_key = 'acp_holidayflare';
     add_form_key($form_key);
     if ($this->request->is_set_post('submit')) {
         if (!check_form_key($form_key)) {
             trigger_error($user->lang('FORM_INVALID') . adm_back_link($this->u_action), E_USER_WARNING);
         }
         /* XMAS Start */
         $enable_xmas = $this->request->variable('enable_xmas', 0);
         $this->config->set('enable_xmas', $enable_xmas);
         /* XMAS Stop */
         /* Valentine Start */
         $enable_valentine = $this->request->variable('enable_valentine', 0);
         $this->config->set('enable_valentine', $enable_valentine);
         /* Valentine Stop */
         trigger_error($this->user->lang('CONFIG_UPDATED') . adm_back_link($this->u_action));
     }
     $this->template->assign_vars(array('S_ENABLE_XMAS' => isset($this->config['enable_xmas']) ? $this->config['enable_xmas'] : '', 'S_ENABLE_VALENTINE' => isset($this->config['enable_valentine']) ? $this->config['enable_valentine'] : '', 'U_ACTION' => $this->u_action));
 }
コード例 #24
0
 function main($id, $mode)
 {
     global $phpbb_container, $user, $template, $config, $request;
     $this->phpbb_container = $phpbb_container;
     $this->user = $user;
     $this->template = $template;
     $this->config = $config;
     $this->request = $request;
     $this->log = $this->phpbb_container->get('log');
     $this->tpl_name = 'acp_codebox_plus';
     $this->page_title = $this->user->lang('CODEBOX_PLUS_TITLE');
     add_form_key('o0johntam0o/acp_codebox_plus');
     if ($this->request->is_set_post('submit')) {
         if (!check_form_key('o0johntam0o/acp_codebox_plus')) {
             trigger_error('FORM_INVALID');
         }
         $this->config->set('codebox_plus_syntax_highlighting', $request->variable('codebox_plus_syntax_highlighting', 0));
         $this->config->set('codebox_plus_expanded', $request->variable('codebox_plus_expanded', 0));
         $this->config->set('codebox_plus_download', $request->variable('codebox_plus_download', 0));
         $this->config->set('codebox_plus_login_required', $request->variable('codebox_plus_login_required', 0));
         $this->config->set('codebox_plus_prevent_bots', $request->variable('codebox_plus_prevent_bots', 0));
         $this->config->set('codebox_plus_captcha', $request->variable('codebox_plus_captcha', 0));
         $this->config->set('codebox_plus_max_attempt', $request->variable('codebox_plus_max_attempt', 0));
         $this->log->add('admin', $this->user->data['user_id'], $this->user->ip, 'CODEBOX_PLUS_LOG_MSG');
         trigger_error($this->user->lang('CODEBOX_PLUS_SAVED') . adm_back_link($this->u_action));
     }
     $this->template->assign_vars(array('U_ACTION' => $this->u_action, 'S_CODEBOX_PLUS_VERSION' => isset($this->config['codebox_plus_version']) ? $this->config['codebox_plus_version'] : 0, 'S_CODEBOX_PLUS_SYNTAX_HIGHLIGHTING' => isset($this->config['codebox_plus_syntax_highlighting']) ? $this->config['codebox_plus_syntax_highlighting'] : 0, 'S_CODEBOX_PLUS_EXPANDED' => isset($this->config['codebox_plus_expanded']) ? $this->config['codebox_plus_expanded'] : 0, 'S_CODEBOX_PLUS_DOWNLOAD' => isset($this->config['codebox_plus_download']) ? $this->config['codebox_plus_download'] : 0, 'S_CODEBOX_PLUS_LOGIN_REQUIRED' => isset($this->config['codebox_plus_login_required']) ? $this->config['codebox_plus_login_required'] : 0, 'S_CODEBOX_PLUS_PREVENT_BOTS' => isset($this->config['codebox_plus_prevent_bots']) ? $this->config['codebox_plus_prevent_bots'] : 0, 'S_CODEBOX_PLUS_CAPTCHA' => isset($this->config['codebox_plus_captcha']) ? $this->config['codebox_plus_captcha'] : 0, 'S_CODEBOX_PLUS_MAX_ATTEMPT' => isset($this->config['codebox_plus_max_attempt']) ? $this->config['codebox_plus_max_attempt'] : 0));
 }
コード例 #25
0
ファイル: usermap_module.php プロジェクト: pierrdu/usermap
 public function main($id, $mode)
 {
     global $config, $user, $template, $request;
     $this->tpl_name = 'acp_usermap_body';
     $this->page_title = $user->lang('ACP_USERMAP_TITLE');
     $user->add_lang_ext('tas2580/usermap', 'acp');
     add_form_key('acp_usermap');
     // Form is submitted
     if ($request->is_set_post('submit')) {
         if (!check_form_key('acp_usermap')) {
             trigger_error($user->lang('FORM_INVALID') . adm_back_link($this->u_action), E_USER_WARNING);
         }
         // Set the new settings to config
         $config->set('tas2580_usermap_lon', substr($request->variable('usermap_lon', ''), 0, 10));
         $config->set('tas2580_usermap_lat', substr($request->variable('usermap_lat', ''), 0, 10));
         $config->set('tas2580_usermap_zoom', $request->variable('usermap_zoom', 0));
         $config->set('tas2580_usermap_map_type', $request->variable('map_type', ''));
         $config->set('tas2580_usermap_google_api_key', $request->variable('google_api_key', ''));
         $config->set('tas2580_usermap_search_distance', $request->variable('search_distance', 0));
         $config->set('tas2580_usermap_map_in_viewprofile', $request->variable('map_in_viewprofile', 0));
         $config->set('tas2580_usermap_distance_in_viewtopic', $request->variable('distance_in_viewtopic', 0));
         $config->set('tas2580_usermap_distance_format', $request->variable('distance_format', 0));
         $config->set('tas2580_usermap_max_marker', $request->variable('max_marker', 100));
         trigger_error($user->lang('ACP_SAVED') . adm_back_link($this->u_action));
     }
     // Send the curent settings to template
     $template->assign_vars(array('U_ACTION' => $this->u_action, 'USERMAP_LON' => $config['tas2580_usermap_lon'], 'USERMAP_LAT' => $config['tas2580_usermap_lat'], 'USERMAP_ZOOM' => $config['tas2580_usermap_zoom'], 'MAP_TYPE_SELECT' => $this->map_select($config['tas2580_usermap_map_type']), 'GOOGLE_API_KEY' => $config['tas2580_usermap_google_api_key'], 'SEARCH_DISTANCE' => $config['tas2580_usermap_search_distance'], 'MAP_IN_VIEWPROFILE' => $config['tas2580_usermap_map_in_viewprofile'], 'DISTANCE_IN_VIEWTOPIC' => $config['tas2580_usermap_distance_in_viewtopic'], 'DISTANCE_FORMAT' => $config['tas2580_usermap_distance_format'], 'MAX_MARKER' => $config['tas2580_usermap_max_marker']));
 }
コード例 #26
0
 function main($id, $mode)
 {
     global $db, $user, $auth, $template, $cache, $request;
     global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx;
     $this->tpl_name = 'acp_countdown_config';
     $this->page_title = $user->lang['COUNTDOWN_CONFIG'];
     add_form_key('acp_countdown_config');
     $submit = $request->is_set_post('submit');
     if ($submit) {
         if (!check_form_key('acp_countdown_config')) {
             trigger_error('FORM_INVALID');
         }
         $config->set('countdown_enable', $request->variable('countdown_enable', 0));
         $config->set('countdown_testmode', $request->variable('countdown_testmode', 0));
         $config->set('countdown_direction', $request->variable('countdown_direction', 0));
         $config->set('countdown_date', $request->variable('countdown_date', ''));
         $config->set('countdown_offset_enable', $request->variable('countdown_offset_enable', 0));
         $config->set('countdown_offset', $request->variable('countdown_offset', ''));
         $config->set('countdown_year', $request->variable('countdown_year', 0));
         $config->set('countdown_month', $request->variable('countdown_month', 0));
         $config->set('countdown_text', utf8_normalize_nfc($request->variable('countdown_text', '', true)));
         $config->set('countdown_complete', utf8_normalize_nfc($request->variable('countdown_complete', '', true)));
         trigger_error($user->lang['COUNTDOWN_CONFIG_SAVED'] . adm_back_link($this->u_action));
     }
     $template->assign_vars(array('COUNTDOWN_VERSION' => isset($config['countdown_version']) ? $config['countdown_version'] : '', 'COUNTDOWN_ENABLE' => !empty($config['countdown_enable']) ? true : false, 'COUNTDOWN_TESTMODE' => !empty($config['countdown_testmode']) ? true : false, 'COUNTDOWN_DIRECTION' => !empty($config['countdown_direction']) ? true : false, 'COUNTDOWN_DATE' => isset($config['countdown_date']) ? $config['countdown_date'] : '', 'COUNTDOWN_OFFSET_ENABLE' => !empty($config['countdown_offset_enable']) ? true : false, 'COUNTDOWN_OFFSET' => isset($config['countdown_offset']) ? $config['countdown_offset'] : '', 'COUNTDOWN_YEAR' => !empty($config['countdown_year']) ? true : false, 'COUNTDOWN_MONTH' => !empty($config['countdown_month']) ? true : false, 'COUNTDOWN_TEXT' => isset($config['countdown_text']) ? $config['countdown_text'] : '', 'COUNTDOWN_COMPLETE' => isset($config['countdown_complete']) ? $config['countdown_complete'] : '', 'U_ACTION' => $this->u_action));
 }
コード例 #27
0
ファイル: gd.php プロジェクト: ZerGabriel/phpbb
 function acp_page($id, &$module)
 {
     global $db, $user, $auth, $template, $phpbb_log, $request;
     global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx;
     $user->add_lang('acp/board');
     $config_vars = array('enable_confirm' => 'REG_ENABLE', 'enable_post_confirm' => 'POST_ENABLE', 'confirm_refresh' => 'CONFIRM_REFRESH', 'captcha_gd' => 'CAPTCHA_GD');
     $module->tpl_name = 'captcha_gd_acp';
     $module->page_title = 'ACP_VC_SETTINGS';
     $form_key = 'acp_captcha';
     add_form_key($form_key);
     $submit = $request->variable('submit', '');
     if ($submit && check_form_key($form_key)) {
         $captcha_vars = array_keys($this->captcha_vars);
         foreach ($captcha_vars as $captcha_var) {
             $value = $request->variable($captcha_var, 0);
             if ($value >= 0) {
                 $config->set($captcha_var, $value);
             }
         }
         $phpbb_log->add('admin', $user->data['user_id'], $user->ip, 'LOG_CONFIG_VISUAL');
         trigger_error($user->lang['CONFIG_UPDATED'] . adm_back_link($module->u_action));
     } else {
         if ($submit) {
             trigger_error($user->lang['FORM_INVALID'] . adm_back_link($module->u_action));
         } else {
             foreach ($this->captcha_vars as $captcha_var => $template_var) {
                 $var = isset($_REQUEST[$captcha_var]) ? $request->variable($captcha_var, 0) : $config[$captcha_var];
                 $template->assign_var($template_var, $var);
             }
             $template->assign_vars(array('CAPTCHA_PREVIEW' => $this->get_demo_template($id), 'CAPTCHA_NAME' => $this->get_service_name(), 'U_ACTION' => $module->u_action));
         }
     }
 }
コード例 #28
0
ファイル: acp_ban.php プロジェクト: ahmatjan/Crimson
 function main($id, $mode)
 {
     global $config, $db, $user, $auth, $template, $cache;
     global $phpbb_root_path, $phpbb_admin_path, $phpEx, $table_prefix;
     include $phpbb_root_path . 'includes/functions_user.' . $phpEx;
     $bansubmit = isset($_POST['bansubmit']) ? true : false;
     $unbansubmit = isset($_POST['unbansubmit']) ? true : false;
     $current_time = time();
     $user->add_lang(array('acp/ban', 'acp/users'));
     $this->tpl_name = 'acp_ban';
     $form_key = 'acp_ban';
     add_form_key($form_key);
     if (($bansubmit || $unbansubmit) && !check_form_key($form_key)) {
         trigger_error($user->lang['FORM_INVALID'] . adm_back_link($this->u_action), E_USER_WARNING);
     }
     // Ban submitted?
     if ($bansubmit) {
         // Grab the list of entries
         $ban = utf8_normalize_nfc(request_var('ban', '', true));
         $ban_len = request_var('banlength', 0);
         $ban_len_other = request_var('banlengthother', '');
         $ban_exclude = request_var('banexclude', 0);
         $ban_reason = utf8_normalize_nfc(request_var('banreason', '', true));
         $ban_give_reason = utf8_normalize_nfc(request_var('bangivereason', '', true));
         if ($ban) {
             user_ban($mode, $ban, $ban_len, $ban_len_other, $ban_exclude, $ban_reason, $ban_give_reason);
             trigger_error($user->lang['BAN_UPDATE_SUCCESSFUL'] . adm_back_link($this->u_action));
         }
     } else {
         if ($unbansubmit) {
             $ban = request_var('unban', array(''));
             if ($ban) {
                 user_unban($mode, $ban);
                 trigger_error($user->lang['BAN_UPDATE_SUCCESSFUL'] . adm_back_link($this->u_action));
             }
         }
     }
     // Define language vars
     $this->page_title = $user->lang[strtoupper($mode) . '_BAN'];
     $l_ban_explain = $user->lang[strtoupper($mode) . '_BAN_EXPLAIN'];
     $l_ban_exclude_explain = $user->lang[strtoupper($mode) . '_BAN_EXCLUDE_EXPLAIN'];
     $l_unban_title = $user->lang[strtoupper($mode) . '_UNBAN'];
     $l_unban_explain = $user->lang[strtoupper($mode) . '_UNBAN_EXPLAIN'];
     $l_no_ban_cell = $user->lang[strtoupper($mode) . '_NO_BANNED'];
     switch ($mode) {
         case 'user':
             $l_ban_cell = $user->lang['USERNAME'];
             break;
         case 'ip':
             $l_ban_cell = $user->lang['IP_HOSTNAME'];
             break;
         case 'email':
             $l_ban_cell = $user->lang['EMAIL_ADDRESS'];
             break;
     }
     $this->display_ban_options($mode);
     $template->assign_vars(array('L_TITLE' => $this->page_title, 'L_EXPLAIN' => $l_ban_explain, 'L_UNBAN_TITLE' => $l_unban_title, 'L_UNBAN_EXPLAIN' => $l_unban_explain, 'L_BAN_CELL' => $l_ban_cell, 'L_BAN_EXCLUDE_EXPLAIN' => $l_ban_exclude_explain, 'L_NO_BAN_CELL' => $l_no_ban_cell, 'S_USERNAME_BAN' => $mode == 'user' ? true : false, 'U_ACTION' => $this->u_action, 'U_FIND_USERNAME' => append_sid("{$phpbb_root_path}memberlist.{$phpEx}", 'mode=searchuser&amp;form=acp_ban&amp;field=ban')));
 }
コード例 #29
0
ファイル: ext.php プロジェクト: david63/david63-pmstats
 /**
  * Enable extension if phpBB version requirement is met
  *
  * @var string Require 3.2.0-a1 due to updated 3.2 syntax
  *
  * @return bool
  * @access public
  */
 public function is_enableable()
 {
     $config = $this->container->get('config');
     if (!phpbb_version_compare($config['version'], '3.2.0-a1', '>=')) {
         $this->container->get('language')->add_lang('ext_pmstats', 'david63/pmstats');
         trigger_error($this->container->get('language')->lang('VERSION_32') . adm_back_link(append_sid('index.' . $this->container->getParameter('core.php_ext'), 'i=acp_extensions&amp;mode=main')), E_USER_WARNING);
     } else {
         return true;
     }
 }
コード例 #30
0
 function main($id, $mode)
 {
     global $db, $user, $auth, $template, $cache, $request;
     global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx;
     $this->config = $config;
     $this->request = $request;
     $user->add_lang('acp/common');
     $user->add_lang_ext('v12mike/postoftheday', 'acp/info_acp_postoftheday');
     $this->tpl_name = 'acp_postoftheday';
     $this->page_title = $user->lang['POTD_EXT'];
     add_form_key('acp_postoftheday');
     if ($request->is_set_post('submit')) {
         if (!check_form_key('acp_postoftheday')) {
             trigger_error('FORM_INVALID');
         }
         if (!function_exists('validate_data')) {
             include $phpbb_root_path . 'includes/functions_user.' . $phpEx;
         }
         $check_row = array('post_of_the_day_how_many_today' => $request->variable('post_of_the_day_how_many_today', 0));
         $validate_row = array('post_of_the_day_how_many_today' => array('num', false, 0, 20));
         $error = validate_data($check_row, $validate_row);
         // Replace "error" strings with their real, localised form
         $error = array_map(array($user, 'lang'), $error);
         if (!sizeof($error)) {
             $check_row = array('post_of_the_day_how_many_this_week' => $request->variable('post_of_the_day_how_many_this_week', 0));
             $validate_row = array('post_of_the_day_how_many_this_week' => array('num', false, 0, 20));
             $error = validate_data($check_row, $validate_row);
             // Replace "error" strings with their real, localised form
             $error = array_map(array($user, 'lang'), $error);
         }
         if (!sizeof($error)) {
             $check_row = array('post_of_the_day_how_many_this_month' => $request->variable('post_of_the_day_how_many_this_month', 0));
             $validate_row = array('post_of_the_day_how_many_this_month' => array('num', false, 0, 20));
             $error = validate_data($check_row, $validate_row);
             // Replace "error" strings with their real, localised form
             $error = array_map(array($user, 'lang'), $error);
         }
         if (!sizeof($error)) {
             $check_row = array('post_of_the_day_how_many_this_year' => $request->variable('post_of_the_day_how_many_this_year', 0));
             $validate_row = array('post_of_the_day_how_many_this_year' => array('num', false, 0, 20));
             $error = validate_data($check_row, $validate_row);
             // Replace "error" strings with their real, localised form
             $error = array_map(array($user, 'lang'), $error);
         }
         if (!sizeof($error)) {
             $config->set('post_of_the_day_how_many_today', $request->variable('post_of_the_day_how_many_today', 0));
             $config->set('post_of_the_day_how_many_this_week', $request->variable('post_of_the_day_how_many_this_week', 0));
             $config->set('post_of_the_day_how_many_this_month', $request->variable('post_of_the_day_how_many_this_month', 0));
             $config->set('post_of_the_day_how_many_this_year', $request->variable('post_of_the_day_how_many_this_year', 0));
             $config->set('post_of_the_day_location', $request->variable('post_of_the_day_location', true));
             trigger_error($user->lang['POTD_SAVED'] . adm_back_link($this->u_action));
         }
     }
     $template->assign_vars(array('POTD_ERROR' => isset($error) ? sizeof($error) ? implode('<br />', $error) : '' : '', 'HOWMANY_TODAY' => !empty($this->config['post_of_the_day_how_many_today']) ? $this->config['post_of_the_day_how_many_today'] : 0, 'HOWMANY_THIS_WEEK' => !empty($this->config['post_of_the_day_how_many_this_week']) ? $this->config['post_of_the_day_how_many_this_week'] : 0, 'HOWMANY_THIS_MONTH' => !empty($this->config['post_of_the_day_how_many_this_month']) ? $this->config['post_of_the_day_how_many_this_month'] : 0, 'HOWMANY_THIS_YEAR' => !empty($this->config['post_of_the_day_how_many_this_year']) ? $this->config['post_of_the_day_how_many_this_year'] : 0, 'LOCATION' => !empty($this->config['post_of_the_day_location']) ? true : false, 'POTD_VERSION' => $this->config['post_of_the_day_version'], 'U_ACTION' => $this->u_action));
 }