예제 #1
0
 function __construct(viewNavigation $Navigation)
 {
     global $phpbb_root_path, $phpEx;
     $this->Raids = new \bbdkp\controller\raids\Raids();
     $this->PointsController = new \bbdkp\controller\points\PointsController();
     $this->PointsController->guild_id = $Navigation->getGuildId();
     $this->PointsController->query_by_pool = $Navigation->getQueryByPool();
     $this->PointsController->dkpsys_id = $Navigation->getDkpsysId();
     $this->PointsController->show_inactive = $Navigation->getShowAll();
     $this->PointsController->query_by_armor = $Navigation->getQueryByArmor();
     $this->PointsController->armor_filter = '';
     if ($this->PointsController->query_by_armor) {
         $this->PointsController->armor_filter = $Navigation->getFilter();
     }
     $this->PointsController->query_by_class = $Navigation->getQueryByClass();
     $this->PointsController->class_id = 0;
     if ($this->PointsController->query_by_class) {
         $this->PointsController->class_id = $Navigation->getClassId();
     }
     $this->PointsController->query_by_rank = false;
     $this->PointsController->rankfilter = '';
     if (request_var('rank', '') != '') {
         $this->PointsController->query_by_rank = true;
         $this->PointsController->rankfilter = request_var('rank', '');
     }
     $this->PointsController->member_filter = utf8_normalize_nfc(request_var('member_name', '', true));
     $this->PointsController->query_by_name = false;
     if ($this->PointsController->member_filter != '') {
         $this->PointsController->query_by_name = true;
     }
     $this->start = request_var('start', 0, false);
     $this->u_listmemberdkp = append_sid("{$phpbb_root_path}dkp.{$phpEx}", 'page=standings' . '&guild_id=' . $Navigation->getGuildId() . '&' . URI_DKPSYS . '=' . $this->PointsController->dkpsys_id . '&member_name=' . urlencode($this->PointsController->member_filter));
     $this->buildpage($Navigation);
 }
예제 #2
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));
 }
예제 #3
0
 /**
  * Insert the image into the database
  */
 public static function upload_image(&$image_data, $album_id)
 {
     global $user, $db;
     $sql_ary = array('image_filename' => $image_data['filename'], 'image_name' => $image_data['image_name'], 'image_name_clean' => utf8_clean_string($image_data['image_name']), 'image_user_id' => $user->data['user_id'], 'image_user_colour' => $user->data['user_colour'], 'image_username' => $image_data['username'], 'image_username_clean' => utf8_clean_string($image_data['username']), 'image_user_ip' => $user->ip, 'image_time' => $image_data['image_time'], 'image_album_id' => $image_data['image_album_id'], 'image_status' => phpbb_gallery::$auth->acl_check('i_approve', $album_id) ? phpbb_gallery_image::STATUS_APPROVED : phpbb_gallery_image::STATUS_UNAPPROVED, 'filesize_upload' => $image_data['image_filesize'], 'image_contest' => $image_data['image_contest'], 'image_exif_data' => $image_data['image_exif_data'], 'image_has_exif' => $image_data['image_has_exif']);
     $message_parser = new parse_message();
     $message_parser->message = utf8_normalize_nfc($image_data['image_desc']);
     if ($message_parser->message) {
         $message_parser->parse(true, true, true, true, false, true, true, true);
         $sql_ary['image_desc'] = $message_parser->message;
         $sql_ary['image_desc_uid'] = $message_parser->bbcode_uid;
         $sql_ary['image_desc_bitfield'] = $message_parser->bbcode_bitfield;
     } else {
         $sql_ary['image_desc'] = '';
         $sql_ary['image_desc_uid'] = '';
         $sql_ary['image_desc_bitfield'] = '';
     }
     $sql = 'INSERT INTO ' . GALLERY_IMAGES_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary);
     $db->sql_query($sql);
     $image_id = $db->sql_nextid();
     if (phpbb_gallery::$user->get_data('watch_own')) {
         $sql_ary = array('image_id' => $image_id, 'user_id' => $user->data['user_id']);
         $sql = 'INSERT INTO ' . GALLERY_WATCH_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary);
         $db->sql_query($sql);
     }
     return array('image_id' => $image_id, 'image_name' => $image_data['image_name']);
 }
 /**
  * Set the options a user can configure
  *
  * @return null
  * @access protected
  */
 protected function set_options()
 {
     global $config, $request;
     $config->set('appform_forum_id', $request->variable('appform_forum_id', 0));
     $config->set('appform_positions', utf8_normalize_nfc($request->variable('appform_positions', '', true)));
     $config->set('appform_nru', $request->variable('appform_nru', 0));
 }
예제 #5
0
 /**
  * acp_module()
  * retunrs the acp config
  * @access private
  */
 function acp_module()
 {
     global $config, $phpbb_seo, $user;
     $config['sitename'] = utf8_normalize_nfc($config['sitename']);
     $config['site_desc'] = utf8_normalize_nfc($config['site_desc']);
     return array('cache' => array('display_vars' => array('title' => 'GYM_CACHE', 'vars' => array('legend1' => 'GYM_CACHE', 'rss_cache_on' => array('lang' => 'GYM_CACHE_ON', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true, 'overriding' => true), 'rss_cache_force_gzip' => array('lang' => 'GYM_CACHE_FORCE_GZIP', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true, 'overriding' => true), 'rss_cache_max_age' => array('lang' => 'GYM_CACHE_MAX_AGE', 'validate' => 'string', 'type' => 'text:4:4', 'explain' => true, 'overriding' => true), 'rss_cache_auto_regen' => array('lang' => 'GYM_CACHE_AUTO_REGEN', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), 'rss_showstats' => array('lang' => 'GYM_SHOWSTATS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true, 'overriding' => true))), 'default' => array('rss_cache_on' => 0, 'rss_cache_force_gzip' => 0, 'rss_cache_max_age' => 6, 'rss_cache_auto_regen' => 1, 'rss_showstats' => 1)), 'modrewrite' => array('display_vars' => array('title' => 'GYM_MODREWRITE', 'vars' => array('legend1' => 'GYM_MODREWRITE', 'rss_modrewrite' => array('lang' => 'GYM_MODREWRITE_ON', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true, 'overriding' => true), 'rss_modrtype' => array('lang' => 'GYM_MODRTYPE', 'validate' => 'string', 'type' => 'select', 'method' => 'select_string', 'explain' => true, 'overriding' => true), 'rss_1xredir' => array('lang' => 'RSS_1XREDIR', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true))), 'default' => array('rss_modrewrite' => 0, 'rss_modrtype' => 0, 'rss_1xredir' => 0), 'select' => array('rss_modrtype' => @$this->dyn_select['modrtype'])), 'gzip' => array('display_vars' => array('title' => 'GYM_GZIP', 'vars' => array('legend4' => 'GYM_GZIP', 'rss_gzip' => array('lang' => 'GYM_GZIP_ON', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true, 'overriding' => true), 'rss_gzip_ext' => array('lang' => 'GYM_GZIP_EXT', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true, 'overriding' => true))), 'default' => array('rss_gzip' => 0, 'rss_gzip_ext' => 1)), 'limit' => array('display_vars' => array('title' => 'GYM_LIMIT', 'vars' => array('legend1' => 'RSS_LIMIT_GEN', 'rss_url_limit' => array('lang' => 'GYM_URL_LIMIT', 'validate' => 'int:0:5000', 'type' => 'text:4:4', 'explain' => true, 'overriding' => true), 'rss_sql_limit' => array('lang' => 'GYM_SQL_LIMIT', 'validate' => 'int:0:1000', 'type' => 'text:4:4', 'explain' => true, 'overriding' => true), 'rss_time_limit' => array('lang' => 'GYM_TIME_LIMIT', 'validate' => 'int:0:1000', 'type' => 'text:4:4', 'explain' => true, 'overriding' => true), 'legend2' => 'RSS_LIMIT_SPEC', 'rss_url_limit_long' => array('lang' => 'RSS_URL_LIMIT_LONG', 'validate' => 'int:0:5000', 'type' => 'text:4:4', 'explain' => true), 'rss_sql_limit_long' => array('lang' => 'RSS_SQL_LIMIT_LONG', 'validate' => 'int:0:1000', 'type' => 'text:4:4', 'explain' => true), 'rss_url_limit_short' => array('lang' => 'RSS_URL_LIMIT_SHORT', 'validate' => 'int:0:5000', 'type' => 'text:4:4', 'explain' => true), 'rss_sql_limit_short' => array('lang' => 'RSS_SQL_LIMIT_SHORT', 'validate' => 'int:0:1000', 'type' => 'text:4:4', 'explain' => true), 'rss_url_limit_msg' => array('lang' => 'RSS_URL_LIMIT_MSG', 'validate' => 'int:0:1000', 'type' => 'text:4:4', 'explain' => true), 'rss_sql_limit_msg' => array('lang' => 'RSS_SQL_LIMIT_MSG', 'validate' => 'int:0:500', 'type' => 'text:4:4', 'explain' => true))), 'default' => array('rss_url_limit' => 50, 'rss_sql_limit' => 20, 'rss_time_limit' => 15, 'rss_url_limit_long' => 100, 'rss_sql_limit_long' => 25, 'rss_url_limit_short' => 10, 'rss_sql_limit_short' => 10, 'rss_url_limit_msg' => 15, 'rss_sql_limit_msg' => 15)), 'sort' => array('display_vars' => array('title' => 'GYM_SORT', 'vars' => array('legend1' => 'GYM_SORT', 'rss_sort' => array('lang' => 'GYM_SORT_TYPE', 'validate' => 'string', 'type' => 'select', 'method' => 'select_string', 'explain' => true, 'overriding' => true))), 'default' => array('rss_sort' => 'DESC'), 'select' => array('rss_sort' => @$this->dyn_select['sort'])), 'pagination' => array('display_vars' => array('title' => 'GYM_PAGINATION', 'vars' => array('legend1' => 'GYM_PAGINATION', 'rss_pagination' => array('lang' => 'GYM_PAGINATION_ON', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true, 'overriding' => true), 'rss_limitdown' => array('lang' => 'GYM_LIMITDOWN', 'validate' => 'int:0', 'type' => 'text:4:4', 'explain' => true, 'overriding' => true), 'rss_limitup' => array('lang' => 'GYM_LIMITUP', 'validate' => 'int:0', 'type' => 'text:4:4', 'explain' => true, 'overriding' => true))), 'default' => array('rss_pagination' => 1, 'rss_limitdown' => 3, 'rss_limitup' => 5)), 'override' => array('display_vars' => array('title' => 'GYM_OVERRIDE', 'vars' => array('legend1' => 'GYM_OVERRIDE', 'rss_override' => array('lang' => 'GYM_OVERRIDE_MAIN', 'validate' => 'string', 'type' => 'select', 'method' => 'select_string', 'explain' => true), 'rss_override_cache' => array('lang' => 'GYM_OVERRIDE_CACHE', 'validate' => 'string', 'type' => 'select', 'method' => 'select_string', 'explain' => true), 'rss_override_modrewrite' => array('lang' => 'GYM_OVERRIDE_MODREWRITE', 'validate' => 'string', 'type' => 'select', 'method' => 'select_string', 'explain' => true), 'rss_override_gzip' => array('lang' => 'GYM_OVERRIDE_GZIP', 'validate' => 'string', 'type' => 'select', 'method' => 'select_string', 'explain' => true), 'rss_override_limit' => array('lang' => 'GYM_OVERRIDE_LIMIT', 'validate' => 'string', 'type' => 'select', 'method' => 'select_string', 'explain' => true), 'rss_override_sort' => array('lang' => 'GYM_OVERRIDE_SORT', 'validate' => 'string', 'type' => 'select', 'method' => 'select_string', 'explain' => true), 'rss_override_pagination' => array('lang' => 'GYM_OVERRIDE_PAGINATION', 'validate' => 'string', 'type' => 'select', 'method' => 'select_string', 'explain' => true))), 'default' => array('rss_override' => OVERRIDE_MODULE, 'rss_override_cache' => OVERRIDE_OTYPE, 'rss_override_modrewrite' => OVERRIDE_OTYPE, 'rss_override_gzip' => OVERRIDE_GLOBAL, 'rss_override_limit' => OVERRIDE_OTYPE, 'rss_override_sort' => OVERRIDE_MODULE, 'rss_override_pagination' => OVERRIDE_OTYPE), 'select' => array('rss_override' => $this->rss_override, 'rss_override_cache' => @$this->dyn_select['override'], 'rss_override_modrewrite' => @$this->dyn_select['override'], 'rss_override_gzip' => @$this->dyn_select['override'], 'rss_override_limit' => @$this->dyn_select['override'], 'rss_override_sort' => @$this->dyn_select['override'], 'rss_override_pagination' => @$this->dyn_select['override'])), 'main' => array('display_vars' => array('title' => 'RSS_MAIN', 'vars' => array('legend1' => 'RSS_URL', 'rss_url' => array('lang' => 'RSS_URL', 'validate' => 'string', 'type' => 'text:40:255', 'explain' => true), 'legend2' => 'RSS_LINKS_ACTIVATION', 'rss_link_main' => array('lang' => 'RSS_LINKS_MAIN', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), 'rss_link_index' => array('lang' => 'RSS_LINKS_INDEX', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), 'rss_link_cat' => array('lang' => 'RSS_LINKS_CAT', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), 'rss_alternate' => array('lang' => 'RSS_ALTERNATE', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), 'rss_linking_type' => array('lang' => 'RSS_LINKING_TYPE', 'validate' => 'string', 'type' => 'select', 'method' => 'select_string', 'explain' => true), 'legend3' => 'RSS_SETTINGS', 'rss_c_info' => array('lang' => 'RSS_C_INFO', 'validate' => 'string', 'type' => 'text:40:255', 'explain' => true), 'rss_sitename' => array('lang' => 'RSS_SITENAME', 'validate' => 'string', 'type' => 'text:40:255', 'explain' => true), 'rss_site_desc' => array('lang' => 'RSS_SITE_DESC', 'validate' => 'string', 'type' => 'textarea:6:50', 'explain' => true), 'rss_logo_url' => array('lang' => 'RSS_LOGO_URL', 'validate' => 'string', 'type' => 'text:25:200', 'explain' => true), 'rss_image_url' => array('lang' => 'RSS_IMAGE_URL', 'validate' => 'string', 'type' => 'text:25:200', 'explain' => true), 'rss_lang' => array('lang' => 'RSS_LANG', 'validate' => 'string', 'type' => 'select', 'method' => 'select_string', 'explain' => true), 'legend4' => 'RSS_AUTH_SETTINGS', 'rss_allow_auth' => array('lang' => 'RSS_ALLOW_AUTH', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), 'rss_cache_auth' => array('lang' => 'RSS_CACHE_AUTH', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), 'legend5' => 'RSS_NOTIFY', 'rss_yahoo_notify' => array('lang' => 'RSS_YAHOO_NOTIFY', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), 'rss_yahoo_appid' => array('lang' => 'RSS_YAHOO_APPID', 'validate' => 'string', 'type' => 'text:25:200', 'explain' => true), 'legend6' => 'RSS_STYLE', 'rss_xslt' => array('lang' => 'RSS_XSLT', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), 'rss_force_xslt' => array('lang' => 'RSS_FORCE_XSLT', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), 'rss_load_phpbb_css' => array('lang' => 'RSS_LOAD_PHPBB_CSS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true))), 'default' => array('rss_url' => $phpbb_seo->seo_path['phpbb_url'], 'rss_link_main' => 1, 'rss_link_index' => 1, 'rss_link_cat' => 1, 'rss_alternate' => 1, 'rss_linking_type' => 'n', 'rss_c_info' => $config['sitename'], 'rss_sitename' => $config['sitename'], 'rss_site_desc' => $config['site_desc'], 'rss_logo_url' => 'logo.gif', 'rss_image_url' => 'rss_forum_big.gif', 'rss_lang' => $config['default_lang'], 'rss_allow_auth' => 0, 'rss_cache_auth' => 1, 'rss_yahoo_notify' => 0, 'rss_yahoo_appid' => '', 'rss_xslt' => 1, 'rss_force_xslt' => 1, 'rss_load_phpbb_css' => 0), 'select' => array('rss_lang' => $user->lang['ISO_639_1'], 'rss_linking_type' => @$this->dyn_select['rss_linking_types'])), 'content' => array('display_vars' => array('title' => 'RSS_CONTENT', 'vars' => array('legend1' => 'RSS_CONTENT', 'rss_allow_news' => array('lang' => 'RSS_ALLOW_NEWS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), 'rss_news_update' => array('lang' => 'RSS_NEWS_UPDATE', 'validate' => 'string', 'type' => 'text:4:4', 'explain' => true), 'rss_allow_short' => array('lang' => 'RSS_ALLOW_SHORT', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), 'rss_allow_long' => array('lang' => 'RSS_ALLOW_LONG', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), 'rss_allow_content' => array('lang' => 'RSS_ALLOW_CONTENT', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), 'rss_allow_profile' => array('lang' => 'RSS_ALLOW_PROFILE', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), 'rss_allow_profile_links' => array('lang' => 'RSS_ALLOW_PROFILE_LINKS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), 'rss_allow_bbcode' => array('lang' => 'RSS_ALLOW_BBCODE', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), 'rss_strip_bbcode' => array('lang' => 'RSS_STRIP_BBCODE', 'validate' => 'string', 'type' => 'text:30:200', 'explain' => true), 'rss_allow_links' => array('lang' => 'RSS_ALLOW_LINKS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), 'rss_allow_emails' => array('lang' => 'RSS_ALLOW_EMAILS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), 'rss_allow_smilies' => array('lang' => 'RSS_ALLOW_SMILIES', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), 'rss_sumarize' => array('lang' => 'RSS_SUMARIZE', 'validate' => 'int:0:1000', 'type' => 'text:4:4', 'explain' => true), 'rss_sumarize_method' => array('lang' => 'RSS_SUMARIZE_METHOD', 'validate' => 'string', 'type' => 'select', 'method' => 'select_string', 'explain' => true), 'rss_nohtml' => array('lang' => 'RSS_NOHTML', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true))), 'default' => array('rss_allow_news' => 1, 'rss_news_update' => '', 'rss_allow_short' => 1, 'rss_allow_long' => 1, 'rss_allow_content' => 1, 'rss_allow_profile' => 1, 'rss_allow_profile_links' => 0, 'rss_allow_bbcode' => 1, 'rss_strip_bbcode' => '', 'rss_allow_links' => 1, 'rss_allow_emails' => 0, 'rss_allow_smilies' => 1, 'rss_sumarize' => 50, 'rss_sumarize_method' => 'words', 'rss_nohtml' => 0), 'select' => array('rss_sumarize_method' => @$this->dyn_select['sumarize_method'])), 'info' => array('title_lang' => 'GYM_RSS', 'lang_file' => 'gym_rss', 'actions' => array('main', 'content', 'cache', 'modrewrite', 'gzip', 'limit', 'sort', 'pagination', 'override'), 'mode' => 'rss', 'module' => 'main'));
 }
예제 #6
0
 /**
  * acp_module()
  * retunrs the acp config
  * @access private
  */
 function acp_module()
 {
     global $config, $phpbb_seo, $user;
     $config['sitename'] = utf8_normalize_nfc($config['sitename']);
     $config['site_desc'] = utf8_normalize_nfc($config['site_desc']);
     return array('cache' => array('display_vars' => array('title' => 'GYM_CACHE', 'vars' => array('legend1' => 'GYM_CACHE', 'rss_forum_cache_on' => array('lang' => 'GYM_CACHE_ON', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true, 'overriding' => true), 'rss_forum_cache_force_gzip' => array('lang' => 'GYM_CACHE_FORCE_GZIP', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true, 'overriding' => true), 'rss_forum_cache_max_age' => array('lang' => 'GYM_CACHE_MAX_AGE', 'validate' => 'string', 'type' => 'text:4:4', 'explain' => true, 'overriding' => true), 'rss_forum_showstats' => array('lang' => 'GYM_SHOWSTATS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true, 'overriding' => true))), 'default' => array('rss_forum_cache_on' => 0, 'rss_forum_cache_force_gzip' => 0, 'rss_forum_cache_max_age' => 6, 'rss_forum_showstats' => 1)), 'modrewrite' => array('display_vars' => array('title' => 'GYM_MODREWRITE', 'vars' => array('legend1' => 'GYM_MODREWRITE', 'rss_forum_modrewrite' => array('lang' => 'GYM_MODREWRITE_ON', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true, 'overriding' => true), 'rss_forum_modrtype' => array('lang' => 'GYM_MODRTYPE', 'validate' => 'string', 'type' => 'select', 'method' => 'select_string', 'explain' => true, 'overriding' => true))), 'default' => array('rss_forum_modrewrite' => 0, 'rss_forum_modrtype' => 0), 'select' => array('rss_forum_modrtype' => @$this->dyn_select['modrtype'])), 'gzip' => array('display_vars' => array('title' => 'GYM_GZIP', 'vars' => array('legend4' => 'GYM_GZIP', 'rss_forum_gzip' => array('lang' => 'GYM_GZIP_ON', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true, 'overriding' => true), 'rss_forum_gzip_ext' => array('lang' => 'GYM_GZIP_EXT', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true, 'overriding' => true))), 'default' => array('rss_forum_gzip' => 0, 'rss_forum_gzip_ext' => 1)), 'limit' => array('display_vars' => array('title' => 'GYM_LIMIT', 'vars' => array('legend1' => 'RSS_LIMIT_GEN', 'rss_forum_url_limit' => array('lang' => 'GYM_URL_LIMIT', 'validate' => 'int:0:5000', 'type' => 'text:4:4', 'explain' => true, 'overriding' => true), 'rss_forum_sql_limit' => array('lang' => 'GYM_SQL_LIMIT', 'validate' => 'int:0:1000', 'type' => 'text:4:4', 'explain' => true, 'overriding' => true), 'rss_forum_time_limit' => array('lang' => 'GYM_TIME_LIMIT', 'validate' => 'int:0:1000', 'type' => 'text:4:4', 'explain' => true, 'overriding' => true), 'legend2' => 'RSS_LIMIT_SPEC', 'rss_forum_url_limit_long' => array('lang' => 'RSS_URL_LIMIT_LONG', 'validate' => 'int:0:5000', 'type' => 'text:4:4', 'explain' => true, 'overriding' => true), 'rss_forum_sql_limit_long' => array('lang' => 'RSS_SQL_LIMIT_LONG', 'validate' => 'int:0:1000', 'type' => 'text:4:4', 'explain' => true, 'overriding' => true), 'rss_forum_url_limit_short' => array('lang' => 'RSS_URL_LIMIT_SHORT', 'validate' => 'int:0:5000', 'type' => 'text:4:4', 'explain' => true, 'overriding' => true), 'rss_forum_sql_limit_short' => array('lang' => 'RSS_SQL_LIMIT_SHORT', 'validate' => 'int:0:1000', 'type' => 'text:4:4', 'explain' => true, 'overriding' => true), 'rss_forum_url_limit_msg' => array('lang' => 'RSS_URL_LIMIT_MSG', 'validate' => 'int:0:1000', 'type' => 'text:4:4', 'explain' => true, 'overriding' => true), 'rss_forum_sql_limit_msg' => array('lang' => 'RSS_SQL_LIMIT_MSG', 'validate' => 'int:0:500', 'type' => 'text:4:4', 'explain' => true, 'overriding' => true))), 'default' => array('rss_forum_url_limit' => 50, 'rss_forum_sql_limit' => 20, 'rss_forum_time_limit' => 15, 'rss_forum_url_limit_long' => 100, 'rss_forum_sql_limit_long' => 25, 'rss_forum_url_limit_short' => 10, 'rss_forum_sql_limit_short' => 10, 'rss_forum_url_limit_msg' => 15, 'rss_forum_sql_limit_msg' => 15)), 'sort' => array('display_vars' => array('title' => 'GYM_SORT', 'vars' => array('legend1' => 'GYM_SORT', 'rss_forum_sort' => array('lang' => 'GYM_SORT_TYPE', 'validate' => 'string', 'type' => 'select', 'method' => 'select_string', 'explain' => true, 'overriding' => true))), 'default' => array('rss_forum_sort' => 'DESC'), 'select' => array('rss_forum_sort' => @$this->dyn_select['sort'])), 'pagination' => array('display_vars' => array('title' => 'GYM_PAGINATION', 'vars' => array('legend1' => 'GYM_PAGINATION', 'rss_forum_pagination' => array('lang' => 'GYM_PAGINATION_ON', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true, 'overriding' => true), 'rss_forum_limitdown' => array('lang' => 'GYM_LIMITDOWN', 'validate' => 'int:0', 'type' => 'text:4:4', 'explain' => true, 'overriding' => true), 'rss_forum_limitup' => array('lang' => 'GYM_LIMITUP', 'validate' => 'int:0', 'type' => 'text:4:4', 'explain' => true, 'overriding' => true))), 'default' => array('rss_forum_pagination' => 1, 'rss_forum_limitdown' => 3, 'rss_forum_limitup' => 5)), 'main' => array('display_vars' => array('title' => 'RSS_MAIN', 'vars' => array('legend1' => 'RSS_SETTINGS', 'rss_forum_c_info' => array('lang' => 'RSS_C_INFO', 'validate' => 'string', 'type' => 'text:40:255', 'explain' => true, 'overriding' => true), 'rss_forum_sitename' => array('lang' => 'RSS_SITENAME', 'validate' => 'string', 'type' => 'text:40:255', 'explain' => true, 'overriding' => true), 'rss_forum_site_desc' => array('lang' => 'RSS_SITE_DESC', 'validate' => 'string', 'type' => 'textarea:6:50', 'explain' => true, 'overriding' => true), 'rss_forum_logo_url' => array('lang' => 'RSS_LOGO_URL', 'validate' => 'string', 'type' => 'text:25:200', 'explain' => true, 'overriding' => true), 'rss_forum_image_url' => array('lang' => 'RSS_IMAGE_URL', 'validate' => 'string', 'type' => 'text:25:200', 'explain' => true, 'overriding' => true), 'rss_forum_lang' => array('lang' => 'RSS_LANG', 'validate' => 'string', 'type' => 'select', 'method' => 'select_string', 'explain' => true, 'overriding' => true), 'rss_forum_alternate' => array('lang' => 'RSS_FORUM_ALTERNATE', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), 'legend2' => 'RSS_AUTH_SETTINGS', 'rss_forum_allow_auth' => array('lang' => 'RSS_ALLOW_AUTH', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true, 'overriding' => true), 'rss_forum_cache_auth' => array('lang' => 'RSS_CACHE_AUTH', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true, 'overriding' => true), 'legend3' => 'RSS_NOTIFY', 'rss_forum_yahoo_notify' => array('lang' => 'RSS_YAHOO_NOTIFY', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true, 'overriding' => true), 'legend4' => 'RSS_FORUM_EXCLUDE', 'rss_forum_exclude' => array('lang' => 'RSS_FORUM_EXCLUDE', 'multiple_validate' => 'int', 'type' => 'custom', 'method' => 'select_multiple_string', 'explain' => true))), 'default' => array('rss_forum_c_info' => $config['sitename'], 'rss_forum_sitename' => $config['sitename'], 'rss_forum_site_desc' => $config['site_desc'], 'rss_forum_logo_url' => 'logo.gif', 'rss_forum_image_url' => 'rss_forum_big.gif', 'rss_forum_lang' => $config['default_lang'], 'rss_forum_alternate' => 1, 'rss_forum_allow_auth' => 0, 'rss_forum_cache_auth' => 1, 'rss_forum_exclude' => '', 'rss_forum_yahoo_notify' => 0), 'select' => array('rss_forum_lang' => $user->lang['ISO_639_1'], 'rss_forum_exclude' => @$this->dyn_select['forums'])), 'content' => array('display_vars' => array('title' => 'RSS_CONTENT', 'vars' => array('legend1' => 'RSS_CONTENT', 'rss_forum_allow_news' => array('lang' => 'RSS_ALLOW_NEWS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true, 'overriding' => true), 'rss_forum_allow_short' => array('lang' => 'RSS_ALLOW_SHORT', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true, 'overriding' => true), 'rss_forum_allow_long' => array('lang' => 'RSS_ALLOW_LONG', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true, 'overriding' => true), 'rss_forum_allow_content' => array('lang' => 'RSS_ALLOW_CONTENT', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true, 'overriding' => true), 'rss_forum_allow_profile' => array('lang' => 'RSS_ALLOW_PROFILE', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true, 'overriding' => true), 'rss_forum_allow_profile_links' => array('lang' => 'RSS_ALLOW_PROFILE_LINKS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true, 'overriding' => true), 'rss_forum_allow_bbcode' => array('lang' => 'RSS_ALLOW_BBCODE', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true, 'overriding' => true), 'rss_forum_strip_bbcode' => array('lang' => 'RSS_STRIP_BBCODE', 'validate' => 'string', 'type' => 'text:25:200', 'explain' => true, 'overriding' => true), 'rss_forum_allow_links' => array('lang' => 'RSS_ALLOW_LINKS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true, 'overriding' => true), 'rss_forum_allow_emails' => array('lang' => 'RSS_ALLOW_EMAILS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true, 'overriding' => true), 'rss_forum_allow_smilies' => array('lang' => 'RSS_ALLOW_SMILIES', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true, 'overriding' => true), 'rss_forum_sumarize' => array('lang' => 'RSS_SUMARIZE', 'validate' => 'int:0:1000', 'type' => 'text:4:4', 'explain' => true, 'overriding' => true), 'rss_forum_sumarize_method' => array('lang' => 'RSS_SUMARIZE_METHOD', 'validate' => 'string', 'type' => 'select', 'method' => 'select_string', 'explain' => true, 'overriding' => true), 'rss_forum_nohtml' => array('lang' => 'RSS_NOHTML', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true, 'overriding' => true), 'legend2' => 'RSS_FORUM_CONTENT', 'rss_forum_first' => array('lang' => 'RSS_FORUM_FIRST', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), 'rss_forum_last' => array('lang' => 'RSS_FORUM_LAST', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), 'rss_forum_rules' => array('lang' => 'RSS_FORUM_RULES', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true))), 'default' => array('rss_forum_allow_news' => 1, 'rss_forum_allow_short' => 1, 'rss_forum_allow_long' => 1, 'rss_forum_allow_content' => 1, 'rss_forum_allow_profile' => 1, 'rss_forum_allow_profile_links' => 0, 'rss_forum_allow_bbcode' => 1, 'rss_forum_strip_bbcode' => '', 'rss_forum_allow_links' => 1, 'rss_forum_allow_emails' => 0, 'rss_forum_allow_smilies' => 1, 'rss_forum_sumarize' => 25, 'rss_forum_sumarize_method' => 'words', 'rss_forum_nohtml' => 0, 'rss_forum_first' => 0, 'rss_forum_last' => 1, 'rss_forum_rules' => 0), 'select' => array('rss_forum_sumarize_method' => @$this->dyn_select['sumarize_method'])), 'info' => array('title_lang' => 'RSS_FORUM', 'lang_file' => 'rss_forum', 'actions' => array('main', 'content', 'cache', 'modrewrite', 'gzip', 'limit', 'sort', 'pagination'), 'mode' => 'rss', 'module' => 'forum'));
 }
예제 #7
0
 /**
  * acp_module()
  * retunrs the acp config
  * @access private
  */
 function acp_module()
 {
     global $config, $phpbb_seo, $user, $phpEx;
     $config['sitename'] = utf8_normalize_nfc($config['sitename']);
     $config['site_desc'] = utf8_normalize_nfc($config['site_desc']);
     return array('cache' => array('display_vars' => array('title' => 'HTML_CACHE', 'vars' => array('legend1' => 'HTML_CACHE', 'html_main_cache_on' => array('lang' => 'HTML_MAIN_CACHE_ON', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), 'html_main_cache_ttl' => array('lang' => 'HTML_MAIN_CACHE_TTL', 'validate' => 'string', 'type' => 'text:4:4', 'explain' => true), 'html_opt_cache_on' => array('lang' => 'HTML_OPT_CACHE_ON', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), 'html_opt_cache_ttl' => array('lang' => 'HTML_OPT_CACHE_TTL', 'validate' => 'string', 'type' => 'text:4:4', 'explain' => true))), 'default' => array('html_main_cache_on' => 0, 'html_opt_cache_on' => 0, 'html_opt_cache_ttl' => 6, 'html_main_cache_ttl' => 6)), 'modrewrite' => array('display_vars' => array('title' => 'GYM_MODREWRITE', 'vars' => array('legend1' => 'GYM_MODREWRITE', 'html_modrewrite' => array('lang' => 'GYM_MODREWRITE_ON', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true, 'overriding' => true), 'html_modrtype' => array('lang' => 'GYM_MODRTYPE', 'validate' => 'string', 'type' => 'select', 'method' => 'select_string', 'explain' => true, 'overriding' => true))), 'default' => array('html_modrewrite' => 0, 'html_modrtype' => 0), 'select' => array('html_modrtype' => @$this->dyn_select['modrtype'])), 'gzip' => array('display_vars' => array('title' => 'GYM_GZIP', 'vars' => array('legend4' => 'GYM_GZIP', 'html_gzip' => array('lang' => 'GYM_GZIP_ON', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true, 'overriding' => true))), 'default' => array('html_gzip' => 0)), 'limit' => array('display_vars' => array('title' => 'GYM_LIMIT', 'vars' => array('legend1' => 'GYM_URL_LIMIT', 'html_rss_news_limit' => array('lang' => 'HTML_RSS_NEWS_LIMIT', 'validate' => 'int:0:1000', 'type' => 'text:4:4', 'explain' => true), 'legend2' => 'GYM_TIME_LIMIT', 'html_map_time_limit' => array('lang' => 'HTML_MAP_TIME_LIMIT', 'validate' => 'int:0:1000', 'type' => 'text:4:4', 'explain' => true), 'html_cat_time_limit' => array('lang' => 'HTML_CAT_MAP_TIME_LIMIT', 'validate' => 'int:0:1000', 'type' => 'text:4:4', 'explain' => true), 'html_news_time_limit' => array('lang' => 'HTML_NEWS_TIME_LIMIT', 'validate' => 'int:0:1000', 'type' => 'text:4:4', 'explain' => true), 'html_cat_news_time_limit' => array('lang' => 'HTML_CAT_NEWS_TIME_LIMIT', 'validate' => 'int:0:1000', 'type' => 'text:4:4', 'explain' => true))), 'default' => array('html_rss_news_limit' => 10, 'html_map_time_limit' => 0, 'html_cat_time_limit' => 0, 'html_news_time_limit' => 0, 'html_cat_news_time_limit' => 0)), 'sort' => array('display_vars' => array('title' => 'GYM_SORT', 'vars' => array('legend1' => 'GYM_SORT', 'html_sort' => array('lang' => 'GYM_SORT_TYPE', 'validate' => 'string', 'type' => 'select', 'method' => 'select_string', 'explain' => true, 'overriding' => true), 'html_cat_sort' => array('lang' => 'HTML_CAT_SORT_TYPE', 'validate' => 'string', 'type' => 'select', 'method' => 'select_string', 'explain' => true, 'overriding' => true), 'html_news_sort' => array('lang' => 'HTML_NEWS_SORT_TYPE', 'validate' => 'string', 'type' => 'select', 'method' => 'select_string', 'explain' => true, 'overriding' => true), 'html_cat_news_sort' => array('lang' => 'HTML_CAT_NEWS_SORT_TYPE', 'validate' => 'string', 'type' => 'select', 'method' => 'select_string', 'explain' => true, 'overriding' => true))), 'default' => array('html_sort' => 'DESC', 'html_cat_sort' => 'DESC', 'html_news_sort' => 'DESC', 'html_cat_news_sort' => 'DESC'), 'select' => array('html_sort' => @$this->dyn_select['sort'], 'html_cat_sort' => @$this->dyn_select['sort'], 'html_news_sort' => @$this->dyn_select['sort'], 'html_cat_news_sort' => @$this->dyn_select['sort'])), 'pagination' => array('display_vars' => array('title' => 'GYM_PAGINATION', 'vars' => array('legend1' => 'HTML_PAGINATION_GEN', 'html_pagination' => array('lang' => 'HTML_PAGINATION', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), 'html_pagination_limit' => array('lang' => 'HTML_PAGINATION_LIMIT', 'validate' => 'int:0:100', 'type' => 'text:4:4', 'explain' => true), 'html_news_pagination' => array('lang' => 'HTML_NEWS_PAGINATION', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), 'html_news_pagination_limit' => array('lang' => 'HTML_NEWS_PAGINATION_LIMIT', 'validate' => 'int:0:50', 'type' => 'text:4:4', 'explain' => true), 'legend2' => 'HTML_PAGINATION_SPEC', 'html_item_pagination' => array('lang' => 'HTML_ITEM_PAGINATION', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true))), 'default' => array('html_pagination' => 1, 'html_pagination_limit' => 25, 'html_news_pagination' => 1, 'html_news_pagination_limit' => 10, 'html_item_pagination' => 0)), 'override' => array('display_vars' => array('title' => 'GYM_OVERRIDE', 'vars' => array('legend1' => 'GYM_OVERRIDE', 'html_override' => array('lang' => 'GYM_OVERRIDE_MAIN', 'validate' => 'string', 'type' => 'select', 'method' => 'select_string', 'explain' => true), 'html_override_cache' => array('lang' => 'GYM_OVERRIDE_CACHE', 'validate' => 'string', 'type' => 'select', 'method' => 'select_string', 'explain' => true), 'html_override_modrewrite' => array('lang' => 'GYM_OVERRIDE_MODREWRITE', 'validate' => 'string', 'type' => 'select', 'method' => 'select_string', 'explain' => true), 'html_override_gzip' => array('lang' => 'GYM_OVERRIDE_GZIP', 'validate' => 'string', 'type' => 'select', 'method' => 'select_string', 'explain' => true), 'html_override_limit' => array('lang' => 'GYM_OVERRIDE_LIMIT', 'validate' => 'string', 'type' => 'select', 'method' => 'select_string', 'explain' => true), 'html_override_sort' => array('lang' => 'GYM_OVERRIDE_SORT', 'validate' => 'string', 'type' => 'select', 'method' => 'select_string', 'explain' => true), 'html_override_pagination' => array('lang' => 'GYM_OVERRIDE_PAGINATION', 'validate' => 'string', 'type' => 'select', 'method' => 'select_string', 'explain' => true))), 'default' => array('html_override' => OVERRIDE_MODULE, 'html_override_cache' => OVERRIDE_OTYPE, 'html_override_modrewrite' => OVERRIDE_OTYPE, 'html_override_gzip' => OVERRIDE_GLOBAL, 'html_override_limit' => OVERRIDE_OTYPE, 'html_override_sort' => OVERRIDE_MODULE, 'html_override_pagination' => OVERRIDE_OTYPE), 'select' => array('html_override' => $this->html_override, 'html_override_cache' => $this->html_override, 'html_override_modrewrite' => @$this->dyn_select['override'], 'html_override_gzip' => @$this->dyn_select['override'], 'html_override_limit' => $this->html_override, 'html_override_sort' => @$this->dyn_select['override'], 'html_override_pagination' => $this->html_override)), 'main' => array('display_vars' => array('title' => 'HTML_MAIN', 'vars' => array('legend1' => 'HTML_URL', 'html_url' => array('lang' => 'HTML_URL', 'validate' => 'string', 'type' => 'text:40:255', 'explain' => true), 'legend2' => 'HTML_LINKS_ACTIVATION', 'html_link_main' => array('lang' => 'HTML_LINKS_MAIN', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), 'html_link_index' => array('lang' => 'HTML_LINKS_INDEX', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), 'html_link_cat' => array('lang' => 'HTML_LINKS_CAT', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), 'legend3' => 'HTML_SETTINGS', 'html_allow_map' => array('lang' => 'HTML_ALLOW_MAP', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), 'html_allow_cat_map' => array('lang' => 'HTML_ALLOW_CAT_MAP', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), 'html_sitename' => array('lang' => 'HTML_SITENAME', 'validate' => 'string', 'type' => 'text:40:255', 'explain' => true), 'html_site_desc' => array('lang' => 'HTML_SITE_DESC', 'validate' => 'string', 'type' => 'textarea:6:50', 'explain' => true), 'html_c_info' => array('lang' => 'HTML_C_INFO', 'validate' => 'string', 'type' => 'text:40:255', 'explain' => true), 'html_logo_url' => array('lang' => 'HTML_LOGO_URL', 'validate' => 'string', 'type' => 'text:25:200', 'explain' => true), 'html_stats_on_news' => array('lang' => 'HTML_STATS_ON_NEWS', 'validate' => 'string', 'type' => 'select', 'method' => 'select_string', 'explain' => true), 'html_stats_on_map' => array('lang' => 'HTML_STATS_ON_MAP', 'validate' => 'string', 'type' => 'select', 'method' => 'select_string', 'explain' => true), 'html_birthdays_on_news' => array('lang' => 'HTML_BIRTHDAYS_ON_NEWS', 'validate' => 'string', 'type' => 'select', 'method' => 'select_string', 'explain' => true), 'html_birthdays_on_map' => array('lang' => 'HTML_BIRTHDAYS_ON_MAP', 'validate' => 'string', 'type' => 'select', 'method' => 'select_string', 'explain' => true), 'html_disp_online' => array('lang' => 'HTML_DISP_ONLINE', 'validate' => 'string', 'type' => 'select', 'method' => 'select_string', 'explain' => true), 'html_disp_tracking' => array('lang' => 'HTML_DISP_TRACKING', 'validate' => 'string', 'type' => 'select', 'method' => 'select_string', 'explain' => true), 'html_disp_status' => array('lang' => 'HTML_DISP_STATUS', 'validate' => 'string', 'type' => 'select', 'method' => 'select_string', 'explain' => true), 'html_allow_profile' => array('lang' => 'HTML_ALLOW_PROFILE', 'validate' => 'string', 'type' => 'select', 'method' => 'select_string', 'explain' => true), 'html_allow_profile_links' => array('lang' => 'HTML_ALLOW_PROFILE_LINKS', 'validate' => 'string', 'type' => 'select', 'method' => 'select_string', 'explain' => true), 'legend4' => 'HTML_AUTH_SETTINGS', 'html_allow_auth' => array('lang' => 'HTML_ALLOW_AUTH', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true))), 'default' => array('html_url' => $phpbb_seo->seo_path['phpbb_url'], 'html_link_main' => 1, 'html_link_index' => 1, 'html_link_cat' => 1, 'html_allow_map' => 1, 'html_allow_cat_map' => 1, 'html_c_info' => $config['sitename'], 'html_sitename' => $config['sitename'], 'html_site_desc' => $config['site_desc'], 'html_logo_url' => '', 'html_disp_online' => 'globalmod', 'html_disp_tracking' => 'reg', 'html_disp_status' => 'reg', 'html_allow_profile' => 'none', 'html_allow_profile_links' => 'reg', 'html_allow_auth' => 1, 'html_stats_on_news' => 'all', 'html_stats_on_map' => 'all', 'html_birthdays_on_news' => 'reg', 'html_birthdays_on_map' => 'reg'), 'select' => array('html_disp_online' => @$this->dyn_select['gym_auth'], 'html_disp_tracking' => @$this->dyn_select['gym_auth'], 'html_disp_status' => @$this->dyn_select['gym_auth'], 'html_allow_profile' => @$this->dyn_select['gym_auth'], 'html_allow_profile_links' => @$this->dyn_select['gym_auth'], 'html_stats_on_news' => @$this->dyn_select['gym_auth'], 'html_stats_on_map' => @$this->dyn_select['gym_auth'], 'html_birthdays_on_news' => @$this->dyn_select['gym_auth'], 'html_birthdays_on_map' => @$this->dyn_select['gym_auth'])), 'content' => array('display_vars' => array('title' => 'HTML_NEWS', 'vars' => array('legend1' => 'HTML_NEWS', 'html_allow_news' => array('lang' => 'HTML_ALLOW_NEWS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), 'html_allow_cat_news' => array('lang' => 'HTML_ALLOW_CAT_NEWS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), 'html_rss_news_url' => array('lang' => 'HTML_RSS_NEWS_URL', 'validate' => 'string', 'type' => 'text:40:255', 'explain' => true), 'legend2' => 'HTML_NEWS_CONTENT', 'html_allow_bbcode' => array('lang' => 'HTML_ALLOW_BBCODE', 'validate' => 'string', 'type' => 'select', 'method' => 'select_string', 'explain' => true), 'html_strip_bbcode' => array('lang' => 'HTML_STRIP_BBCODE', 'validate' => 'string', 'type' => 'text:30:200', 'explain' => true), 'html_allow_links' => array('lang' => 'HTML_ALLOW_LINKS', 'validate' => 'string', 'type' => 'select', 'method' => 'select_string', 'explain' => true), 'html_allow_emails' => array('lang' => 'HTML_ALLOW_EMAILS', 'validate' => 'string', 'type' => 'select', 'method' => 'select_string', 'explain' => true), 'html_allow_smilies' => array('lang' => 'HTML_ALLOW_SMILIES', 'validate' => 'string', 'type' => 'select', 'method' => 'select_string', 'explain' => true), 'html_allow_sig' => array('lang' => 'HTML_ALLOW_SIG', 'validate' => 'string', 'type' => 'select', 'method' => 'select_string', 'explain' => true), 'html_sumarize' => array('lang' => 'HTML_SUMARIZE', 'validate' => 'int:0:1000', 'type' => 'text:4:4', 'explain' => true), 'html_sumarize_method' => array('lang' => 'HTML_SUMARIZE_METHOD', 'validate' => 'string', 'type' => 'select', 'method' => 'select_string', 'explain' => true))), 'default' => array('html_allow_news' => 1, 'html_allow_cat_news' => 1, 'html_rss_news_url' => (!empty($this->gym_master->gym_config['rss_url']) ? $this->gym_master->gym_config['rss_url'] : $phpbb_seo->seo_path['phpbb_url']) . "gymrss.{$phpEx}?news&digest", 'html_allow_bbcode' => 'all', 'html_strip_bbcode' => '', 'html_allow_links' => 'all', 'html_allow_emails' => 'none', 'html_allow_smilies' => 'all', 'html_allow_sig' => 'reg', 'html_sumarize' => 75, 'html_sumarize_method' => 'words'), 'select' => array('html_sumarize_method' => @$this->dyn_select['sumarize_method'], 'html_allow_bbcode' => @$this->dyn_select['gym_auth'], 'html_allow_links' => @$this->dyn_select['gym_auth'], 'html_allow_emails' => @$this->dyn_select['gym_auth'], 'html_allow_smilies' => @$this->dyn_select['gym_auth'], 'html_allow_sig' => @$this->dyn_select['gym_auth'])), 'info' => array('title_lang' => 'GYM_HTML', 'lang_file' => 'gym_html', 'actions' => array('main', 'content', 'cache', 'modrewrite', 'gzip', 'limit', 'sort', 'pagination', 'override'), 'mode' => 'rss', 'module' => 'main'));
 }
예제 #8
0
 public function main($id, $mode)
 {
     global $data, $config, $error, $submit;
     $timezone = $config['board_timezone'];
     $data = array('username' => utf8_normalize_nfc(request_var('username', '', true)), 'password' => request_var('password', '', true), 'password_confirm' => request_var('password_confirm', '', true), 'email' => request_var('email', ''), 'email_confirm' => request_var('email_confirm', ''), 'tz' => request_var('tz', (double) $timezone));
     if ($submit) {
         $error = validate_data($data, array('username' => array(array('string', false, $config['min_username_chars'], $config['max_username_chars']), array('username', '')), 'password' => array(array('string', false, $config['min_password_chars'], $config['max_password_chars'])), 'password_confirm' => array('string', false, $config['min_password_chars'], $config['max_password_chars']), 'email' => array(array('string', false, 6, 60), array('email')), 'email_confirm' => array('string', false, 6, 60), 'tz' => array('num', -14, 14)));
         if (!sizeof($error)) {
             if ($data['password'] != $data['password_confirm']) {
                 $error[] = 'PASSWORD_MATCH_ERROR';
             }
             if ($data['email'] != $data['email_confirm']) {
                 $error[] = 'EMAIL_MATCH_ERROR';
             }
         }
         if (!sizeof($error)) {
             if ($config['activation_required'] == USER_ACTIVATION_SELF || $config['activation_required'] == USER_ACTIVATION_ADMIN) {
                 $data['group_id'] = INACTIVE_USERS;
             } else {
                 $data['group_id'] = REGISTERED_USERS;
             }
             if (user_add($data) !== false) {
                 /**
                  * @todo registration ok
                  */
             } else {
                 /**
                  * @todo registration failed
                  */
             }
         }
     }
 }
예제 #9
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));
 }
예제 #10
0
    public function base()
    {
        $note = utf8_normalize_nfc($this->request->variable('note', '', true));
        $submit = isset($_POST['submit']) ? true : false;
        $error = array();
        // check if user s logged in, since this page can be used only after registration...
        if (!$this->user->data['is_registered']) {
            login_box($this->helper->route('vinny_usersnotes_controller'));
        }
        // ... and also this is not for bots (especially for bad ones :)
        if ($this->user->data['is_bot']) {
            redirect(append_sid("{$this->phpbb_root_path}index.{$this->phpEx}"));
        }
        $s_action = $this->helper->route('vinny_usersnotes_controller');
        $s_hidden_fields = '';
        add_form_key('postform');
        // create a template variables
        $this->template->assign_vars(array('S_POST_ACTION' => $s_action, 'S_HIDDEN_FIELDS' => $s_hidden_fields, 'ERROR' => sizeof($error) ? implode('<br />', $error) : ''));
        if ($submit) {
            /*if(!check_form_key('postform'))
            		{
            			trigger_error('FORM_INVALID');
            		}*/
            $sql = 'UPDATE ' . USERS_TABLE . '
				SET user_note = "' . $note . '"
				WHERE user_id = ' . $this->user->data['user_id'];
            $this->db->sql_query($sql);
            meta_refresh(3, $this->helper->route('vinny_usersnotes_controller'));
            trigger_error(sprintf($this->user->lang['NOTES_SAVED'], $this->helper->route('vinny_usersnotes_controller')));
        }
        // create a template variables
        $this->template->assign_vars(array('NOTE' => $this->user->data['user_note']));
        $this->template->assign_block_vars('navlinks', array('FORUM_NAME' => $this->user->lang['NOTES']));
        return $this->helper->render('notes.html', $this->user->lang['NOTES']);
    }
function get_table_flash_bbcode_pkids($table_name, $id_field, $content_field, $uid_field, $bitfield_field)
{
	global $db;

	$ids = array();

	$sql = "SELECT $id_field, $content_field, $uid_field, $bitfield_field
		FROM $table_name
		WHERE $content_field LIKE '%[/flash:%'
			AND $bitfield_field <> ''";

	$result = $db->sql_query($sql);
	while ($row = $db->sql_fetchrow($result))
	{
		$uid = $row[$uid_field];

		// thanks support toolkit
		$content = html_entity_decode_utf8($row[$content_field]);
		set_var($content, $content, 'string', true);
		$content = utf8_normalize_nfc($content);

		$bitfield_data = $row[$bitfield_field];

		if (!is_valid_flash_bbcode($content, $uid) && has_flash_enabled($bitfield_data))
		{
			$ids[] = (int) $row[$id_field];
		}
	}
	$db->sql_freeresult($result);

	return $ids;
}
예제 #12
0
 /**
  * acp_module()
  * retunrs the acp config
  * @access private
  */
 function acp_module()
 {
     global $config, $phpbb_seo, $user;
     $config['sitename'] = utf8_normalize_nfc($config['sitename']);
     $config['site_desc'] = utf8_normalize_nfc($config['site_desc']);
     return array('cache' => array('display_vars' => array('title' => 'HTML_CACHE', 'vars' => array('legend1' => 'HTML_CACHE', 'html_forum_main_cache_on' => array('lang' => 'HTML_MAIN_CACHE_ON', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true, 'overriding' => true), 'html_forum_main_cache_ttl' => array('lang' => 'HTML_MAIN_CACHE_TTL', 'validate' => 'string', 'type' => 'text:4:4', 'explain' => true, 'overriding' => true), 'html_forum_opt_cache_on' => array('lang' => 'HTML_OPT_CACHE_ON', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true, 'overriding' => true), 'html_forum_opt_cache_ttl' => array('lang' => 'HTML_OPT_CACHE_TTL', 'validate' => 'string', 'type' => 'text:4:4', 'explain' => true, 'overriding' => true))), 'default' => array('html_forum_main_cache_on' => 0, 'html_forum_opt_cache_on' => 0, 'html_forum_main_cache_ttl' => 6, 'html_forum_opt_cache_ttl' => 6)), 'modrewrite' => array('display_vars' => array('title' => 'GYM_MODREWRITE', 'vars' => array('legend1' => 'GYM_MODREWRITE', 'html_forum_modrewrite' => array('lang' => 'GYM_MODREWRITE_ON', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true, 'overriding' => true), 'html_forum_modrtype' => array('lang' => 'GYM_MODRTYPE', 'validate' => 'string', 'type' => 'select', 'method' => 'select_string', 'explain' => true, 'overriding' => true))), 'default' => array('html_forum_modrewrite' => 0, 'html_forum_modrtype' => 0), 'select' => array('html_forum_modrtype' => @$this->dyn_select['modrtype'])), 'gzip' => array('display_vars' => array('title' => 'GYM_GZIP', 'vars' => array('legend4' => 'GYM_GZIP', 'html_forum_gzip' => array('lang' => 'GYM_GZIP_ON', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true, 'overriding' => true))), 'default' => array('html_forum_gzip' => 0)), 'limit' => array('display_vars' => array('title' => 'GYM_LIMIT', 'vars' => array('legend1' => 'GYM_TIME_LIMIT', 'html_forum_map_time_limit' => array('lang' => 'HTML_MAP_TIME_LIMIT', 'validate' => 'int:0:1000', 'type' => 'text:4:4', 'explain' => true, 'overriding' => true), 'html_forum_cat_time_limit' => array('lang' => 'HTML_CAT_MAP_TIME_LIMIT', 'validate' => 'int:0:1000', 'type' => 'text:4:4', 'explain' => true, 'overriding' => true), 'html_forum_news_time_limit' => array('lang' => 'HTML_NEWS_TIME_LIMIT', 'validate' => 'int:0:1000', 'type' => 'text:4:4', 'explain' => true, 'overriding' => true), 'html_forum_cat_news_time_limit' => array('lang' => 'HTML_CAT_NEWS_TIME_LIMIT', 'validate' => 'int:0:1000', 'type' => 'text:4:4', 'explain' => true, 'overriding' => true))), 'default' => array('html_forum_map_time_limit' => 0, 'html_forum_cat_time_limit' => 0, 'html_forum_news_time_limit' => 0, 'html_forum_cat_news_time_limit' => 0)), 'sort' => array('display_vars' => array('title' => 'GYM_SORT', 'vars' => array('legend1' => 'HTML_MAP_SORT_TITLE', 'html_forum_first' => array('lang' => 'HTML_FORUM_FIRST', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), 'html_forum_sort' => array('lang' => 'GYM_SORT_TYPE', 'validate' => 'string', 'type' => 'select', 'method' => 'select_string', 'explain' => true, 'overriding' => true), 'html_forum_cat_sort' => array('lang' => 'HTML_CAT_SORT_TYPE', 'validate' => 'string', 'type' => 'select', 'method' => 'select_string', 'explain' => true, 'overriding' => true), 'legend2' => 'HTML_NEWS_SORT_TITLE', 'html_forum_news_first' => array('lang' => 'HTML_FORUM_NEWS_FIRST', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), 'html_forum_news_sort' => array('lang' => 'HTML_NEWS_SORT_TYPE', 'validate' => 'string', 'type' => 'select', 'method' => 'select_string', 'explain' => true, 'overriding' => true), 'html_forum_cat_news_sort' => array('lang' => 'HTML_CAT_NEWS_SORT_TYPE', 'validate' => 'string', 'type' => 'select', 'method' => 'select_string', 'explain' => true, 'overriding' => true))), 'default' => array('html_forum_sort' => 'DESC', 'html_forum_cat_sort' => 'DESC', 'html_forum_news_sort' => 'DESC', 'html_forum_cat_news_sort' => 'DESC', 'html_forum_first' => 0, 'html_forum_news_first' => 1), 'select' => array('html_forum_sort' => @$this->dyn_select['sort'], 'html_forum_cat_sort' => @$this->dyn_select['sort'], 'html_forum_news_sort' => @$this->dyn_select['sort'], 'html_forum_cat_news_sort' => @$this->dyn_select['sort'])), 'pagination' => array('display_vars' => array('title' => 'GYM_PAGINATION', 'vars' => array('legend1' => 'HTML_PAGINATION_GEN', 'html_forum_pagination' => array('lang' => 'HTML_FORUM_PAGINATION', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true, 'overriding' => true), 'html_forum_pagination_limit' => array('lang' => 'HTML_FORUM_PAGINATION_LIMIT', 'validate' => 'int:0:100', 'type' => 'text:4:4', 'explain' => true, 'overriding' => true), 'html_forum_news_pagination' => array('lang' => 'HTML_NEWS_PAGINATION', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true, 'overriding' => true), 'html_forum_news_pagination_limit' => array('lang' => 'HTML_NEWS_PAGINATION_LIMIT', 'validate' => 'int:0:50', 'type' => 'text:4:4', 'explain' => true, 'overriding' => true), 'legend2' => 'HTML_PAGINATION_SPEC', 'html_forum_item_pagination' => array('lang' => 'HTML_ITEM_PAGINATION', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true, 'overriding' => true), 'html_forum_ltopic_pagination' => array('lang' => 'HTML_FORUM_LTOPIC_PAGINATION', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true))), 'default' => array('html_forum_pagination' => 1, 'html_forum_pagination_limit' => 50, 'html_forum_news_pagination' => 1, 'html_forum_news_pagination_limit' => 10, 'html_forum_item_pagination' => 0, 'html_forum_ltopic_pagination' => 0)), 'main' => array('display_vars' => array('title' => 'HTML_MAIN', 'vars' => array('legend1' => 'HTML_SETTINGS', 'html_forum_allow_map' => array('lang' => 'HTML_ALLOW_MAP', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true, 'overriding' => true), 'html_forum_allow_cat_map' => array('lang' => 'HTML_ALLOW_CAT_MAP', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true, 'overriding' => true), 'html_forum_sitename' => array('lang' => 'HTML_SITENAME', 'validate' => 'string', 'type' => 'text:40:255', 'explain' => true, 'overriding' => true), 'html_forum_site_desc' => array('lang' => 'HTML_SITE_DESC', 'validate' => 'string', 'type' => 'textarea:6:50', 'explain' => true, 'overriding' => true), 'html_forum_c_info' => array('lang' => 'HTML_C_INFO', 'validate' => 'string', 'type' => 'text:40:255', 'explain' => true, 'overriding' => true), 'html_forum_logo_url' => array('lang' => 'HTML_LOGO_URL', 'validate' => 'string', 'type' => 'text:25:200', 'explain' => true, 'overriding' => true), 'html_forum_stats_on_news' => array('lang' => 'HTML_STATS_ON_NEWS', 'validate' => 'string', 'type' => 'select', 'method' => 'select_string', 'explain' => true, 'overriding' => true), 'html_forum_stats_on_map' => array('lang' => 'HTML_STATS_ON_MAP', 'validate' => 'string', 'type' => 'select', 'method' => 'select_string', 'explain' => true, 'overriding' => true), 'html_forum_birthdays_on_news' => array('lang' => 'HTML_BIRTHDAYS_ON_NEWS', 'validate' => 'string', 'type' => 'select', 'method' => 'select_string', 'explain' => true, 'overriding' => true), 'html_forum_birthdays_on_map' => array('lang' => 'HTML_BIRTHDAYS_ON_MAP', 'validate' => 'string', 'type' => 'select', 'method' => 'select_string', 'explain' => true, 'overriding' => true), 'html_forum_disp_online' => array('lang' => 'HTML_DISP_ONLINE', 'validate' => 'string', 'type' => 'select', 'method' => 'select_string', 'explain' => true, 'overriding' => true), 'html_forum_disp_tracking' => array('lang' => 'HTML_DISP_TRACKING', 'validate' => 'string', 'type' => 'select', 'method' => 'select_string', 'explain' => true, 'overriding' => true), 'html_forum_disp_status' => array('lang' => 'HTML_DISP_STATUS', 'validate' => 'string', 'type' => 'select', 'method' => 'select_string', 'explain' => true, 'overriding' => true), 'html_forum_allow_profile' => array('lang' => 'HTML_ALLOW_PROFILE', 'validate' => 'string', 'type' => 'select', 'method' => 'select_string', 'explain' => true, 'overriding' => true), 'html_forum_allow_profile_links' => array('lang' => 'HTML_ALLOW_PROFILE_LINKS', 'validate' => 'string', 'type' => 'select', 'method' => 'select_string', 'explain' => true, 'overriding' => true), 'html_forum_exclude' => array('lang' => 'HTML_FORUM_EXCLUDE', 'multiple_validate' => 'int', 'type' => 'custom', 'method' => 'select_multiple_string', 'explain' => true), 'legend2' => 'HTML_AUTH_SETTINGS', 'html_forum_allow_auth' => array('lang' => 'HTML_ALLOW_AUTH', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true, 'overriding' => true), 'legend3' => 'HTML_FORUM_LTOPIC', 'html_forum_ltopic' => array('lang' => 'HTML_FORUM_INDEX_LTOPIC', 'validate' => 'int:0:100', 'type' => 'text:4:4', 'explain' => true), 'html_forum_cat_ltopic' => array('lang' => 'HTML_FORUM_CAT_LTOPIC', 'validate' => 'int:0:100', 'type' => 'text:4:4', 'explain' => true), 'html_forum_news_ltopic' => array('lang' => 'HTML_FORUM_NEWS_LTOPIC', 'validate' => 'int:0:100', 'type' => 'text:4:4', 'explain' => true), 'html_forum_cat_news_ltopic' => array('lang' => 'HTML_FORUM_CAT_NEWS_LTOPIC', 'validate' => 'int:0:100', 'type' => 'text:4:4', 'explain' => true), 'html_forum_ltopic_exclude' => array('lang' => 'HTML_FORUM_LTOPIC_EXCLUDE', 'multiple_validate' => 'int', 'type' => 'custom', 'method' => 'select_multiple_string', 'explain' => true), 'legend4' => 'HTML_FORUM_CONTENT', 'html_forum_last_post' => array('lang' => 'HTML_FORUM_LAST_POST', 'validate' => 'string', 'type' => 'select', 'method' => 'select_string', 'explain' => true), 'html_forum_rules' => array('lang' => 'HTML_FORUM_RULES', 'validate' => 'string', 'type' => 'select', 'method' => 'select_string', 'explain' => true), 'html_forum_desc' => array('lang' => 'HTML_FORUM_DESC', 'validate' => 'string', 'type' => 'select', 'method' => 'select_string', 'explain' => true))), 'default' => array('html_forum_allow_map' => 1, 'html_forum_allow_cat_map' => 1, 'html_forum_c_info' => $config['sitename'], 'html_forum_sitename' => $config['sitename'], 'html_forum_site_desc' => $config['site_desc'], 'html_forum_logo_url' => '', 'html_forum_url' => $phpbb_seo->seo_path['phpbb_url'], 'html_forum_disp_online' => 'globalmod', 'html_forum_disp_tracking' => 'reg', 'html_forum_disp_status' => 'reg', 'html_forum_allow_auth' => 1, 'html_forum_ltopic' => 15, 'html_forum_cat_ltopic' => 15, 'html_forum_news_ltopic' => 10, 'html_forum_cat_news_ltopic' => 10, 'html_forum_allow_profile' => 'none', 'html_forum_allow_profile_links' => 'reg', 'html_forum_last_post' => 'reg', 'html_forum_rules' => 'all', 'html_forum_desc' => 'all', 'html_forum_stats_on_news' => 'all', 'html_forum_stats_on_map' => 'all', 'html_forum_birthdays_on_news' => 'reg', 'html_forum_birthdays_on_map' => 'reg', 'html_forum_exclude' => '', 'html_forum_ltopic_exclude' => ''), 'select' => array('html_forum_exclude' => @$this->dyn_select['forums'], 'html_forum_disp_online' => @$this->dyn_select['gym_auth'], 'html_forum_disp_tracking' => @$this->dyn_select['gym_auth'], 'html_forum_disp_status' => @$this->dyn_select['gym_auth'], 'html_forum_ltopic_exclude' => @$this->dyn_select['forums'], 'html_forum_allow_profile' => @$this->dyn_select['gym_auth'], 'html_forum_allow_profile_links' => @$this->dyn_select['gym_auth'], 'html_forum_last_post' => @$this->dyn_select['gym_auth'], 'html_forum_rules' => @$this->dyn_select['gym_auth'], 'html_forum_desc' => @$this->dyn_select['gym_auth'], 'html_forum_stats_on_news' => @$this->dyn_select['gym_auth'], 'html_forum_stats_on_map' => @$this->dyn_select['gym_auth'], 'html_forum_birthdays_on_news' => @$this->dyn_select['gym_auth'], 'html_forum_birthdays_on_map' => @$this->dyn_select['gym_auth'])), 'content' => array('display_vars' => array('title' => 'HTML_NEWS', 'vars' => array('legend1' => 'HTML_NEWS', 'html_forum_allow_news' => array('lang' => 'HTML_FORUM_ALLOW_NEWS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true, 'overriding' => true), 'html_forum_allow_cat_news' => array('lang' => 'HTML_FORUM_ALLOW_CAT_NEWS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true, 'overriding' => true), 'html_forum_news_ids' => array('lang' => 'HTML_FORUM_NEWS_IDS', 'multiple_validate' => 'int', 'type' => 'custom', 'method' => 'select_multiple_string', 'explain' => true), 'legend2' => 'HTML_NEWS_CONTENT', 'html_forum_post_buttons' => array('lang' => 'HTML_FORUM_POST_BUTTONS', 'validate' => 'string', 'type' => 'select', 'method' => 'select_string', 'explain' => true), 'html_forum_allow_bbcode' => array('lang' => 'HTML_ALLOW_BBCODE', 'validate' => 'string', 'type' => 'select', 'method' => 'select_string', 'explain' => true, 'overriding' => true), 'html_forum_strip_bbcode' => array('lang' => 'HTML_STRIP_BBCODE', 'validate' => 'string', 'type' => 'text:25:200', 'explain' => true, 'overriding' => true), 'html_forum_allow_links' => array('lang' => 'HTML_ALLOW_LINKS', 'validate' => 'string', 'type' => 'select', 'method' => 'select_string', 'explain' => true, 'overriding' => true), 'html_forum_allow_emails' => array('lang' => 'HTML_ALLOW_EMAILS', 'validate' => 'string', 'type' => 'select', 'method' => 'select_string', 'explain' => true, 'overriding' => true), 'html_forum_allow_smilies' => array('lang' => 'HTML_ALLOW_SMILIES', 'validate' => 'string', 'type' => 'select', 'method' => 'select_string', 'explain' => true, 'overriding' => true), 'html_forum_allow_sig' => array('lang' => 'HTML_ALLOW_SIG', 'validate' => 'string', 'type' => 'select', 'method' => 'select_string', 'explain' => true, 'overriding' => true), 'html_forum_sumarize' => array('lang' => 'HTML_SUMARIZE', 'validate' => 'int:0:1000', 'type' => 'text:4:4', 'explain' => true, 'overriding' => true), 'html_forum_sumarize_method' => array('lang' => 'HTML_SUMARIZE_METHOD', 'validate' => 'string', 'type' => 'select', 'method' => 'select_string', 'explain' => true, 'overriding' => true))), 'default' => array('html_forum_allow_news' => 1, 'html_forum_news_ids' => '', 'html_forum_allow_cat_news' => 1, 'html_forum_post_buttons' => 'none', 'html_forum_allow_bbcode' => 'all', 'html_forum_strip_bbcode' => '', 'html_forum_allow_links' => 'all', 'html_forum_allow_emails' => 'none', 'html_forum_allow_smilies' => 'none', 'html_forum_allow_sig' => 'none', 'html_forum_sumarize' => 75, 'html_forum_sumarize_method' => 'words'), 'select' => array('html_forum_sumarize_method' => @$this->dyn_select['sumarize_method'], 'html_forum_post_buttons' => @$this->dyn_select['gym_auth'], 'html_forum_allow_bbcode' => @$this->dyn_select['gym_auth'], 'html_forum_allow_links' => @$this->dyn_select['gym_auth'], 'html_forum_allow_emails' => @$this->dyn_select['gym_auth'], 'html_forum_allow_smilies' => @$this->dyn_select['gym_auth'], 'html_forum_allow_sig' => @$this->dyn_select['gym_auth'], 'html_forum_news_ids' => @$this->dyn_select['forums'])), 'info' => array('title_lang' => 'HTML_FORUM', 'lang_file' => 'html_forum', 'actions' => array('main', 'content', 'cache', 'modrewrite', 'gzip', 'limit', 'sort', 'pagination'), 'mode' => 'rss', 'module' => 'forum'));
 }
예제 #13
0
 /**
  * Set variable $result to a particular type.
  *
  * @param mixed	&$result		The variable to fill
  * @param mixed	$var			The contents to fill with
  * @param mixed	$type			The variable type. Will be used with {@link settype()}
  * @param bool	$multibyte		Indicates whether string values may contain UTF-8 characters.
  * 								Default is false, causing all bytes outside the ASCII range (0-127) to be replaced with question marks.
  * @param bool	$trim			Indicates whether trim() should be applied to string values.
  * 								Default is true.
  */
 public function set_var(&$result, $var, $type, $multibyte = false, $trim = true)
 {
     settype($var, $type);
     $result = $var;
     if ($type == 'string') {
         $result = str_replace(array("\r\n", "\r", ""), array("\n", "\n", ''), $result);
         if ($trim) {
             $result = trim($result);
         }
         $result = htmlspecialchars($result, ENT_COMPAT, 'UTF-8');
         if ($multibyte) {
             $result = utf8_normalize_nfc($result);
         }
         if (!empty($result)) {
             // Make sure multibyte characters are wellformed
             if ($multibyte) {
                 if (!preg_match('/^./u', $result)) {
                     $result = '';
                 }
             } else {
                 // no multibyte, allow only ASCII (0-127)
                 $result = preg_replace('/[\\x80-\\xFF]/', '?', $result);
             }
         }
         $result = $this->strip ? stripslashes($result) : $result;
     }
 }
예제 #14
0
    function main($id, $mode)
    {
        global $db, $user, $auth, $template, $cache;
        global $config, $src_root_path, $src_admin_path, $phpEx;
        include $src_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('*', '%', utf8_normalize_nfc(request_var('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'];
            add_log('admin', 'LOG_DISALLOW_ADD', str_replace('%', '*', $disallowed_user));
            trigger_error($message . adm_back_link($this->u_action));
        } else {
            if ($allow) {
                $disallowed_id = request_var('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');
                add_log('admin', '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));
    }
예제 #15
0
 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')));
 }
예제 #16
0
 public function post_funct($event)
 {
     if ($this->config['autoban_active'] && $event['user_row']['user_warnings'] + 1 >= $this->config['autoban_count']) {
         if (!function_exists('user_ban')) {
             include $this->root_path . 'includes/functions_user.' . $this->php_ext;
         }
         user_ban('user', utf8_normalize_nfc($event['user_row']['username']), $this->config['autoban_duration'] * 60 * 24, '', '', $this->config['autoban_reason'], $this->config['autoban_reason']);
     }
 }
예제 #17
0
파일: main.php 프로젝트: 3D-I/regcheck
 /**
  * Check username
  *
  * @return object
  */
 public function username()
 {
     $data = array('username' => utf8_normalize_nfc($this->request->variable('username', '', true)));
     $error = validate_data($data, array('username' => array(array('string', false, $this->config['min_name_chars'], $this->config['max_name_chars']), array('username', ''))));
     $error = $this->set_error($error);
     if (sizeof($error)) {
         return new Response(implode('<br>', $error));
     }
     return new Response($this->user->lang('USERNAME_FREE'));
 }
예제 #18
0
 /**
  * Run Tool
  *
  * Does the actual stuff we want the tool to do after submission
  */
 function run_tool(&$error)
 {
     global $config, $user;
     $user->add_lang(array('acp/groups', 'ucp'));
     if (!check_form_key('add_user')) {
         $error[] = 'FORM_INVALID';
         return;
     }
     // Try to manually determine the timezone and adjust the dst if the server date/time complies with the default setting +/- 1
     $timezone = date('Z') / 3600;
     $is_dst = date('I');
     if ($config['board_timezone'] == $timezone || $config['board_timezone'] == $timezone - 1) {
         $timezone = $is_dst ? $timezone - 1 : $timezone;
         if (!isset($user->lang['tz_zones'][(string) $timezone])) {
             $timezone = $config['board_timezone'];
         }
     } else {
         $is_dst = $config['board_dst'];
         $timezone = $config['board_timezone'];
     }
     // Collect the user data
     $data = array('username' => utf8_normalize_nfc(request_var('username', '', true)), 'new_password' => request_var('new_password', '', true), 'password_confirm' => request_var('password_confirm', '', true), 'email' => strtolower(request_var('email', '')), 'email_confirm' => strtolower(request_var('email_confirm', '')), 'lang' => basename(request_var('lang', $user->lang_name)), 'tz' => request_var('tz', (double) $timezone));
     // Check vars
     $this->validate_data($data, $error);
     // Something went wrong
     if (!empty($error)) {
         return false;
     }
     // Collect the groups data
     $groups = array('default' => request_var('defaultgroup', 0), 'groups' => request_var('usergroups', array(0)), 'leaders' => request_var('groupleader', array(0)));
     // Register the user
     $user_row = array('username' => $data['username'], 'user_password' => phpbb_hash($data['new_password']), 'user_email' => $data['email'], 'group_id' => (int) $groups['default'], 'user_timezone' => (double) $data['tz'], 'user_dst' => $is_dst, 'user_lang' => $data['lang'], 'user_type' => USER_NORMAL, 'user_actkey' => '', 'user_ip' => $user->ip, 'user_regdate' => time(), 'user_inactive_reason' => 0, 'user_inactive_time' => 0);
     $user_id = user_add($user_row, false);
     // Remove the default group from the groups array. Keeping it here causes an error
     if (in_array($groups['default'], $groups['groups'])) {
         foreach ($groups['groups'] as $group_key => $group_id) {
             if ($group_id == $groups['default']) {
                 unset($groups['groups'][$group_key]);
                 break;
             }
         }
     }
     // This should not happen, because the required variables are listed above...
     if ($user_id === false) {
         trigger_error('NO_USER', E_USER_ERROR);
     }
     // Add the user to the selected groups
     $this->add_groups($user_id, $groups, $error);
     // Last check for errors
     if (!empty($error)) {
         return false;
     }
     // And done
     trigger_error('USER_ADDED');
 }
예제 #19
0
/**
* Load contribution
*
* Call this AFTER you have loaded the main object (like the FAQ item if requested for example)
*
* @param mixed $contrib contrib_id (always send if you have loaded an item for this contrib!)
*/
function load_contrib($contrib_id = false)
{
    $contrib = request_var('id', 0) ? request_var('id', 0) : utf8_normalize_nfc(request_var('c', '', true));
    $type = request_var('type', '');
    // Load the contribution
    titania::$contrib = new titania_contribution();
    if (!titania::$contrib->load($contrib)) {
        trigger_error('CONTRIB_NOT_FOUND');
    }
    // Make sure the contrib requested is the same as the contrib loaded
    if ($contrib_id !== false && $contrib_id != titania::$contrib->contrib_id || $type != titania_types::$types[titania::$contrib->contrib_type]->url) {
        // Mismatch, redirect
        redirect(titania::$contrib->get_url(basename(request_var('page', 'details'))));
    }
    // Put the author in titania::$author
    titania::$author = titania::$contrib->author;
    // Check to see if the currently accessing user is an author
    if (titania::$access_level == TITANIA_ACCESS_PUBLIC && phpbb::$user->data['is_registered'] && !phpbb::$user->data['is_bot']) {
        if (titania::$contrib->is_author || titania::$contrib->is_active_coauthor) {
            titania::$access_level = TITANIA_ACCESS_AUTHORS;
        }
    }
    // Count the number of FAQ items to display
    $flags = titania_count::get_flags(titania::$access_level);
    $faq_count = titania_count::from_db(titania::$contrib->contrib_faq_count, $flags);
    /**
     * Menu Array
     *
     * 'filename' => array(
     *	'title'		=> 'nav menu title',
     * 	'url'		=> $page_url,
     *	'auth'		=> ($can_see_page) ? true : false, // Not required, always true if missing
     * ),
     */
    $nav_ary = array('details' => array('title' => 'CONTRIB_DETAILS', 'url' => titania::$contrib->get_url()), 'faq' => array('title' => 'CONTRIB_FAQ', 'url' => titania::$contrib->get_url('faq'), 'auth' => titania::$access_level != TITANIA_ACCESS_PUBLIC || $faq_count ? true : false, 'count' => $faq_count), 'support' => array('title' => 'CONTRIB_SUPPORT', 'url' => titania::$contrib->get_url('support'), 'auth' => titania::$config->support_in_titania || titania::$access_level < TITANIA_ACCESS_PUBLIC ? true : false), 'manage' => array('title' => 'CONTRIB_MANAGE', 'url' => titania::$contrib->get_url('manage'), 'auth' => (titania::$contrib->is_author || titania::$contrib->is_active_coauthor) && phpbb::$auth->acl_get('u_titania_post_edit_own') && !in_array(titania::$contrib->contrib_status, array(TITANIA_CONTRIB_CLEANED, TITANIA_CONTRIB_DISABLED)) || phpbb::$auth->acl_get('u_titania_mod_contrib_mod') || titania_types::$types[titania::$contrib->contrib_type]->acl_get('moderate')));
    // Display nav menu
    $page = request_var('page', '');
    titania::generate_nav($nav_ary, $page, 'details');
    // Search for a category with the same name as the contrib type.  This is a bit ugly, but there really isn't any better option
    $categories_ary = titania::$cache->get_categories();
    foreach ($categories_ary as $category_id => $category_row) {
        $category_row['category_name'] = isset(phpbb::$user->lang[$category_row['category_name']]) ? phpbb::$user->lang[$category_row['category_name']] : $category_row['category_name'];
        if ($category_row['category_name'] == titania_types::$types[titania::$contrib->contrib_type]->lang || $category_row['category_name'] == titania_types::$types[titania::$contrib->contrib_type]->langs) {
            $category_object = new titania_category();
            $category_object->__set_array($categories_ary[$category_id]);
            // Generate the main breadcrumbs
            titania::generate_breadcrumbs(array($category_object->category_name => titania_url::build_url($category_object->get_url())));
            break;
        }
    }
    titania::generate_breadcrumbs(array(titania::$contrib->contrib_name => titania::$contrib->get_url()));
    if ($page) {
        titania::generate_breadcrumbs(array($nav_ary[$page]['title'] => $nav_ary[$page]['url']));
    }
}
    function announcements()
    {
        global $config, $db, $user, $auth, $template;
        global $phpbb_root_path, $phpEx;
        // Set some vars
        //$action	= request_var('action', '');
        $preview = isset($_POST['preview']) ? true : false;
        $submit = isset($_POST['submit']) ? true : false;
        $announcement_row = array('announcement_forum_id' => request_var('announcement_forum_id', 0), 'announcement_topic_id' => request_var('announcement_topic_id', 0), 'announcement_post_id' => request_var('announcement_post_id', 0), 'announcement_gopost' => request_var('announcement_gopost', 0), 'announcement_first_last_post' => utf8_normalize_nfc(request_var('announcement_first_last_post', '')), 'announcement_title' => utf8_normalize_nfc(request_var('announcement_title', $user->lang['ANNOUNCEMENT_TITLE'], true)), 'announcement_text' => utf8_normalize_nfc(request_var('announcement_text', $user->lang['ANNOUNCEMENT_TEXT'], true)), 'announcement_draft' => utf8_normalize_nfc(request_var('announcement_draft', $user->lang['ANNOUNCEMENT_DRAFT'], true)), 'announcement_title_guests' => utf8_normalize_nfc(request_var('announcement_title_guests', $user->lang['ANNOUNCEMENT_TITLE_GUESTS'], true)), 'announcement_text_guests' => utf8_normalize_nfc(request_var('announcement_text_guests', $user->lang['ANNOUNCEMENT_TEXT_GUESTS'], true)));
        if ($submit || $preview) {
            if (!check_form_key('announcement_centre')) {
                trigger_error('FORM_INVALID');
            }
        }
        if ($submit) {
            $uid_text = $bitfield_text = $options_text = '';
            // will be modified by generate_text_for_storage
            $uid_text_guests = $bitfield_text_guests = $options_text_guests = '';
            // will be modified by generate_text_for_storage
            $uid_draft = $bitfield_draft = $options_draft = '';
            // will be modified by generate_text_for_storage
            $allow_bbcode = $allow_urls = $allow_smilies = true;
            generate_text_for_storage($announcement_row['announcement_text'], $uid_text, $bitfield_text, $options_text, $allow_bbcode, $allow_urls, $allow_smilies);
            generate_text_for_storage($announcement_row['announcement_text_guests'], $uid_text_guests, $bitfield_text_guests, $options_text_guests, $allow_bbcode, $allow_urls, $allow_smilies);
            generate_text_for_storage($announcement_row['announcement_draft'], $uid_draft, $bitfield_draft, $options_draft, $allow_bbcode, $allow_urls, $allow_smilies);
            $sql_ary = array('announcement_forum_id' => (int) $announcement_row['announcement_forum_id'], 'announcement_topic_id' => (int) $announcement_row['announcement_topic_id'], 'announcement_post_id' => (int) $announcement_row['announcement_post_id'], 'announcement_gopost' => (int) $announcement_row['announcement_gopost'], 'announcement_first_last_post' => (string) $announcement_row['announcement_first_last_post'], 'announcement_title' => (string) $announcement_row['announcement_title'], 'announcement_text' => (string) $announcement_row['announcement_text'], 'announcement_text_bbcode_uid' => (string) $uid_text, 'announcement_text_bbcode_bitfield' => (string) $bitfield_text, 'announcement_text_bbcode_options' => (int) $options_text, 'announcement_draft' => (string) $announcement_row['announcement_draft'], 'announcement_draft_bbcode_uid' => (string) $uid_draft, 'announcement_draft_bbcode_bitfield' => (string) $bitfield_draft, 'announcement_draft_bbcode_options' => (int) $options_draft, 'announcement_title_guests' => (string) $announcement_row['announcement_title_guests'], 'announcement_text_guests' => (string) $announcement_row['announcement_text_guests'], 'announcement_text_guests_bbcode_uid' => (string) $uid_text_guests, 'announcement_text_guests_bbcode_bitfield' => (string) $bitfield_text_guests, 'announcement_text_guests_bbcode_options' => (int) $options_text_guests);
            $sql = 'UPDATE ' . ANNOUNCEMENTS_CENTRE_TABLE . '
					SET ' . $db->sql_build_array('UPDATE', $sql_ary);
            $db->sql_query($sql);
        }
        if ($submit) {
            add_log('admin', 'LOG_ANNOUNCEMENT_UPDATED');
            trigger_error($user->lang['LOG_ANNOUNCEMENT_UPDATED'] . adm_back_link($this->u_action));
        }
        $sql = 'SELECT * 
			FROM ' . ANNOUNCEMENTS_CENTRE_TABLE;
        $result = $db->sql_query($sql);
        $announcement = $db->sql_fetchrow($result);
        $db->sql_freeresult($result);
        $announcement_preview = '';
        if ($preview) {
            $announcement_preview = preview_announcement($announcement_row['announcement_draft']);
        }
        generate_smilies('inline', '', 1);
        $announcement_draft = '';
        $announcement_draft = $announcement['announcement_draft'];
        $announcement_draft = generate_text_for_display($announcement_draft, $announcement['announcement_draft_bbcode_uid'], $announcement['announcement_draft_bbcode_bitfield'], $announcement['announcement_draft_bbcode_options']);
        decode_message($announcement['announcement_text'], $announcement['announcement_text_bbcode_uid']);
        decode_message($announcement['announcement_draft'], $announcement['announcement_draft_bbcode_uid']);
        decode_message($announcement['announcement_text_guests'], $announcement['announcement_text_guests_bbcode_uid']);
        $template->assign_vars(array('U_ACTION' => $this->u_action, 'S_ANNOUNCEMENT_CONFIGURATION' => false, 'ANNOUNCEMENT_TITLE' => $announcement['announcement_title'], 'ANNOUNCEMENT_FORUM_ID' => $announcement['announcement_forum_id'], 'ANNOUNCEMENT_TOPIC_ID' => $announcement['announcement_topic_id'], 'ANNOUNCEMENT_POST_ID' => $announcement['announcement_post_id'], 'ANNOUNCEMENT_GOPOST' => $announcement['announcement_gopost'], 'ANNOUNCEMENT_FIRST_LAST_POST' => $announcement['announcement_first_last_post'], 'ANNOUNCEMENT_TEXT' => $announcement['announcement_text'], 'ANNOUNCEMENT_DRAFT' => $announcement_preview ? $announcement_row['announcement_draft'] : $announcement['announcement_draft'], 'ANNOUNCEMENT_DRAFT_PREVIEW' => $announcement_preview ? $announcement_preview : $announcement_draft, 'ANNOUNCEMENT_TITLE_GUESTS' => $announcement['announcement_title_guests'], 'ANNOUNCEMENT_TEXT_GUESTS' => $announcement['announcement_text_guests'], 'ANNOUNCEMENT_VERSION' => $config['acmod_version']));
        // Assigning custom bbcodes
        display_custom_bbcodes();
    }
예제 #21
0
 /**
  * {@inheritdoc}
  */
 public function get_input($name, $default, $multibyte = false)
 {
     $result = $default;
     if (isset($this->input_values[$name])) {
         $result = $this->input_values[$name];
     }
     if ($multibyte) {
         return utf8_normalize_nfc($result);
     }
     return $result;
 }
 public function main($id, $mode)
 {
     global $config, $request, $template, $user, $cache, $phpbb_container;
     // shortcut
     $conf_prefix = prefixes::CONFIG;
     // common language file for DATEFORMAT_EXPLANATION
     $user->add_lang('acp/board');
     // Add the activitystats ACP lang file
     $user->add_lang_ext('robertheim/activitystats', 'activitystats_acp');
     // Load a template from adm/style for our ACP page
     $this->tpl_name = 'activitystats';
     // Set the page title for our ACP page
     $this->page_title = 'ACP_ACTIVITY_STATS_SETTINGS';
     // Define the name of the form for use as a form key
     $form_name = 'activity/stats';
     add_form_key($form_name);
     if ($request->is_set_post('submit')) {
         if (!check_form_key($form_name)) {
             trigger_error('FORM_INVALID');
         }
         $config->set($conf_prefix . '_disp_new_topics', $request->variable($conf_prefix . '_disp_new_topics', 0));
         $config->set($conf_prefix . '_disp_new_posts', $request->variable($conf_prefix . '_disp_new_posts', 0));
         $config->set($conf_prefix . '_disp_new_users', $request->variable($conf_prefix . '_disp_new_users', 0));
         $config->set($conf_prefix . '_disp_bots', $request->variable($conf_prefix . '_disp_bots', 0));
         $config->set($conf_prefix . '_disp_guests', $request->variable($conf_prefix . '_disp_guests', 0));
         $config->set($conf_prefix . '_disp_hidden', $request->variable($conf_prefix . '_disp_hidden', 0));
         $config->set($conf_prefix . '_disp_time', $request->variable($conf_prefix . '_disp_time', 0));
         $config->set($conf_prefix . '_disp_time_format', utf8_normalize_nfc($request->variable($conf_prefix . '_disp_time_format', 'H:i', true)));
         $config->set($conf_prefix . '_disp_ip', $request->variable($conf_prefix . '_disp_ip', 0));
         $config->set($conf_prefix . '_mode', $request->variable($conf_prefix . '_mode', modes::TODAY));
         $config->set($conf_prefix . '_del_time_d', $request->variable($conf_prefix . '_del_time_d', 0));
         $config->set($conf_prefix . '_del_time_h', $request->variable($conf_prefix . '_del_time_h', 0));
         $config->set($conf_prefix . '_del_time_m', $request->variable($conf_prefix . '_del_time_m', 0));
         $config->set($conf_prefix . '_del_time_s', $request->variable($conf_prefix . '_del_time_s', 0));
         $config->set($conf_prefix . '_sort_by', $request->variable($conf_prefix . '_sort_by', 0));
         $config->set($conf_prefix . '_check_permissions', $request->variable($conf_prefix . '_check_permissions', 0));
         $config->set($conf_prefix . '_cache_time', $request->variable($conf_prefix . '_cache_time', 600));
         $config->set($conf_prefix . '_record', $request->variable($conf_prefix . '_record', 0));
         $config->set($conf_prefix . '_record_timeformat', utf8_normalize_nfc($request->variable($conf_prefix . '_record_timeformat', 'D j. M Y', true)));
         if ($request->variable($conf_prefix . '_reset', 0) > 0) {
             $reset_time = time();
             $config->set($conf_prefix . '_record_count', 1);
             $config->set($conf_prefix . '_record_time', $reset_time);
             $config->set($conf_prefix . '_reset_time', $reset_time);
             $sessions_manager = $phpbb_container->get('robertheim.activitystats.sessions_manager');
             $sessions_manager->prune($reset_time);
         }
         // clear cache
         $cache->destroy('_robertheim_activitystats');
         trigger_error($user->lang('ACTIVITY_STATS_SETTINGS_SAVED') . adm_back_link($this->u_action));
     }
     $template->assign_vars(array('ACTIVITY_STATS_MOD_VERSION' => $user->lang('ACTIVITY_STATS_INSTALLED', $config[$conf_prefix . '_version']), 'ACTIVITY_STATS_DISP_NEW_TOPICS' => $config[$conf_prefix . '_disp_new_topics'], 'ACTIVITY_STATS_DISP_NEW_POSTS' => $config[$conf_prefix . '_disp_new_posts'], 'ACTIVITY_STATS_DISP_NEW_USERS' => $config[$conf_prefix . '_disp_new_users'], 'ACTIVITY_STATS_DISP_BOTS' => $config[$conf_prefix . '_disp_bots'], 'ACTIVITY_STATS_DISP_GUESTS' => $config[$conf_prefix . '_disp_guests'], 'ACTIVITY_STATS_DISP_HIDDEN' => $config[$conf_prefix . '_disp_hidden'], 'ACTIVITY_STATS_DISP_TIME' => $config[$conf_prefix . '_disp_time'], 'ACTIVITY_STATS_DISP_TIME_FORMAT' => $config[$conf_prefix . '_disp_time_format'], 'ACTIVITY_STATS_DISP_IP' => $config[$conf_prefix . '_disp_ip'], 'ACTIVITY_STATS_MODE' => $config[$conf_prefix . '_mode'], 'ACTIVITY_STATS_DEL_TIME_D' => $config[$conf_prefix . '_del_time_d'], 'ACTIVITY_STATS_DEL_TIME_H' => $config[$conf_prefix . '_del_time_h'], 'ACTIVITY_STATS_DEL_TIME_M' => $config[$conf_prefix . '_del_time_m'], 'ACTIVITY_STATS_DEL_TIME_S' => $config[$conf_prefix . '_del_time_s'], 'ACTIVITY_STATS_SORT_BY' => $config[$conf_prefix . '_sort_by'], 'ACTIVITY_STATS_CACHE_TIME' => $config[$conf_prefix . '_cache_time'], 'ACTIVITY_STATS_CHECK_PERMISSIONS' => $config[$conf_prefix . '_check_permissions'], 'ACTIVITY_STATS_RECORD' => $config[$conf_prefix . '_record'], 'ACTIVITY_STATS_RECORD_TIMEFORMAT' => $config[$conf_prefix . '_record_timeformat'], 'U_ACTION' => $this->u_action));
 }
예제 #23
0
파일: listener.php 프로젝트: Galixte/apwa
 /** User PM welcome message */
 private function user_welcome($user_to, $user_id, $subject, $text)
 {
     $m_flags = 3;
     // 1 is bbcode, 2 is smiles, 4 is urls (add together to turn on more than one)
     $uid = $bitfield = '';
     $allow_bbcode = $allow_urls = $allow_smilies = true;
     $text = str_replace('{USERNAME}', $this->user->data['username'], $text);
     generate_text_for_storage($text, $uid, $bitfield, $m_flags, $allow_bbcode, $allow_urls, $allow_smilies);
     include_once $this->phpbb_root_path . 'includes/functions_privmsgs.' . $this->php_ext;
     $pm_data = array('address_list' => array('u' => array($user_to => 'to')), 'from_user_id' => $user_id, 'from_user_ip' => $this->user->ip, 'enable_sig' => false, 'enable_bbcode' => $allow_bbcode, 'enable_smilies' => $allow_smilies, 'enable_urls' => $allow_urls, 'icon_id' => 0, 'bbcode_bitfield' => $bitfield, 'bbcode_uid' => $uid, 'message' => utf8_normalize_nfc($text));
     submit_pm('post', utf8_normalize_nfc($subject), $pm_data, false);
 }
예제 #24
0
    public function edit_user_ranks()
    {
        $this->template->assign_vars(array('U_ACTION' => $this->u_action, 'S_FIND_USER' => true, 'U_FIND_USERNAME' => append_sid("{$this->root_path}memberlist.{$this->php_ext}", 'mode=searchuser&amp;form=select_user&amp;field=username&amp;select_single=true')));
        $submit = isset($_POST['submit-user']) ? true : false;
        if ($submit) {
            $username = utf8_normalize_nfc(request_var('username', '', true));
            $user_sql = 'SELECT *
				FROM ' . USERS_TABLE . "\n\t\t\t\tWHERE username_clean = '" . $this->db->sql_escape(utf8_clean_string($username)) . "'";
            $user_result = $this->db->sql_query($user_sql);
            $user_row = $this->db->sql_fetchrow($user_result);
            $user_id = (int) $user_row['user_id'];
            $this->db->sql_freeresult($user_result);
            if (!$user_id) {
                trigger_error($this->user->lang['NO_USER'] . adm_back_link($this->u_action), E_USER_WARNING);
            }
            $rank_sql = 'SELECT *
					FROM ' . RANKS_TABLE . '
					WHERE rank_special = 1
					ORDER BY rank_title';
            $rank_result = $this->db->sql_query($rank_sql);
            $s_rank_one_options = '<option value="0"' . (!$user_row['user_rank'] ? ' selected="selected"' : '') . '>' . $this->user->lang['ACP_NO_SPEC_RANK'] . '</option>';
            $s_rank_two_options = '<option value="0"' . (!$user_row['user_rank_two'] ? ' selected="selected"' : '') . '>' . $this->user->lang['ACP_NO_SPEC_RANK'] . '</option>';
            $s_rank_three_options = '<option value="0"' . (!$user_row['user_rank_three'] ? ' selected="selected"' : '') . '>' . $this->user->lang['ACP_NO_SPEC_RANK'] . '</option>';
            while ($row = $this->db->sql_fetchrow($rank_result)) {
                $selected1 = $user_row['user_rank'] && $row['rank_id'] == $user_row['user_rank'] ? ' selected="selected"' : '';
                $s_rank_one_options .= '<option value="' . $row['rank_id'] . '"' . $selected1 . '>' . $row['rank_title'] . '</option>';
                $selected2 = $user_row['user_rank_two'] && $row['rank_id'] == $user_row['user_rank_two'] ? ' selected="selected"' : '';
                $s_rank_two_options .= '<option value="' . $row['rank_id'] . '"' . $selected2 . '>' . $row['rank_title'] . '</option>';
                $selected3 = $user_row['user_rank_three'] && $row['rank_id'] == $user_row['user_rank_three'] ? ' selected="selected"' : '';
                $s_rank_three_options .= '<option value="' . $row['rank_id'] . '"' . $selected3 . '>' . $row['rank_title'] . '</option>';
            }
            $this->db->sql_freeresult($result);
            $this->template->assign_vars(array('ACP_MR_USER' => sprintf($this->user->lang['ACP_EDIT_USER_RANK'], $user_row['username']), 'S_EDIT_RANKS' => true, 'S_FIND_USER' => false, 'S_RANK_ONE_OPTIONS' => $s_rank_one_options, 'S_RANK_TWO_OPTIONS' => $s_rank_two_options, 'S_RANK_THREE_OPTIONS' => $s_rank_three_options, 'HIDDEN_RANK_USER_ID' => $user_id));
        }
        add_form_key('submit-rank-key');
        $upd_rank = isset($_POST['submit-rank']) ? true : false;
        if ($upd_rank) {
            if (check_form_key('submit-rank-key')) {
                $rank_one = request_var('user_rank_one', 0);
                $rank_two = request_var('user_rank_two', 0);
                $rank_thr = request_var('user_rank_three', 0);
                $upd_user_id = request_var('hidden_user_id', 0);
                $upd_sql = 'UPDATE ' . USERS_TABLE . '
							SET user_rank = ' . $rank_one . ',
								user_rank_two = ' . $rank_two . ',
								user_rank_three = ' . $rank_thr . '
							WHERE user_id = ' . $upd_user_id;
                $this->db->sql_query($upd_sql);
                trigger_error($this->user->lang('ACP_MR_SAVED') . adm_back_link($this->u_action));
            }
        }
    }
예제 #25
0
	/**
	* Run Tool
	*
	* Does the actual stuff we want the tool to do after submission
	*/
	function run_tool(&$error)
	{
		global $db, $plugin, $user;

        if (!confirm_box(true) && !check_form_key('make_founder'))
		{
			$error[] = 'FORM_INVALID';
			return;
		}

		$user_req = utf8_normalize_nfc(request_var('user_to_founder', '', true));
		if (!$user_req)
		{
			$error[] = 'NO_USER';
			return;
		}

		$sql = 'SELECT user_id, username, user_type FROM ' . USERS_TABLE . '
			WHERE ' . ((!is_numeric($user_req)) ? 'username_clean = \'' . $db->sql_escape(utf8_clean_string($user_req)) . '\'' : 'user_id = ' . (int) $user_req);
		$result = $db->sql_query($sql);
		$row = $db->sql_fetchrow($result);
		$db->sql_freeresult($result);
		$user_id = (int) $row['user_id'];
		$username = $row['username'];

		if (!$user_id)
		{
			$error[] = 'NO_USER';
			return;
		}

		if ($row['user_type'] == USER_FOUNDER)
		{
			$error[] = sprintf($user->lang['USER_ALREADY_FOUNDER'], $username);
			return;
		}

		// Let's confirm just in case they enter the wrong username (and that username happens to be registered).
		if (confirm_box(true))
		{
			$db->sql_query('UPDATE ' . USERS_TABLE . ' SET ' . $db->sql_build_array('UPDATE', array('user_type' => USER_FOUNDER)) . ' WHERE user_id = ' . $user_id);

			trigger_error(sprintf($user->lang['MAKE_FOUNDER_SUCCESS'], append_sid(PHPBB_ROOT_PATH . 'memberlist.' . PHP_EXT, 'mode=viewprofile&amp;u=' . $user_id), $username));
		}
		else
		{
			$hidden_fields = build_hidden_fields(array('user_to_founder' => $user_req, 'submit' => true));
			confirm_box(false, sprintf($user->lang['MAKE_FOUNDER_CONFIRM'], append_sid(PHPBB_ROOT_PATH . 'memberlist.' . PHP_EXT, 'mode=viewprofile&amp;u=' . $user_id), $username), $hidden_fields);
		}
		redirect(append_sid(STK_INDEX, 't=make_founder', true, $user->session_id));
	}
예제 #26
0
파일: sitemap.php 프로젝트: nivit/seourls
 /**
  * Replace letters to use title in URL
  *
  * @param	string	$title	The title to use in the URL
  * @return	string	Title to use in URLs
  */
 private function title_to_url($title)
 {
     $url = strtolower(censor_text(utf8_normalize_nfc(strip_tags($title))));
     // Let's replace
     $url_search = array(' ', 'í', 'ý', 'ß', 'ö', 'ô', 'ó', 'ò', 'ä', 'â', 'à', 'á', 'é', 'è', 'ü', 'ú', 'ù', 'ñ', 'ß', '²', '³', '@', '€', '$');
     $url_replace = array('-', 'i', 'y', 's', 'oe', 'o', 'o', 'o', 'ae', 'a', 'a', 'a', 'e', 'e', 'ue', 'u', 'u', 'n', 'ss', '2', '3', 'at', 'eur', 'usd');
     $url = str_replace($url_search, $url_replace, $url);
     $url_search = array('&amp;', '&quot;', '&', '"', "'", '¸', '`', '(', ')', '[', ']', '<', '>', '{', '}', '.', ':', ',', ';', '!', '?', '+', '*', '/', '=', 'µ', '#', '~', '"', '§', '%', '|', '°', '^', '„', '“');
     $url = str_replace($url_search, '-', $url);
     $url = str_replace(array('----', '---', '--'), '-', $url);
     $url = substr($url, 0, 50);
     // Max length for a title in URL
     return urlencode($url);
 }
예제 #27
0
 /**
  * Reads all tags from request variable 'rh_topictags' and splits them by the separator (default: comma (',')) and trims them.
  * NOTE: These tags might be dirty!
  *
  * @return array of dirty tags
  */
 private function get_tags_from_post_request()
 {
     $tags_string = utf8_normalize_nfc($this->request->variable('rh_topictags', '', true));
     $tags_string = rawurldecode(base64_decode($tags_string));
     if ('' === $tags_string) {
         return array();
     }
     $tagsJson = json_decode($tags_string, true);
     $tags = array();
     for ($i = 0, $count = sizeof($tagsJson); $i < $count; $i++) {
         $tags[] = trim($tagsJson[$i]['text']);
     }
     return $tags;
 }
예제 #28
0
function report_pm_func($xmlrpc_params)
{
    global $db, $user, $config;
    $user->setup('mcp');
    $params = php_xmlrpc_decode($xmlrpc_params);
    $post_id = 0;
    $pm_id = intval($params[0]);
    $report_text = utf8_normalize_nfc($params[1]);
    $reason_id = intval($params[2]) ? intval($params[2]) : 2;
    $forum_id = intval($params[3]) ? intval($params[3]) : '';
    $user_notify = true;
    if (!$pm_id || !$config['allow_pm_report']) {
        trigger_error('NO_POST_SELECTED');
    }
    // Grab all relevant data
    $sql = 'SELECT p.*, pt.*
        FROM ' . PRIVMSGS_TABLE . ' p, ' . PRIVMSGS_TO_TABLE . " pt\r\r\n        WHERE p.msg_id = {$pm_id}\r\r\n            AND p.msg_id = pt.msg_id\r\r\n            AND (p.author_id = " . $user->data['user_id'] . " OR pt.user_id = " . $user->data['user_id'] . ")";
    $result = $db->sql_query($sql);
    $report_data = $db->sql_fetchrow($result);
    $db->sql_freeresult($result);
    if (!$report_data) {
        $user->add_lang('ucp');
        trigger_error('NO_MESSAGE');
    }
    if ($report_data['message_reported']) {
        trigger_error('ALREADY_REPORTED_PM');
    }
    $sql = 'SELECT *
        FROM ' . REPORTS_REASONS_TABLE . "\r\r\n        WHERE reason_id = {$reason_id}";
    $result = $db->sql_query($sql);
    $row = $db->sql_fetchrow($result);
    $db->sql_freeresult($result);
    if (!$row || !$report_text && strtolower($row['reason_title']) == 'other') {
        trigger_error('EMPTY_REPORT');
    }
    $sql_ary = array('reason_id' => (int) $reason_id, 'post_id' => $post_id, 'pm_id' => $pm_id, 'user_id' => (int) $user->data['user_id'], 'user_notify' => (int) $user_notify, 'report_closed' => 0, 'report_time' => (int) time(), 'report_text' => (string) $report_text);
    $sql = 'INSERT INTO ' . REPORTS_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary);
    $db->sql_query($sql);
    $report_id = $db->sql_nextid();
    $sql = 'UPDATE ' . PRIVMSGS_TABLE . '
        SET message_reported = 1
        WHERE msg_id = ' . $pm_id;
    $db->sql_query($sql);
    $sql_ary = array('msg_id' => $pm_id, 'user_id' => ANONYMOUS, 'author_id' => (int) $report_data['author_id'], 'pm_deleted' => 0, 'pm_new' => 0, 'pm_unread' => 0, 'pm_replied' => 0, 'pm_marked' => 0, 'pm_forwarded' => 0, 'folder_id' => PRIVMSGS_INBOX);
    $sql = 'INSERT INTO ' . PRIVMSGS_TO_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary);
    $db->sql_query($sql);
    $result = new xmlrpcval(array('result' => new xmlrpcval(true, 'boolean')), 'struct');
    return new xmlrpcresp($result);
}
 function main($id, $mode)
 {
     global $config, $db, $user, $auth, $template;
     global $phpbb_root_path, $phpEx;
     // Quick var-checking and var setup.
     $submit = isset($_POST['submit']) ? true : false;
     $action = request_var('action', '');
     $errors = array();
     $merge = $action == 'merge' ? true : false;
     $old_username = utf8_normalize_nfc(request_var('old_username', '', true));
     $new_username = utf8_normalize_nfc(request_var('new_username', '', true));
     // Setup some things for the module.
     $user->add_lang(array('mods/info_acp_user_merge', 'mods/lang_user_merge'));
     $this->tpl_name = 'acp_user_merge';
     $form_key = 'acp_user_merge';
     add_form_key($form_key);
     // Hath we an invalid form key?
     if ($submit && !check_form_key($form_key)) {
         $errors[] = $user->lang['FORM_INVALID'];
     }
     if ($submit || $merge) {
         $old_user_id = $this->check_user($old_username, $errors, true);
         $new_user_id = $this->check_user($new_username, $errors, false);
     }
     // Make sure we have submitted the form, and that we do not have errors
     if (($submit || $merge) && !sizeof($errors)) {
         // Have we confirmed this change?
         if (confirm_box(true)) {
             // Let's roll!
             user_merge($old_user_id, $new_user_id);
             add_log('admin', 'LOG_USERS_MERGED', $old_username . ' &raquo; ' . $new_username);
             trigger_error($user->lang['USERS_MERGED'] . adm_back_link($this->u_action));
         } else {
             $hidden_fields = array('i' => $id, 'mode' => $mode, 'old_username' => $old_username, 'new_username' => $new_username, 'action' => 'merge');
             // Be annoying.  Are you suuuuuuuuuuuure?  No, really, are you sure?
             confirm_box(false, $user->lang['MERGE_USERS_CONFIRM'], build_hidden_fields($hidden_fields));
         }
     }
     $user_merge_version = !empty($config['user_merge_version']) ? $config['user_merge_version'] : '';
     // Assign template stuffs now.
     $this->page_title = $user->lang['ACP_USER_MERGE_TITLE'];
     $template->assign_vars(array('S_ERROR' => sizeof($errors) ? true : false, 'ERROR_MSG' => implode('<br />', $errors), 'USER_MERGE_VERSION' => $user_merge_version, 'U_FIND_OLD_USERNAME' => append_sid("{$phpbb_root_path}memberlist.{$phpEx}", 'mode=searchuser&amp;form=user_merge&amp;field=old_username&amp;select_single=true'), 'U_FIND_NEW_USERNAME' => append_sid("{$phpbb_root_path}memberlist.{$phpEx}", 'mode=searchuser&amp;form=user_merge&amp;field=new_username&amp;select_single=true'), 'OLD_USERNAME' => !empty($old_user_id) ? $old_username : '', 'NEW_USERNAME' => !empty($new_user_id) ? $new_username : '', 'L_TITLE' => $user->lang['ACP_USER_MERGE_TITLE'], 'L_EXPLAIN' => $user->lang['ACP_USER_MERGE_EXPLAIN'], 'U_ACTION' => $this->u_action));
 }
예제 #30
0
파일: admin.php 프로젝트: ahmatjan/Crimson
function sendphpbbfp($raidid, $raidname, $raidtime, $raiddate, $raiddesc)
{
    include_once './forum/includes/functions_posting.php';
    // note that multibyte support is enabled here
    $my_subject = 'New Raid Posted';
    $my_text = utf8_normalize_nfc('[color=#BF00BF][size=150][b]' . $raidname . '[/b][/size][/color]
			
			[b]Date:[/b] ' . $raiddate . '
			[b]Time:[/b] ' . $raidtime . ' UTC (GMT)
			
			[b][url=http://www.crimson-alliance.com/calendar_signup.php?id=' . $raidid . ']Click here to sign up.[/url][/b]
			
			[b]Description:[/b]
			' . $raiddesc . '');
    // variables to hold the parameters for submit_post
    $poll = $uid = $bitfield = $options = '';
    generate_text_for_storage($my_subject, $uid, $bitfield, $options, false, false, false);
    generate_text_for_storage($my_text, $uid, $bitfield, $options, true, true, true);
    $data = array('forum_id' => 24, 'topic_id' => 7, 'icon_id' => false, 'enable_bbcode' => true, 'enable_smilies' => true, 'enable_urls' => true, 'enable_sig' => false, 'message' => $my_text, 'message_md5' => md5($my_text), 'bbcode_bitfield' => $bitfield, 'bbcode_uid' => $uid, 'post_edit_locked' => 0, 'topic_title' => $my_subject, 'notify_set' => false, 'notify' => false, 'post_time' => 0, 'forum_name' => 'Raid Postings', 'enable_indexing' => true, 'force_approved_state' => true);
    submit_post('reply', $my_subject, '', POST_NORMAL, $poll, $data, $update_message = true);
}