本文整理汇总了PHP中add_form_key函数的典型用法代码示例。如果您正苦于以下问题:PHP add_form_key函数的具体用法?PHP add_form_key怎么用?PHP add_form_key使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了add_form_key函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: main
function main($id, $mode)
{
global $config, $request, $template, $user, $phpbb_log;
$user->add_lang('acp/common');
$this->tpl_name = 'acp_markpostunread';
$this->page_title = $user->lang('MARKPOSTUNREAD_TITLE');
add_form_key('acp_markpostunread');
if ($request->is_set_post('submit')) {
if (!check_form_key('acp_markpostunread')) {
trigger_error($user->lang('FORM_INVALID') . adm_back_link($this->u_action));
}
foreach ($this->settings as $setting => $default) {
if (!is_null($default)) {
$value = $request->variable($setting, $default, is_string($default));
if ($setting === 'enabled' && $value && !$config['load_db_lastread']) {
trigger_error($user->lang('MARKPOSTUNREAD_ENABLE_FAILED') . adm_back_link($this->u_action), E_USER_WARNING);
}
$config->set($this->setting_prefix . $setting, $value);
}
}
$user_id = empty($user->data) ? ANONYMOUS : $user->data['user_id'];
$user_ip = empty($user->ip) ? '' : $user->ip;
$phpbb_log->add('admin', $user_id, $user_ip, 'MARKPOSTUNREAD_CONFIG_UPDATED');
trigger_error($user->lang('CONFIG_UPDATED') . adm_back_link($this->u_action));
}
$template_vars = array();
foreach ($this->settings as $setting => $default) {
$setting_full = $this->setting_prefix . $setting;
$key = strtoupper(str_replace('.', '_', $setting_full));
$template_vars[$key] = isset($config[$setting_full]) ? $config[$setting_full] : $default;
}
$template->assign_vars($template_vars);
}
示例2: main
public function main($id, $mode)
{
global $config, $user, $template, $request;
$this->tpl_name = 'acp_usermap_body';
$this->page_title = $user->lang('ACP_USERMAP_TITLE');
$user->add_lang_ext('tas2580/usermap', 'acp');
add_form_key('acp_usermap');
// Form is submitted
if ($request->is_set_post('submit')) {
if (!check_form_key('acp_usermap')) {
trigger_error($user->lang('FORM_INVALID') . adm_back_link($this->u_action), E_USER_WARNING);
}
// Set the new settings to config
$config->set('tas2580_usermap_lon', substr($request->variable('usermap_lon', ''), 0, 10));
$config->set('tas2580_usermap_lat', substr($request->variable('usermap_lat', ''), 0, 10));
$config->set('tas2580_usermap_zoom', $request->variable('usermap_zoom', 0));
$config->set('tas2580_usermap_map_type', $request->variable('map_type', ''));
$config->set('tas2580_usermap_google_api_key', $request->variable('google_api_key', ''));
$config->set('tas2580_usermap_search_distance', $request->variable('search_distance', 0));
$config->set('tas2580_usermap_map_in_viewprofile', $request->variable('map_in_viewprofile', 0));
$config->set('tas2580_usermap_distance_in_viewtopic', $request->variable('distance_in_viewtopic', 0));
$config->set('tas2580_usermap_distance_format', $request->variable('distance_format', 0));
$config->set('tas2580_usermap_max_marker', $request->variable('max_marker', 100));
trigger_error($user->lang('ACP_SAVED') . adm_back_link($this->u_action));
}
// Send the curent settings to template
$template->assign_vars(array('U_ACTION' => $this->u_action, 'USERMAP_LON' => $config['tas2580_usermap_lon'], 'USERMAP_LAT' => $config['tas2580_usermap_lat'], 'USERMAP_ZOOM' => $config['tas2580_usermap_zoom'], 'MAP_TYPE_SELECT' => $this->map_select($config['tas2580_usermap_map_type']), 'GOOGLE_API_KEY' => $config['tas2580_usermap_google_api_key'], 'SEARCH_DISTANCE' => $config['tas2580_usermap_search_distance'], 'MAP_IN_VIEWPROFILE' => $config['tas2580_usermap_map_in_viewprofile'], 'DISTANCE_IN_VIEWTOPIC' => $config['tas2580_usermap_distance_in_viewtopic'], 'DISTANCE_FORMAT' => $config['tas2580_usermap_distance_format'], 'MAX_MARKER' => $config['tas2580_usermap_max_marker']));
}
示例3: main
public function main($id, $mode)
{
global $phpbb_container, $table_prefix;
if (!defined('CHAT_TABLE')) {
$chat_table = $table_prefix . 'ajax_chat';
define('CHAT_TABLE', $chat_table);
}
$this->id = $id;
$this->mode = $mode;
// Initialization
$this->auth = $phpbb_container->get('auth');
$this->config = $phpbb_container->get('config');
$this->db = $phpbb_container->get('dbal.conn');
$this->user = $phpbb_container->get('user');
$this->template = $phpbb_container->get('template');
$this->request = $phpbb_container->get('request');
$this->u_action = $this->request->variable('action', '', true);
$submit = $this->request->is_set_post('submit') ? true : false;
$this->form_key = 'acp_ajax_chat';
add_form_key($this->form_key);
$display_vars = ['title' => 'ACP_AJAX_CHAT_TITLE', 'vars' => ['legend1' => 'AJAX_CHAT_SETTINGS', 'display_ajax_chat' => ['lang' => 'DISPLAY_AJAX_CHAT', 'validate' => 'bool', 'type' => 'radio:enabled_enabled', 'explain' => false], 'index_display_ajax_chat' => ['lang' => 'INDEX_DISPLAY_AJAX_CHAT', 'validate' => 'bool', 'type' => 'radio:enabled_enabled', 'explain' => true], 'whois_chatting' => ['lang' => 'WHOIS_CHATTING', 'validate' => 'bool', 'type' => 'radio:enabled_enabled', 'explain' => true], 'rule_ajax_chat' => ['lang' => 'RULE_AJAX_CHAT', 'validate' => 'string', 'type' => 'text:40:255', 'explain' => true], 'ajax_chat_archive_amount' => ['lang' => 'ARCHIVE_AMOUNT_AJAX_CHAT', 'validate' => 'int', 'type' => 'number:5:500', 'explain' => true], 'ajax_chat_popup_amount' => ['lang' => 'POPUP_AMOUNT_AJAX_CHAT', 'validate' => 'int', 'type' => 'number:5:150', 'explain' => true], 'ajax_chat_index_amount' => ['lang' => 'INDEX_AMOUNT_AJAX_CHAT', 'validate' => 'int', 'type' => 'number:5:150', 'explain' => true], 'ajax_chat_chat_amount' => ['lang' => 'CHAT_AMOUNT_AJAX_CHAT', 'validate' => 'int', 'type' => 'number:5:150', 'explain' => true], 'ajax_chat_time_setting' => ['lang' => 'TIME_SETTING_AJAX_CHAT', 'validate' => 'string', 'type' => 'text:10:20', 'explain' => true], 'refresh_online_chat' => ['lang' => 'REFRESH_ONLINE_CHAT', 'validate' => 'int', 'type' => 'number:0:9999', 'explain' => true], 'refresh_idle_chat' => ['lang' => 'REFRESH_IDLE_CHAT', 'validate' => 'int', 'type' => 'number:0:9999', 'explain' => true], 'refresh_offline_chat' => ['lang' => 'REFRESH_OFFLINE_CHAT', 'validate' => 'int', 'type' => 'number:0:9999', 'explain' => true], 'status_online_chat' => ['lang' => 'STATUS_ONLINE_CHAT', 'validate' => 'int', 'type' => 'number:0:9999', 'explain' => true], 'status_idle_chat' => ['lang' => 'STATUS_IDLE_CHAT', 'validate' => 'int', 'type' => 'number:0:9999', 'explain' => true], 'status_offline_chat' => ['lang' => 'STATUS_OFFLINE_CHAT', 'validate' => 'int', 'type' => 'number:0:9999', 'explain' => true], 'legend2' => 'AJAX_CHAT_LOCATION', 'location_ajax_chat_override' => ['lang' => 'LOCATION_AJAX_CHAT_OVERRIDE', 'validate' => 'bool', 'type' => 'radio:enabled_enabled', 'explain' => true], 'location_ajax_chat' => ['lang' => 'LOCATION_AJAX_CHAT', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true], 'legend3' => 'AJAX_CHAT_POSTS', 'ajax_chat_forum_posts' => ['lang' => 'FORUM_POSTS_AJAX_CHAT', 'validate' => 'bool', 'type' => 'radio:enabled_enabled', 'explain' => false], 'ajax_chat_forum_topic' => ['lang' => 'FORUM_POSTS_AJAX_CHAT_TOPIC', 'validate' => 'bool', 'type' => 'radio:enabled_enabled', 'explain' => false], 'ajax_chat_forum_reply' => ['lang' => 'FORUM_POSTS_AJAX_CHAT_REPLY', 'validate' => 'bool', 'type' => 'radio:enabled_enabled', 'explain' => false], 'ajax_chat_forum_edit' => ['lang' => 'FORUM_POSTS_AJAX_CHAT_EDIT', 'validate' => 'bool', 'type' => 'radio:enabled_enabled', 'explain' => false], 'ajax_chat_forum_quote' => ['lang' => 'FORUM_POSTS_AJAX_CHAT_QUOTE', 'validate' => 'bool', 'type' => 'radio:enabled_enabled', 'explain' => false], 'legend4' => 'AJAX_CHAT_PRUNE', 'prune_ajax_chat' => ['lang' => 'PRUNE_AJAX_CHAT', 'validate' => 'bool', 'type' => 'radio:enabled_enabled', 'explain' => true], 'prune_keep_ajax_chat' => ['lang' => 'PRUNE_KEEP_AJAX_CHAT', 'validate' => 'int', 'type' => 'number', 'explain' => false], 'prune_now' => ['lang' => 'PRUNE_NOW', 'validate' => 'bool', 'type' => 'custom', 'explain' => false, 'method' => 'prune_chat'], 'truncate_now' => ['lang' => 'TRUNCATE_NOW', 'validate' => 'bool', 'type' => 'custom', 'explain' => false, 'method' => 'truncate_chat'], 'ajax_chat_counter' => ['lang' => 'CHAT_COUNTER', 'validate' => 'bool', 'type' => 'custom', 'explain' => false, 'method' => 'chat_counter'], 'legend5' => 'ACP_SUBMIT_CHANGES']];
#region Submit
if ($submit) {
$submit = $this->do_submit_stuff($display_vars);
// If the submit was valid, so still submitted
if ($submit) {
trigger_error($this->user->lang('CONFIG_UPDATED') . adm_back_link($this->u_action), E_USER_NOTICE);
}
}
#endregion
$this->generate_stuff_for_cfg_template($display_vars);
// Output page template file
$this->tpl_name = 'ajax_chat';
$this->page_title = $this->user->lang($display_vars['title']);
}
示例4: main
function main($id, $mode)
{
global $request, $template, $user, $phpbb_container, $phpbb_root_path, $config, $phpEx;
$this->request = $request;
$this->config = $config;
$this->user = $user;
$this->phpbb_container = $phpbb_container;
$this->template = $template;
$this->proxy = $this->phpbb_container->get('wardormeur.phpbbwpunicorn.proxy');
$this->active = false;
//required to list the wordpress roles avaialbes
if (!empty($this->config['phpbbwpunicorn_wp_path'])) {
$this->active = true;
$this->request->enable_super_globals();
define('SHORTINIT', TRUE);
require_once $this->config['phpbbwpunicorn_wp_path'] . '/wp-load.php';
require_once $this->config['phpbbwpunicorn_wp_path'] . '/wp-includes/plugin.' . $phpEx;
require_once $this->config['phpbbwpunicorn_wp_path'] . '/wp-admin/includes/user.' . $phpEx;
require_once $this->config['phpbbwpunicorn_wp_path'] . '/wp-includes/capabilities.' . $phpEx;
$this->request->disable_super_globals();
}
$this->user->add_lang('acp/groups');
$this->page_title = $this->user->lang['ACP_PWU_TITLE'];
$this->tpl_name = 'phpbbwpunicorn_body';
add_form_key('unicornfart');
// Get saved settings.
if ($this->request->is_set_post('submit')) {
$this->save();
}
$this->display();
}
示例5: main
function main($id, $mode)
{
global $auth, $db, $user, $template;
global $config, $phpbb_root_path, $phpEx;
$action = request_var('action', array('' => ''));
if (is_array($action)) {
list($action, ) = each($action);
}
$this->page_title = 'MCP_WARN';
add_form_key('mcp_warn');
switch ($mode) {
case 'front':
$this->mcp_warn_front_view();
$this->tpl_name = 'mcp_warn_front';
break;
case 'list':
$this->mcp_warn_list_view($action);
$this->tpl_name = 'mcp_warn_list';
break;
case 'warn_post':
$this->mcp_warn_post_view($action);
$this->tpl_name = 'mcp_warn_post';
break;
case 'warn_user':
$this->mcp_warn_user_view($action);
$this->tpl_name = 'mcp_warn_user';
break;
}
}
示例6: __construct
/**
* Constructor
* Load the list with available plugins and assign them in the correct category
*/
public function __construct(\phpbb\titania\controller\helper $controller_helper)
{
$this->controller_helper = $controller_helper;
$this->phpbb_root_path = \phpbb::$root_path;
$this->php_ext = \phpbb::$php_ext;
// Set the path
$this->tool_box_path = $this->phpbb_root_path . 'ext/phpbb/titania/includes/manage_tools/';
// Load functions_admin.php if required
if (!function_exists('filelist')) {
include $this->phpbb_root_path . 'includes/functions_admin.' . $this->php_ext;
}
// Create a list with tools
$filelist = filelist($this->tool_box_path, '', $this->php_ext);
// Need to do some sanitization on the result of filelist
foreach ($filelist as $tools) {
// Don't want the extension
foreach ($tools as $tool) {
if (in_array($tool, $this->ignore_tools)) {
continue;
}
$this->plugin_list[] = ($pos = strpos($tool, '.' . $this->php_ext)) !== false ? substr($tool, 0, $pos) : $tool;
}
}
// Get the requested cat and tool
$this->tool_id = phpbb::$request->variable('t', '');
// Check if they want to use a tool or not, make sure that the tool name is legal, and make sure the tool exists
if (!$this->tool_id || preg_match('#([^a-zA-Z0-9_])#', $this->tool_id) || !file_exists($this->tool_box_path . $this->tool_id . '.' . $this->php_ext)) {
$this->tool_id = '';
}
// Make sure the form_key is set
add_form_key($this->tool_id);
// Assign the two menus to the template
$this->gen_left_nav();
}
示例7: main
function main($id, $mode)
{
global $request;
$action = $request->variable('action', array('' => ''));
if (is_array($action)) {
list($action, ) = each($action);
}
$this->page_title = 'MCP_WARN';
add_form_key('mcp_warn');
switch ($mode) {
case 'front':
$this->mcp_warn_front_view();
$this->tpl_name = 'mcp_warn_front';
break;
case 'list':
$this->mcp_warn_list_view($action);
$this->tpl_name = 'mcp_warn_list';
break;
case 'warn_post':
$this->mcp_warn_post_view($action);
$this->tpl_name = 'mcp_warn_post';
break;
case 'warn_user':
$this->mcp_warn_user_view($action);
$this->tpl_name = 'mcp_warn_user';
break;
}
}
示例8: main
public function main($id, $mode)
{
global $phpbb_container;
// Initialization
$this->config = $phpbb_container->get('config');
$this->db = $phpbb_container->get('dbal.conn');
$this->user = $phpbb_container->get('user');
$this->template = $phpbb_container->get('template');
$this->request = $phpbb_container->get('request');
$action = $this->request->variable('action', '', true);
$submit = $this->request->is_set_post('submit') ? true : false;
$this->form_key = 'acp_advancedpolls';
add_form_key($this->form_key);
$display_vars = array('title' => 'AP_TITLE_ACP', 'vars' => array('legend1' => 'AP_GLOBAL_SETTINGS', 'wolfsblvt.advancedpolls.activate_incremental_votes' => array('lang' => 'AP_ACT_INCREMENTAL_VOTES', 'validate' => 'bool', 'type' => 'radio:enabled_disabled', 'explain' => true), 'wolfsblvt.advancedpolls.activate_closed_voting' => array('lang' => 'AP_ACT_CLOSED_VOTING', 'validate' => 'bool', 'type' => 'radio:enabled_disabled', 'explain' => true), 'wolfsblvt.advancedpolls.activate_no_vote' => array('lang' => 'AP_ACT_POLL_NO_VOTE', 'validate' => 'bool', 'type' => 'radio:enabled_disabled', 'explain' => true), 'wolfsblvt.advancedpolls.activate_poll_end' => array('lang' => 'AP_ACT_POLL_END', 'validate' => 'bool', 'type' => 'radio:enabled_disabled', 'explain' => true), 'wolfsblvt.advancedpolls.activate_notifications' => array('lang' => 'AP_ACT_POLL_NOTIFICATIONS', 'validate' => 'bool', 'type' => 'radio:enabled_disabled', 'explain' => true), 'legend2' => 'AP_PER_POLL_SETTINGS', 'wolfsblvt.advancedpolls.activate_poll_scoring' => array('lang' => 'AP_ACT_POLL_SCORING', 'validate' => 'bool', 'type' => 'radio:enabled_disabled', 'explain' => true), 'wolfsblvt.advancedpolls.default_poll_votes_change' => array('lang' => 'AP_DEFAULT_VOTES_CHANGE', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), 'wolfsblvt.advancedpolls.activate_poll_votes_hide' => array('lang' => 'AP_ACT_VOTES_HIDE', 'validate' => 'bool', 'type' => 'radio:enabled_disabled', 'explain' => true), 'wolfsblvt.advancedpolls.default_poll_votes_hide' => array('lang' => 'AP_DEFAULT_VOTES_HIDE', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), 'wolfsblvt.advancedpolls.activate_poll_voters_show' => array('lang' => 'AP_ACT_VOTERS_SHOW', 'validate' => 'bool', 'type' => 'radio:enabled_disabled', 'explain' => true), 'wolfsblvt.advancedpolls.default_poll_voters_show' => array('lang' => 'AP_DEFAULT_VOTERS_SHOW', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), 'wolfsblvt.advancedpolls.activate_poll_voters_limit' => array('lang' => 'AP_ACT_VOTERS_LIMIT', 'validate' => 'bool', 'type' => 'radio:enabled_disabled', 'explain' => true), 'wolfsblvt.advancedpolls.default_poll_voters_limit' => array('lang' => 'AP_DEFAULT_VOTERS_LIMIT', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), 'wolfsblvt.advancedpolls.activate_poll_show_ordered' => array('lang' => 'AP_ACT_SHOW_ORDERED', 'validate' => 'bool', 'type' => 'radio:enabled_disabled', 'explain' => true), 'wolfsblvt.advancedpolls.default_poll_show_ordered' => array('lang' => 'AP_DEFAULT_SHOW_ORDERED', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), 'legend3' => 'ACP_SUBMIT_CHANGES'));
#region Submit
if ($submit) {
$submit = $this->do_submit_stuff($display_vars);
// If the submit was valid, so still submitted
if ($submit) {
trigger_error($this->user->lang('CONFIG_UPDATED') . adm_back_link($this->u_action), E_USER_NOTICE);
}
}
#endregion
$this->generate_stuff_for_cfg_template($display_vars);
// Output page template file
$this->tpl_name = 'acp_advancedpolls';
$this->page_title = $this->user->lang($display_vars['title']);
}
示例9: main
public function main($id, $mode)
{
global $config, $user, $template, $request, $db, $table_prefix;
$user->add_lang_ext('tas2580/dejure', 'common');
$this->tpl_name = 'acp_dejure_body';
$this->page_title = $user->lang('ACP_DEJURE_TITLE');
add_form_key('acp_dejure');
// Form is submitted
if ($request->is_set_post('submit')) {
if (!check_form_key('acp_dejure')) {
trigger_error($user->lang('FORM_INVALID') . adm_back_link($this->u_action), E_USER_WARNING);
}
// Set the new settings to config
$config->set('tas2580_dejure_link_style', $request->variable('link_style', 'weit'));
$config->set('tas2580_dejure_class', $request->variable('class', ''));
$config->set('tas2580_dejure_buzer', $request->variable('buzer', 0));
$config->set('tas2580_dejure_cache_time', $request->variable('cache_time', 4));
$config->set('tas2580_dejure_target', $request->variable('target', ''));
$sql = 'DELETE FROM ' . $table_prefix . 'dejure';
$db->sql_query($sql);
trigger_error($user->lang('ACP_SAVED') . adm_back_link($this->u_action));
}
// Send the curent settings to template
$template->assign_vars(array('U_ACTION' => $this->u_action, 'LINK_STYLE_WEIT' => $config['tas2580_dejure_link_style'] === 'weit' ? ' selected="selected"' : '', 'LINK_STYLE_SCHMAL' => $config['tas2580_dejure_link_style'] === 'schmal' ? ' selected="selected"' : '', 'CLASS' => $config['tas2580_dejure_class'], 'TARGET' => $config['tas2580_dejure_target'], 'BUZER' => $config['tas2580_dejure_buzer'] == 1 ? ' checked="checked"' : '', 'CACHE_TIME' => $config['tas2580_dejure_cache_time']));
}
示例10: main
function main($id, $mode)
{
global $db, $template, $user;
phpbb_gallery::init();
$user->add_lang(array('mods/gallery_acp', 'mods/gallery'));
$this->tpl_name = 'gallery_main';
add_form_key('acp_gallery');
$submode = request_var('submode', '');
switch ($mode) {
case 'overview':
$title = 'ACP_GALLERY_OVERVIEW';
$this->page_title = $user->lang[$title];
$this->overview();
break;
case 'import_images':
$title = 'ACP_IMPORT_ALBUMS';
$this->page_title = $user->lang[$title];
$this->import();
break;
case 'cleanup':
$title = 'ACP_GALLERY_CLEANUP';
$this->page_title = $user->lang[$title];
$this->cleanup();
break;
default:
trigger_error('NO_MODE', E_USER_ERROR);
break;
}
}
示例11: main
function main($id, $mode)
{
global $db, $user, $auth, $template, $cache, $request;
global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx;
$this->config = $config;
$this->request = $request;
$user->add_lang('acp/common');
$user->add_lang_ext('vinny/shareon', 'acp/info_acp_shareon');
$this->tpl_name = 'acp_shareon';
$this->page_title = $user->lang['SHARE_ON_MOD'];
add_form_key('acp_shareon');
if ($request->is_set_post('submit')) {
if (!check_form_key('acp_shareon')) {
trigger_error('FORM_INVALID');
}
$config->set('so_status', $request->variable('so_status', true));
$config->set('so_type', $request->variable('so_type', true));
$config->set('so_facebook', $request->variable('so_facebook', true));
$config->set('so_twitter', $request->variable('so_twitter', true));
$config->set('so_tuenti', $request->variable('so_tuenti', true));
$config->set('so_sonico', $request->variable('so_sonico', true));
$config->set('so_friendfeed', $request->variable('so_friendfeed', true));
$config->set('so_digg', $request->variable('so_digg', true));
$config->set('so_reddit', $request->variable('so_reddit', true));
$config->set('so_delicious', $request->variable('so_delicious', true));
$config->set('so_vk', $request->variable('so_vk', true));
$config->set('so_tumblr', $request->variable('so_tumblr', true));
$config->set('so_google', $request->variable('so_google', true));
trigger_error($user->lang['SO_SAVED'] . adm_back_link($this->u_action));
}
$template->assign_vars(array('SO_STATUS' => !empty($this->config['so_status']) ? true : false, 'SO_TYPE' => !empty($this->config['so_type']) ? true : false, 'SO_FACEBOOK' => !empty($this->config['so_facebook']) ? true : false, 'SO_TWITTER' => !empty($this->config['so_twitter']) ? true : false, 'SO_TUENTI' => !empty($this->config['so_tuenti']) ? true : false, 'SO_SONICO' => !empty($this->config['so_sonico']) ? true : false, 'SO_FRIENDFEED' => !empty($this->config['so_friendfeed']) ? true : false, 'SO_DIGG' => !empty($this->config['so_digg']) ? true : false, 'SO_REDDIT' => !empty($this->config['so_reddit']) ? true : false, 'SO_DELICIOUS' => !empty($this->config['so_delicious']) ? true : false, 'SO_VK' => !empty($this->config['so_vk']) ? true : false, 'SO_TUMBLR' => !empty($this->config['so_tumblr']) ? true : false, 'SO_GOOGLE' => !empty($this->config['so_google']) ? true : false, 'U_ACTION' => $this->u_action));
}
示例12: main
function main($id, $mode)
{
global $config, $request, $template, $user, $phpbb_log;
$user->add_lang('acp/common');
$this->tpl_name = 'acp_postnumbers';
$this->page_title = $user->lang('POSTNUMBERS_TITLE');
add_form_key('acp_postnumbers');
if ($request->is_set_post('submit')) {
if (!check_form_key('acp_postnumbers')) {
trigger_error($user->lang('FORM_INVALID') . adm_back_link($this->u_action));
}
$config->set('kasimi.postnumbers.enabled.viewtopic', $request->variable('postnumbers_enabled_viewtopic', 0));
$config->set('kasimi.postnumbers.enabled.review_reply', $request->variable('postnumbers_enabled_review_reply', 0));
$config->set('kasimi.postnumbers.enabled.review_mcp', $request->variable('postnumbers_enabled_review_mcp', 0));
$config->set('kasimi.postnumbers.skip_nonapproved', $request->variable('postnumbers_skip_nonapproved', 0));
$config->set('kasimi.postnumbers.display_ids', $request->variable('postnumbers_display_ids', 0));
$config->set('kasimi.postnumbers.clipboard', $request->variable('postnumbers_clipboard', 0));
$config->set('kasimi.postnumbers.bold', $request->variable('postnumbers_bold', 0));
$user_id = empty($user->data) ? ANONYMOUS : $user->data['user_id'];
$user_ip = empty($user->ip) ? '' : $user->ip;
$phpbb_log->add('admin', $user_id, $user_ip, 'POSTNUMBERS_CONFIG_UPDATED');
trigger_error($user->lang('CONFIG_UPDATED') . adm_back_link($this->u_action));
}
$template->assign_vars(array('POSTNUMBERS_VERSION' => isset($config['kasimi.postnumbers.version']) ? $config['kasimi.postnumbers.version'] : 'X.Y.Z', 'POSTNUMBERS_ENABLED_VIEWTOPIC' => isset($config['kasimi.postnumbers.enabled.viewtopic']) ? $config['kasimi.postnumbers.enabled.viewtopic'] : 0, 'POSTNUMBERS_ENABLED_REVIEW_REPLY' => isset($config['kasimi.postnumbers.enabled.review_reply']) ? $config['kasimi.postnumbers.enabled.review_reply'] : 0, 'POSTNUMBERS_ENABLED_REVIEW_MCP' => isset($config['kasimi.postnumbers.enabled.review_mcp']) ? $config['kasimi.postnumbers.enabled.review_mcp'] : 0, 'POSTNUMBERS_SKIP_NONAPPROVED' => isset($config['kasimi.postnumbers.skip_nonapproved']) ? $config['kasimi.postnumbers.skip_nonapproved'] : 0, 'POSTNUMBERS_DISPLAY_IDS' => isset($config['kasimi.postnumbers.display_ids']) ? $config['kasimi.postnumbers.display_ids'] : 0, 'POSTNUMBERS_CLIPBOARD' => isset($config['kasimi.postnumbers.clipboard']) ? $config['kasimi.postnumbers.clipboard'] : 0, 'POSTNUMBERS_BOLD' => isset($config['kasimi.postnumbers.bold']) ? $config['kasimi.postnumbers.bold'] : 0, 'U_ACTION' => $this->u_action));
}
示例13: main
public function main($id, $mode)
{
global $config, $user, $template, $request;
$user->add_lang_ext('tas2580/usermap', 'acp');
$user->add_lang_ext('tas2580/usermap', 'country_codes');
$this->user = $user;
add_form_key('acp_usermap');
switch ($mode) {
case 'settings':
$this->tpl_name = 'acp_usermap_settings';
$this->page_title = $user->lang('ACP_USERMAP_TITLE');
// Form is submitted
if ($request->is_set_post('submit')) {
if (!check_form_key('acp_usermap')) {
trigger_error($user->lang('FORM_INVALID') . adm_back_link($this->u_action), E_USER_WARNING);
}
// Set the new settings to config
$config->set('tas2580_usermap_lon', substr($request->variable('usermap_lon', ''), 0, 10));
$config->set('tas2580_usermap_lat', substr($request->variable('usermap_lat', ''), 0, 10));
$config->set('tas2580_usermap_zoom', $request->variable('usermap_zoom', 0));
$config->set('tas2580_usermap_map_type', $request->variable('map_type', ''));
$config->set('tas2580_usermap_google_api_key', $request->variable('google_api_key', ''));
$config->set('tas2580_usermap_bing_api_key', $request->variable('bing_api_key', ''));
$config->set('tas2580_usermap_search_distance', $request->variable('search_distance', 0));
$config->set('tas2580_usermap_map_in_viewprofile', $request->variable('map_in_viewprofile', 0));
$config->set('tas2580_usermap_distance_in_viewtopic', $request->variable('distance_in_viewtopic', 0));
$config->set('tas2580_usermap_distance_format', $request->variable('distance_format', 0));
$config->set('tas2580_usermap_max_marker', $request->variable('max_marker', 100));
$config->set('tas2580_usermap_input_method', $request->variable('input_method', 'zip'));
$config->set('tas2580_usermap_force_on_register', $request->variable('force_on_register', 0));
$config->set('tas2580_usermap_show_on_register', $request->variable('show_on_register', 0));
$config->set('tas2580_usermap_display_coordinates', $request->variable('display_coordinates', 0));
$config->set('tas2580_usermap_default_country', $request->variable('default_country', ''));
trigger_error($user->lang('ACP_SAVED') . adm_back_link($this->u_action));
}
// Send the curent settings to template
$template->assign_vars(array('U_ACTION' => $this->u_action, 'USERMAP_LON' => $config['tas2580_usermap_lon'], 'USERMAP_LAT' => $config['tas2580_usermap_lat'], 'USERMAP_ZOOM' => $config['tas2580_usermap_zoom'], 'MAP_TYPE_SELECT' => $this->map_select($config['tas2580_usermap_map_type']), 'GOOGLE_API_KEY' => $config['tas2580_usermap_google_api_key'], 'BING_API_KEY' => $config['tas2580_usermap_bing_api_key'], 'SEARCH_DISTANCE' => $config['tas2580_usermap_search_distance'], 'MAP_IN_VIEWPROFILE' => $config['tas2580_usermap_map_in_viewprofile'], 'DISTANCE_IN_VIEWTOPIC' => $config['tas2580_usermap_distance_in_viewtopic'], 'DISTANCE_FORMAT' => $config['tas2580_usermap_distance_format'], 'MAX_MARKER' => $config['tas2580_usermap_max_marker'], 'INPUT_METHOD' => $config['tas2580_usermap_input_method'], 'SHOW_ON_REGISTER' => $config['tas2580_usermap_show_on_register'], 'FORCE_ON_REGISTER' => $config['tas2580_usermap_force_on_register'], 'DISPLAY_COORDINATES' => $config['tas2580_usermap_display_coordinates'], 'COUNTRY_SELECT' => $this->country_code_select($config['tas2580_usermap_default_country'])));
break;
case 'things':
$this->tpl_name = 'acp_usermap_things';
$this->page_title = $user->lang('ACP_USERMAP_TITLE');
// Form is submitted
if ($request->is_set_post('submit')) {
if (!check_form_key('acp_usermap')) {
trigger_error($user->lang('FORM_INVALID') . adm_back_link($this->u_action), E_USER_WARNING);
}
// Set the new settings to config
$config->set('tas2580_usermap_thing_name', $request->variable('thing_name', '', true));
$config->set('tas2580_usermap_allow_bbcode', $request->variable('allow_bbcode', '', true));
$config->set('tas2580_usermap_allow_smilies', $request->variable('allow_smilies', '', true));
$config->set('tas2580_usermap_allow_urls', $request->variable('allow_urls', '', true));
$config->set('tas2580_usermap_allow_img', $request->variable('allow_img', '', true));
$config->set('tas2580_usermap_allow_flash', $request->variable('allow_flash', '', true));
trigger_error($user->lang('ACP_SAVED') . adm_back_link($this->u_action));
}
// Send the curent settings to template
$template->assign_vars(array('U_ACTION' => $this->u_action, 'THING_NAME' => $config['tas2580_usermap_thing_name'], 'ALLOW_BBCODE' => $config['tas2580_usermap_allow_bbcode'], 'ALLOW_SMILIES' => $config['tas2580_usermap_allow_smilies'], 'ALLOW_URL' => $config['tas2580_usermap_allow_urls'], 'ALLOW_IMG' => $config['tas2580_usermap_allow_img'], 'ALLOW_FLASH' => $config['tas2580_usermap_allow_flash']));
break;
}
}
示例14: main
function main($id, $mode)
{
global $db, $user, $auth, $template, $cache;
global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx;
$user->add_lang('acp/common');
$this->tpl_name = 'acp_shareon';
$this->page_title = $user->lang['SHARE_ON_MOD'];
add_form_key('acp_shareon');
// Version Check
$config['SHAREON_VERSION'] = isset($config['SHAREON_VERSION']) ? $config['SHAREON_VERSION'] : '2.2.0';
$submit = isset($_POST['submit']) ? true : false;
if ($submit) {
if (!check_form_key('acp_shareon')) {
trigger_error('FORM_INVALID');
}
set_config('so_status', request_var('so_status', true));
set_config('so_position', request_var('so_position', true));
set_config('so_type', request_var('so_type', true));
set_config('so_facebook', request_var('so_facebook', true));
set_config('so_twitter', request_var('so_twitter', true));
set_config('so_tuenti', request_var('so_tuenti', true));
set_config('so_sonico', request_var('so_sonico', true));
set_config('so_friendfeed', request_var('so_friendfeed', true));
set_config('so_orkut', request_var('so_orkut', true));
set_config('so_digg', request_var('so_digg', true));
set_config('so_reddit', request_var('so_reddit', true));
set_config('so_delicious', request_var('so_delicious', true));
set_config('so_vk', request_var('so_vk', true));
set_config('so_tumblr', request_var('so_tumblr', true));
set_config('so_google', request_var('so_google', true));
set_config('so_myspace', request_var('so_myspace', true));
trigger_error($user->lang['SO_SAVED'] . adm_back_link($this->u_action));
}
$template->assign_vars(array('SO_STATUS' => !empty($config['so_status']) ? true : false, 'SO_POSITION' => !empty($config['so_position']) ? true : false, 'SO_TYPE' => !empty($config['so_type']) ? true : false, 'SO_FACEBOOK' => !empty($config['so_facebook']) ? true : false, 'SO_TWITTER' => !empty($config['so_twitter']) ? true : false, 'SO_TUENTI' => !empty($config['so_tuenti']) ? true : false, 'SO_SONICO' => !empty($config['so_sonico']) ? true : false, 'SO_FRIENDFEED' => !empty($config['so_friendfeed']) ? true : false, 'SO_ORKUT' => !empty($config['so_orkut']) ? true : false, 'SO_DIGG' => !empty($config['so_digg']) ? true : false, 'SO_REDDIT' => !empty($config['so_reddit']) ? true : false, 'SO_DELICIOUS' => !empty($config['so_delicious']) ? true : false, 'SO_VK' => !empty($config['so_vk']) ? true : false, 'SO_TUMBLR' => !empty($config['so_tumblr']) ? true : false, 'SO_GOOGLE' => !empty($config['so_google']) ? true : false, 'SO_MYSPACE' => !empty($config['so_myspace']) ? true : false, 'U_ACTION' => $this->u_action, 'SHAREON_VERSION' => $config['SHAREON_VERSION'], 'S_VERSION_UP_TO_DATE' => $this->shareon_version_compare($config['SHAREON_VERSION'])));
}
示例15: main
function main($id, $mode)
{
global $auth, $db, $user, $template, $request;
global $config, $phpbb_root_path, $phpEx;
$action = $request->variable('action', array('' => ''));
if (is_array($action)) {
list($action, ) = each($action);
}
$this->page_title = 'MCP_WARN';
add_form_key('mcp_warn');
$user->add_lang_ext('rxu/AdvancedWarnings', 'warnings');
switch ($mode) {
case 'front':
$this->mcp_warn_front_view();
$this->tpl_name = 'mcp_warn_front';
break;
case 'list':
$this->mcp_warn_list_view($action);
$this->tpl_name = 'mcp_rxu_warnings_warn_list';
break;
case 'warn_post':
$this->mcp_warn_post_view($action);
$this->tpl_name = 'mcp_rxu_warnings_warn_post';
break;
case 'warn_user':
$this->mcp_warn_user_view($action);
$this->tpl_name = 'mcp_rxu_warnings_warn_user';
break;
}
}