本文整理汇总了PHP中tz_select函数的典型用法代码示例。如果您正苦于以下问题:PHP tz_select函数的具体用法?PHP tz_select怎么用?PHP tz_select使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了tz_select函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: main
function main($id, $mode)
{
global $config, $db, $user, $auth, $template, $phpbb_root_path, $phpEx;
$submit = isset($_POST['submit']) ? true : false;
$error = $data = array();
$s_hidden_fields = '';
switch ($mode) {
case 'personal':
add_form_key('ucp_prefs_personal');
$data = array('notifymethod' => request_var('notifymethod', $user->data['user_notify_type']), 'dateformat' => request_var('dateformat', $user->data['user_dateformat'], true), 'lang' => basename(request_var('lang', $user->data['user_lang'])), 'style' => request_var('style', (int) $user->data['user_style']), 'tz' => request_var('tz', (double) $user->data['user_timezone']), 'dst' => request_var('dst', (bool) $user->data['user_dst']), 'viewemail' => request_var('viewemail', (bool) $user->data['user_allow_viewemail']), 'massemail' => request_var('massemail', (bool) $user->data['user_allow_massemail']), 'hideonline' => request_var('hideonline', (bool) (!$user->data['user_allow_viewonline'])), 'notifypm' => request_var('notifypm', (bool) $user->data['user_notify_pm']), 'popuppm' => request_var('popuppm', (bool) $user->optionget('popuppm')), 'allowpm' => request_var('allowpm', (bool) $user->data['user_allow_pm']));
if ($data['notifymethod'] == NOTIFY_IM && (!$config['jab_enable'] || !$user->data['user_jabber'] || !@extension_loaded('xml'))) {
// Jabber isnt enabled, or no jabber field filled in. Update the users table to be sure its correct.
$data['notifymethod'] = NOTIFY_BOTH;
}
if ($submit) {
$data['style'] = $config['override_user_style'] ? $config['default_style'] : $data['style'];
$error = validate_data($data, array('dateformat' => array('string', false, 1, 30), 'lang' => array('match', false, '#^[a-z0-9_\\-]{2,}$#i'), 'tz' => array('num', false, -14, 14)));
if (!check_form_key('ucp_prefs_personal')) {
$error[] = 'FORM_INVALID';
}
if (!sizeof($error)) {
$user->optionset('popuppm', $data['popuppm']);
$sql_ary = array('user_allow_pm' => $data['allowpm'], 'user_allow_viewemail' => $data['viewemail'], 'user_allow_massemail' => $data['massemail'], 'user_allow_viewonline' => $auth->acl_get('u_hideonline') ? !$data['hideonline'] : $user->data['user_allow_viewonline'], 'user_notify_type' => $data['notifymethod'], 'user_notify_pm' => $data['notifypm'], 'user_options' => $user->data['user_options'], 'user_dst' => $data['dst'], 'user_dateformat' => $data['dateformat'], 'user_lang' => $data['lang'], 'user_timezone' => $data['tz'], 'user_style' => $data['style']);
$sql = 'UPDATE ' . USERS_TABLE . '
SET ' . $db->sql_build_array('UPDATE', $sql_ary) . '
WHERE user_id = ' . $user->data['user_id'];
$db->sql_query($sql);
meta_refresh(3, $this->u_action);
$message = $user->lang['PREFERENCES_UPDATED'] . '<br /><br />' . sprintf($user->lang['RETURN_UCP'], '<a href="' . $this->u_action . '">', '</a>');
trigger_error($message);
}
// Replace "error" strings with their real, localised form
$error = preg_replace('#^([A-Z_]+)$#e', "(!empty(\$user->lang['\\1'])) ? \$user->lang['\\1'] : '\\1'", $error);
}
$dateformat_options = '';
foreach ($user->lang['dateformats'] as $format => $null) {
$dateformat_options .= '<option value="' . $format . '"' . ($format == $data['dateformat'] ? ' selected="selected"' : '') . '>';
$dateformat_options .= $user->format_date(time(), $format, false) . (strpos($format, '|') !== false ? $user->lang['VARIANT_DATE_SEPARATOR'] . $user->format_date(time(), $format, true) : '');
$dateformat_options .= '</option>';
}
$s_custom = false;
$dateformat_options .= '<option value="custom"';
if (!isset($user->lang['dateformats'][$data['dateformat']])) {
$dateformat_options .= ' selected="selected"';
$s_custom = true;
}
$dateformat_options .= '>' . $user->lang['CUSTOM_DATEFORMAT'] . '</option>';
$template->assign_vars(array('ERROR' => sizeof($error) ? implode('<br />', $error) : '', 'S_NOTIFY_EMAIL' => $data['notifymethod'] == NOTIFY_EMAIL ? true : false, 'S_NOTIFY_IM' => $data['notifymethod'] == NOTIFY_IM ? true : false, 'S_NOTIFY_BOTH' => $data['notifymethod'] == NOTIFY_BOTH ? true : false, 'S_VIEW_EMAIL' => $data['viewemail'], 'S_MASS_EMAIL' => $data['massemail'], 'S_ALLOW_PM' => $data['allowpm'], 'S_HIDE_ONLINE' => $data['hideonline'], 'S_NOTIFY_PM' => $data['notifypm'], 'S_POPUP_PM' => $data['popuppm'], 'S_DST' => $data['dst'], 'DATE_FORMAT' => $data['dateformat'], 'A_DATE_FORMAT' => addslashes($data['dateformat']), 'S_DATEFORMAT_OPTIONS' => $dateformat_options, 'S_CUSTOM_DATEFORMAT' => $s_custom, 'DEFAULT_DATEFORMAT' => $config['default_dateformat'], 'A_DEFAULT_DATEFORMAT' => addslashes($config['default_dateformat']), 'S_LANG_OPTIONS' => language_select($data['lang']), 'S_STYLE_OPTIONS' => $config['override_user_style'] ? '' : style_select($data['style']), 'S_TZ_OPTIONS' => tz_select($data['tz'], true), 'S_CAN_HIDE_ONLINE' => $auth->acl_get('u_hideonline') ? true : false, 'S_SELECT_NOTIFY' => $config['jab_enable'] && $user->data['user_jabber'] && @extension_loaded('xml') ? true : false));
break;
case 'view':
add_form_key('ucp_prefs_view');
$data = array('topic_sk' => request_var('topic_sk', !empty($user->data['user_topic_sortby_type']) ? $user->data['user_topic_sortby_type'] : 't'), 'topic_sd' => request_var('topic_sd', !empty($user->data['user_topic_sortby_dir']) ? $user->data['user_topic_sortby_dir'] : 'd'), 'topic_st' => request_var('topic_st', !empty($user->data['user_topic_show_days']) ? $user->data['user_topic_show_days'] : 0), 'post_sk' => request_var('post_sk', !empty($user->data['user_post_sortby_type']) ? $user->data['user_post_sortby_type'] : 't'), 'post_sd' => request_var('post_sd', !empty($user->data['user_post_sortby_dir']) ? $user->data['user_post_sortby_dir'] : 'a'), 'post_st' => request_var('post_st', !empty($user->data['user_post_show_days']) ? $user->data['user_post_show_days'] : 0), 'images' => request_var('images', (bool) $user->optionget('viewimg')), 'flash' => request_var('flash', (bool) $user->optionget('viewflash')), 'smilies' => request_var('smilies', (bool) $user->optionget('viewsmilies')), 'sigs' => request_var('sigs', (bool) $user->optionget('viewsigs')), 'avatars' => request_var('avatars', (bool) $user->optionget('viewavatars')), 'wordcensor' => request_var('wordcensor', (bool) $user->optionget('viewcensors')));
if ($submit) {
$error = validate_data($data, array('topic_sk' => array('string', false, 1, 1), 'topic_sd' => array('string', false, 1, 1), 'post_sk' => array('string', false, 1, 1), 'post_sd' => array('string', false, 1, 1)));
if (!check_form_key('ucp_prefs_view')) {
$error[] = 'FORM_INVALID';
}
if (!sizeof($error)) {
$user->optionset('viewimg', $data['images']);
$user->optionset('viewflash', $data['flash']);
$user->optionset('viewsmilies', $data['smilies']);
$user->optionset('viewsigs', $data['sigs']);
$user->optionset('viewavatars', $data['avatars']);
if ($auth->acl_get('u_chgcensors')) {
$user->optionset('viewcensors', $data['wordcensor']);
}
$sql_ary = array('user_options' => $user->data['user_options'], 'user_topic_sortby_type' => $data['topic_sk'], 'user_post_sortby_type' => $data['post_sk'], 'user_topic_sortby_dir' => $data['topic_sd'], 'user_post_sortby_dir' => $data['post_sd'], 'user_topic_show_days' => $data['topic_st'], 'user_post_show_days' => $data['post_st']);
$sql = 'UPDATE ' . USERS_TABLE . '
SET ' . $db->sql_build_array('UPDATE', $sql_ary) . '
WHERE user_id = ' . $user->data['user_id'];
$db->sql_query($sql);
meta_refresh(3, $this->u_action);
$message = $user->lang['PREFERENCES_UPDATED'] . '<br /><br />' . sprintf($user->lang['RETURN_UCP'], '<a href="' . $this->u_action . '">', '</a>');
trigger_error($message);
}
// Replace "error" strings with their real, localised form
$error = preg_replace('#^([A-Z_]+)$#e', "(!empty(\$user->lang['\\1'])) ? \$user->lang['\\1'] : '\\1'", $error);
}
$sort_dir_text = array('a' => $user->lang['ASCENDING'], 'd' => $user->lang['DESCENDING']);
// Topic ordering options
$limit_topic_days = array(0 => $user->lang['ALL_TOPICS'], 1 => $user->lang['1_DAY'], 7 => $user->lang['7_DAYS'], 14 => $user->lang['2_WEEKS'], 30 => $user->lang['1_MONTH'], 90 => $user->lang['3_MONTHS'], 180 => $user->lang['6_MONTHS'], 365 => $user->lang['1_YEAR']);
$sort_by_topic_text = array('a' => $user->lang['AUTHOR'], 't' => $user->lang['POST_TIME'], 'r' => $user->lang['REPLIES'], 's' => $user->lang['SUBJECT'], 'v' => $user->lang['VIEWS']);
$sort_by_topic_sql = array('a' => 't.topic_first_poster_name', 't' => 't.topic_last_post_time', 'r' => 't.topic_replies', 's' => 't.topic_title', 'v' => 't.topic_views');
// Post ordering options
$limit_post_days = array(0 => $user->lang['ALL_POSTS'], 1 => $user->lang['1_DAY'], 7 => $user->lang['7_DAYS'], 14 => $user->lang['2_WEEKS'], 30 => $user->lang['1_MONTH'], 90 => $user->lang['3_MONTHS'], 180 => $user->lang['6_MONTHS'], 365 => $user->lang['1_YEAR']);
$sort_by_post_text = array('a' => $user->lang['AUTHOR'], 't' => $user->lang['POST_TIME'], 's' => $user->lang['SUBJECT']);
$sort_by_post_sql = array('a' => 'u.username_clean', 't' => 'p.post_id', 's' => 'p.post_subject');
$_options = array('topic', 'post');
foreach ($_options as $sort_option) {
${'s_limit_' . $sort_option . '_days'} = '<select name="' . $sort_option . '_st">';
foreach (${'limit_' . $sort_option . '_days'} as $day => $text) {
$selected = $data[$sort_option . '_st'] == $day ? ' selected="selected"' : '';
${'s_limit_' . $sort_option . '_days'} .= '<option value="' . $day . '"' . $selected . '>' . $text . '</option>';
}
${'s_limit_' . $sort_option . '_days'} .= '</select>';
${'s_sort_' . $sort_option . '_key'} = '<select name="' . $sort_option . '_sk">';
foreach (${'sort_by_' . $sort_option . '_text'} as $key => $text) {
$selected = $data[$sort_option . '_sk'] == $key ? ' selected="selected"' : '';
${'s_sort_' . $sort_option . '_key'} .= '<option value="' . $key . '"' . $selected . '>' . $text . '</option>';
}
//.........这里部分代码省略.........
示例2: main
//.........这里部分代码省略.........
$post_sk = isset($data['post_sk']) ? $data['post_sk'] : ($user_row['user_post_sortby_type'] ? $user_row['user_post_sortby_type'] : 't');
$topic_sd = isset($data['topic_sd']) ? $data['topic_sd'] : ($user_row['user_topic_sortby_dir'] ? $user_row['user_topic_sortby_dir'] : 'd');
$post_sd = isset($data['post_sd']) ? $data['post_sd'] : ($user_row['user_post_sortby_dir'] ? $user_row['user_post_sortby_dir'] : 'd');
$topic_st = isset($data['topic_st']) ? $data['topic_st'] : ($user_row['user_topic_show_days'] ? $user_row['user_topic_show_days'] : 0);
$post_st = isset($data['post_st']) ? $data['post_st'] : ($user_row['user_post_show_days'] ? $user_row['user_post_show_days'] : 0);
$sort_dir_text = array('a' => $user->lang['ASCENDING'], 'd' => $user->lang['DESCENDING']);
// Topic ordering options
$limit_topic_days = array(0 => $user->lang['ALL_TOPICS'], 1 => $user->lang['1_DAY'], 7 => $user->lang['7_DAYS'], 14 => $user->lang['2_WEEKS'], 30 => $user->lang['1_MONTH'], 90 => $user->lang['3_MONTHS'], 180 => $user->lang['6_MONTHS'], 365 => $user->lang['1_YEAR']);
$sort_by_topic_text = array('a' => $user->lang['AUTHOR'], 't' => $user->lang['POST_TIME'], 'r' => $user->lang['REPLIES'], 's' => $user->lang['SUBJECT'], 'v' => $user->lang['VIEWS']);
// Post ordering options
$limit_post_days = array(0 => $user->lang['ALL_POSTS'], 1 => $user->lang['1_DAY'], 7 => $user->lang['7_DAYS'], 14 => $user->lang['2_WEEKS'], 30 => $user->lang['1_MONTH'], 90 => $user->lang['3_MONTHS'], 180 => $user->lang['6_MONTHS'], 365 => $user->lang['1_YEAR']);
$sort_by_post_text = array('a' => $user->lang['AUTHOR'], 't' => $user->lang['POST_TIME'], 's' => $user->lang['SUBJECT']);
$_options = array('topic', 'post');
foreach ($_options as $sort_option) {
${'s_limit_' . $sort_option . '_days'} = '<select name="' . $sort_option . '_st">';
foreach (${'limit_' . $sort_option . '_days'} as $day => $text) {
$selected = ${$sort_option . '_st'} == $day ? ' selected="selected"' : '';
${'s_limit_' . $sort_option . '_days'} .= '<option value="' . $day . '"' . $selected . '>' . $text . '</option>';
}
${'s_limit_' . $sort_option . '_days'} .= '</select>';
${'s_sort_' . $sort_option . '_key'} = '<select name="' . $sort_option . '_sk">';
foreach (${'sort_by_' . $sort_option . '_text'} as $key => $text) {
$selected = ${$sort_option . '_sk'} == $key ? ' selected="selected"' : '';
${'s_sort_' . $sort_option . '_key'} .= '<option value="' . $key . '"' . $selected . '>' . $text . '</option>';
}
${'s_sort_' . $sort_option . '_key'} .= '</select>';
${'s_sort_' . $sort_option . '_dir'} = '<select name="' . $sort_option . '_sd">';
foreach ($sort_dir_text as $key => $value) {
$selected = ${$sort_option . '_sd'} == $key ? ' selected="selected"' : '';
${'s_sort_' . $sort_option . '_dir'} .= '<option value="' . $key . '"' . $selected . '>' . $value . '</option>';
}
${'s_sort_' . $sort_option . '_dir'} .= '</select>';
}
$template->assign_vars(array('S_PREFS' => true, 'S_JABBER_DISABLED' => $config['jab_enable'] && $user->data['user_jabber'] && @extension_loaded('xml') ? false : true, 'VIEW_EMAIL' => isset($data['viewemail']) ? $data['viewemail'] : $user_row['user_allow_viewemail'], 'MASS_EMAIL' => isset($data['massemail']) ? $data['massemail'] : $user_row['user_allow_massemail'], 'ALLOW_PM' => isset($data['allowpm']) ? $data['allowpm'] : $user_row['user_allow_pm'], 'HIDE_ONLINE' => isset($data['hideonline']) ? $data['hideonline'] : !$user_row['user_allow_viewonline'], 'NOTIFY_EMAIL' => $notify_method == NOTIFY_EMAIL ? true : false, 'NOTIFY_IM' => $notify_method == NOTIFY_IM ? true : false, 'NOTIFY_BOTH' => $notify_method == NOTIFY_BOTH ? true : false, 'NOTIFY_PM' => isset($data['notifypm']) ? $data['notifypm'] : $user_row['user_notify_pm'], 'POPUP_PM' => isset($data['popuppm']) ? $data['popuppm'] : $this->optionget($user_row, 'popuppm'), 'DST' => isset($data['dst']) ? $data['dst'] : $user_row['user_dst'], 'BBCODE' => isset($data['bbcode']) ? $data['bbcode'] : $this->optionget($user_row, 'bbcode'), 'SMILIES' => isset($data['smilies']) ? $data['smilies'] : $this->optionget($user_row, 'smilies'), 'ATTACH_SIG' => isset($data['sig']) ? $data['sig'] : $this->optionget($user_row, 'attachsig'), 'NOTIFY' => isset($data['notify']) ? $data['notify'] : $user_row['user_notify'], 'VIEW_IMAGES' => isset($data['view_images']) ? $data['view_images'] : $this->optionget($user_row, 'viewimg'), 'VIEW_FLASH' => isset($data['view_flash']) ? $data['view_flash'] : $this->optionget($user_row, 'viewflash'), 'VIEW_SMILIES' => isset($data['view_smilies']) ? $data['view_smilies'] : $this->optionget($user_row, 'viewsmilies'), 'VIEW_SIGS' => isset($data['view_sigs']) ? $data['view_sigs'] : $this->optionget($user_row, 'viewsigs'), 'VIEW_AVATARS' => isset($data['view_avatars']) ? $data['view_avatars'] : $this->optionget($user_row, 'viewavatars'), 'VIEW_WORDCENSOR' => isset($data['view_wordcensor']) ? $data['view_wordcensor'] : $this->optionget($user_row, 'viewcensors'), 'S_TOPIC_SORT_DAYS' => $s_limit_topic_days, 'S_TOPIC_SORT_KEY' => $s_sort_topic_key, 'S_TOPIC_SORT_DIR' => $s_sort_topic_dir, 'S_POST_SORT_DAYS' => $s_limit_post_days, 'S_POST_SORT_KEY' => $s_sort_post_key, 'S_POST_SORT_DIR' => $s_sort_post_dir, 'DATE_FORMAT' => $dateformat, 'S_DATEFORMAT_OPTIONS' => $dateformat_options, 'S_CUSTOM_DATEFORMAT' => $s_custom, 'DEFAULT_DATEFORMAT' => $config['default_dateformat'], 'A_DEFAULT_DATEFORMAT' => addslashes($config['default_dateformat']), 'S_LANG_OPTIONS' => language_select($lang), 'S_STYLE_OPTIONS' => style_select($style), 'S_TZ_OPTIONS' => tz_select($tz)));
break;
case 'avatar':
$avatar_select = basename(request_var('avatar_select', ''));
$category = basename(request_var('category', ''));
$can_upload = file_exists($phpbb_root_path . $config['avatar_path']) && is_writeable($phpbb_root_path . $config['avatar_path']) && $file_uploads ? true : false;
$data = array();
if ($submit) {
$delete = request_var('delete', '');
$var_ary = array('uploadurl' => (string) '', 'remotelink' => (string) '', 'width' => (string) '', 'height' => (string) '');
foreach ($var_ary as $var => $default) {
$data[$var] = request_var($var, $default);
}
$var_ary = array('uploadurl' => array('string', true, 5, 255), 'remotelink' => array('string', true, 5, 255), 'width' => array('string', true, 1, 3), 'height' => array('string', true, 1, 3));
$error = validate_data($data, $var_ary);
if (!sizeof($error)) {
$data['user_id'] = $user_id;
if ((!empty($_FILES['uploadfile']['name']) || $data['uploadurl']) && $can_upload && $config['allow_avatar_upload']) {
list($type, $filename, $width, $height) = avatar_upload($data, $error);
} else {
if ($data['remotelink'] && $config['allow_avatar_remote']) {
list($type, $filename, $width, $height) = avatar_remote($data, $error);
} else {
if ($avatar_select && $config['allow_avatar_local']) {
$type = AVATAR_GALLERY;
$filename = $avatar_select;
// check avatar gallery
if (!is_dir($phpbb_root_path . $config['avatar_gallery_path'] . '/' . $category)) {
$type = $width = $height = 0;
$filename = '';
} else {
list($width, $height) = getimagesize($phpbb_root_path . $config['avatar_gallery_path'] . '/' . $category . '/' . $filename);
$filename = $category . '/' . $filename;
示例3: main
//.........这里部分代码省略.........
$user_row = array('username' => $data['username'], 'user_password' => phpbb_hash($data['new_password']), 'user_email' => $data['email'], 'group_id' => (int) $group_id, 'user_timezone' => (double) $data['tz'], 'user_dst' => $is_dst, 'user_lang' => $data['lang'], 'user_type' => $user_type, 'user_actkey' => $user_actkey, 'user_ip' => $user->ip, 'user_regdate' => time(), 'user_inactive_reason' => $user_inactive_reason, 'user_inactive_time' => $user_inactive_time);
if ($config['new_member_post_limit']) {
$user_row['user_new'] = 1;
}
// Register user...
$user_id = user_add($user_row, $cp_data);
// This should not happen, because the required variables are listed above...
if ($user_id === false) {
trigger_error('NO_USER', E_USER_ERROR);
}
// Okay, captcha, your job is done.
if ($config['enable_confirm'] && isset($captcha)) {
$captcha->reset();
}
if ($coppa && $config['email_enable']) {
$message = $user->lang['ACCOUNT_COPPA'];
$email_template = 'coppa_welcome_inactive';
} else {
if ($config['require_activation'] == USER_ACTIVATION_SELF && $config['email_enable']) {
$message = $user->lang['ACCOUNT_INACTIVE'];
$email_template = 'user_welcome_inactive';
} else {
if ($config['require_activation'] == USER_ACTIVATION_ADMIN && $config['email_enable']) {
$message = $user->lang['ACCOUNT_INACTIVE_ADMIN'];
$email_template = 'admin_welcome_inactive';
} else {
$message = $user->lang['ACCOUNT_ADDED'];
$email_template = 'user_welcome';
}
}
}
if ($config['email_enable']) {
include_once $phpbb_root_path . 'includes/functions_messenger.' . $phpEx;
$messenger = new messenger(false);
$messenger->template($email_template, $data['lang']);
$messenger->to($data['email'], $data['username']);
$messenger->anti_abuse_headers($config, $user);
$messenger->assign_vars(array('WELCOME_MSG' => htmlspecialchars_decode(sprintf($user->lang['WELCOME_SUBJECT'], $config['sitename'])), 'USERNAME' => htmlspecialchars_decode($data['username']), 'PASSWORD' => htmlspecialchars_decode($data['new_password']), 'U_ACTIVATE' => "{$server_url}/ucp.{$phpEx}?mode=activate&u={$user_id}&k={$user_actkey}"));
if ($coppa) {
$messenger->assign_vars(array('FAX_INFO' => $config['coppa_fax'], 'MAIL_INFO' => $config['coppa_mail'], 'EMAIL_ADDRESS' => $data['email']));
}
$messenger->send(NOTIFY_EMAIL);
if ($config['require_activation'] == USER_ACTIVATION_ADMIN) {
// Grab an array of user_id's with a_user permissions ... these users can activate a user
$admin_ary = $auth->acl_get_list(false, 'a_user', false);
$admin_ary = !empty($admin_ary[0]['a_user']) ? $admin_ary[0]['a_user'] : array();
// Also include founders
$where_sql = ' WHERE user_type = ' . USER_FOUNDER;
if (sizeof($admin_ary)) {
$where_sql .= ' OR ' . $db->sql_in_set('user_id', $admin_ary);
}
$sql = 'SELECT user_id, username, user_email, user_lang, user_jabber, user_notify_type
FROM ' . USERS_TABLE . ' ' . $where_sql;
$result = $db->sql_query($sql);
while ($row = $db->sql_fetchrow($result)) {
$messenger->template('admin_activate', $row['user_lang']);
$messenger->to($row['user_email'], $row['username']);
$messenger->im($row['user_jabber'], $row['username']);
$messenger->assign_vars(array('USERNAME' => htmlspecialchars_decode($data['username']), 'U_USER_DETAILS' => "{$server_url}/memberlist.{$phpEx}?mode=viewprofile&u={$user_id}", 'U_ACTIVATE' => "{$server_url}/ucp.{$phpEx}?mode=activate&u={$user_id}&k={$user_actkey}"));
$messenger->send($row['user_notify_type']);
}
$db->sql_freeresult($result);
}
}
$message = $message . '<br /><br />' . sprintf($user->lang['RETURN_INDEX'], '<a href="' . append_sid("{$phpbb_root_path}index.{$phpEx}") . '">', '</a>');
trigger_error($message);
}
}
$s_hidden_fields = array('agreed' => 'true', 'change_lang' => 0);
if ($config['coppa_enable']) {
$s_hidden_fields['coppa'] = $coppa;
}
if ($config['enable_confirm']) {
$s_hidden_fields = array_merge($s_hidden_fields, $captcha->get_hidden_fields());
}
$s_hidden_fields = build_hidden_fields($s_hidden_fields);
$confirm_image = '';
// Visual Confirmation - Show images
if ($config['enable_confirm']) {
$template->assign_vars(array('CAPTCHA_TEMPLATE' => $captcha->get_template()));
}
//
$l_reg_cond = '';
switch ($config['require_activation']) {
case USER_ACTIVATION_SELF:
$l_reg_cond = $user->lang['UCP_EMAIL_ACTIVATE'];
break;
case USER_ACTIVATION_ADMIN:
$l_reg_cond = $user->lang['UCP_ADMIN_ACTIVATE'];
break;
}
$template->assign_vars(array('ERROR' => sizeof($error) ? implode('<br />', $error) : '', 'USERNAME' => $data['username'], 'PASSWORD' => $data['new_password'], 'PASSWORD_CONFIRM' => $data['password_confirm'], 'EMAIL' => $data['email'], 'EMAIL_CONFIRM' => $data['email_confirm'], 'L_REG_COND' => $l_reg_cond, 'L_USERNAME_EXPLAIN' => sprintf($user->lang[$config['allow_name_chars'] . '_EXPLAIN'], $config['min_name_chars'], $config['max_name_chars']), 'L_PASSWORD_EXPLAIN' => sprintf($user->lang[$config['pass_complex'] . '_EXPLAIN'], $config['min_pass_chars'], $config['max_pass_chars']), 'S_LANG_OPTIONS' => language_select($data['lang']), 'S_TZ_OPTIONS' => tz_select($data['tz']), 'S_CONFIRM_REFRESH' => $config['enable_confirm'] && $config['confirm_refresh'] ? true : false, 'S_REGISTRATION' => true, 'S_COPPA' => $coppa, 'S_HIDDEN_FIELDS' => $s_hidden_fields, 'S_UCP_ACTION' => append_sid("{$phpbb_root_path}ucp.{$phpEx}", 'mode=register')));
//
$user->profile_fields = array();
// Generate profile fields -> Template Block Variable profile_fields
$cp->generate_profile_fields('register', $user->get_iso_lang_id());
//
$this->tpl_name = 'ucp_register';
$this->page_title = 'UCP_REGISTRATION';
}
示例4: main
//.........这里部分代码省略.........
if (!isset($user->lang['dateformats'][$data['dateformat']])) {
$dateformat_options .= ' selected="selected"';
$s_custom = true;
}
$dateformat_options .= '>' . $user->lang['CUSTOM_DATEFORMAT'] . '</option>';
$sort_dir_text = array('a' => $user->lang['ASCENDING'], 'd' => $user->lang['DESCENDING']);
// Topic ordering options
$limit_topic_days = array(0 => $user->lang['ALL_TOPICS'], 1 => $user->lang['1_DAY'], 7 => $user->lang['7_DAYS'], 14 => $user->lang['2_WEEKS'], 30 => $user->lang['1_MONTH'], 90 => $user->lang['3_MONTHS'], 180 => $user->lang['6_MONTHS'], 365 => $user->lang['1_YEAR']);
$sort_by_topic_text = array('a' => $user->lang['AUTHOR'], 't' => $user->lang['POST_TIME'], 'r' => $user->lang['REPLIES'], 's' => $user->lang['SUBJECT'], 'v' => $user->lang['VIEWS']);
// Post ordering options
$limit_post_days = array(0 => $user->lang['ALL_POSTS'], 1 => $user->lang['1_DAY'], 7 => $user->lang['7_DAYS'], 14 => $user->lang['2_WEEKS'], 30 => $user->lang['1_MONTH'], 90 => $user->lang['3_MONTHS'], 180 => $user->lang['6_MONTHS'], 365 => $user->lang['1_YEAR']);
$sort_by_post_text = array('a' => $user->lang['AUTHOR'], 't' => $user->lang['POST_TIME'], 's' => $user->lang['SUBJECT']);
$_options = array('topic', 'post');
foreach ($_options as $sort_option) {
${'s_limit_' . $sort_option . '_days'} = '<select name="' . $sort_option . '_st">';
foreach (${'limit_' . $sort_option . '_days'} as $day => $text) {
$selected = $data[$sort_option . '_st'] == $day ? ' selected="selected"' : '';
${'s_limit_' . $sort_option . '_days'} .= '<option value="' . $day . '"' . $selected . '>' . $text . '</option>';
}
${'s_limit_' . $sort_option . '_days'} .= '</select>';
${'s_sort_' . $sort_option . '_key'} = '<select name="' . $sort_option . '_sk">';
foreach (${'sort_by_' . $sort_option . '_text'} as $key => $text) {
$selected = $data[$sort_option . '_sk'] == $key ? ' selected="selected"' : '';
${'s_sort_' . $sort_option . '_key'} .= '<option value="' . $key . '"' . $selected . '>' . $text . '</option>';
}
${'s_sort_' . $sort_option . '_key'} .= '</select>';
${'s_sort_' . $sort_option . '_dir'} = '<select name="' . $sort_option . '_sd">';
foreach ($sort_dir_text as $key => $value) {
$selected = $data[$sort_option . '_sd'] == $key ? ' selected="selected"' : '';
${'s_sort_' . $sort_option . '_dir'} .= '<option value="' . $key . '"' . $selected . '>' . $value . '</option>';
}
${'s_sort_' . $sort_option . '_dir'} .= '</select>';
}
$template->assign_vars(array('S_PREFS' => true, 'S_JABBER_DISABLED' => $config['jab_enable'] && $user_row['user_jabber'] && @extension_loaded('xml') ? false : true, 'VIEW_EMAIL' => $data['viewemail'], 'MASS_EMAIL' => $data['massemail'], 'ALLOW_PM' => $data['allowpm'], 'HIDE_ONLINE' => $data['hideonline'], 'NOTIFY_EMAIL' => $data['notifymethod'] == NOTIFY_EMAIL ? true : false, 'NOTIFY_IM' => $data['notifymethod'] == NOTIFY_IM ? true : false, 'NOTIFY_BOTH' => $data['notifymethod'] == NOTIFY_BOTH ? true : false, 'NOTIFY_PM' => $data['notifypm'], 'POPUP_PM' => $data['popuppm'], 'DST' => $data['dst'], 'BBCODE' => $data['bbcode'], 'SMILIES' => $data['smilies'], 'ATTACH_SIG' => $data['sig'], 'NOTIFY' => $data['notify'], 'VIEW_IMAGES' => $data['view_images'], 'VIEW_FLASH' => $data['view_flash'], 'VIEW_SMILIES' => $data['view_smilies'], 'VIEW_SIGS' => $data['view_sigs'], 'VIEW_AVATARS' => $data['view_avatars'], 'VIEW_WORDCENSOR' => $data['view_wordcensor'], 'S_TOPIC_SORT_DAYS' => $s_limit_topic_days, 'S_TOPIC_SORT_KEY' => $s_sort_topic_key, 'S_TOPIC_SORT_DIR' => $s_sort_topic_dir, 'S_POST_SORT_DAYS' => $s_limit_post_days, 'S_POST_SORT_KEY' => $s_sort_post_key, 'S_POST_SORT_DIR' => $s_sort_post_dir, 'DATE_FORMAT' => $data['dateformat'], 'S_DATEFORMAT_OPTIONS' => $dateformat_options, 'S_CUSTOM_DATEFORMAT' => $s_custom, 'DEFAULT_DATEFORMAT' => $config['default_dateformat'], 'A_DEFAULT_DATEFORMAT' => addslashes($config['default_dateformat']), 'S_LANG_OPTIONS' => language_select($data['lang']), 'S_STYLE_OPTIONS' => style_select($data['style']), 'S_TZ_OPTIONS' => tz_select($data['tz'], true)));
break;
case 'avatar':
include $phpbb_root_path . 'includes/functions_display.' . $phpEx;
include $phpbb_root_path . 'includes/functions_user.' . $phpEx;
$can_upload = file_exists($phpbb_root_path . $config['avatar_path']) && phpbb_is_writable($phpbb_root_path . $config['avatar_path']) && $file_uploads ? true : false;
if ($submit) {
if (!check_form_key($form_name)) {
trigger_error($user->lang['FORM_INVALID'] . adm_back_link($this->u_action . '&u=' . $user_id), E_USER_WARNING);
}
if (avatar_process_user($error, $user_row, $can_upload)) {
trigger_error($user->lang['USER_AVATAR_UPDATED'] . adm_back_link($this->u_action . '&u=' . $user_row['user_id']));
}
// Replace "error" strings with their real, localised form
$error = preg_replace('#^([A-Z_]+)$#e', "(!empty(\$user->lang['\\1'])) ? \$user->lang['\\1'] : '\\1'", $error);
}
if (!$config['allow_avatar'] && $user_row['user_avatar_type']) {
$error[] = $user->lang['USER_AVATAR_NOT_ALLOWED'];
} else {
if ($user_row['user_avatar_type'] == AVATAR_UPLOAD && !$config['allow_avatar_upload'] || $user_row['user_avatar_type'] == AVATAR_REMOTE && !$config['allow_avatar_remote'] || $user_row['user_avatar_type'] == AVATAR_GALLERY && !$config['allow_avatar_local']) {
$error[] = $user->lang['USER_AVATAR_TYPE_NOT_ALLOWED'];
}
}
// Generate users avatar
$avatar_img = $user_row['user_avatar'] ? get_user_avatar($user_row['user_avatar'], $user_row['user_avatar_type'], $user_row['user_avatar_width'], $user_row['user_avatar_height'], 'USER_AVATAR', true) : '<img src="' . $phpbb_admin_path . 'images/no_avatar.gif" alt="" />';
$display_gallery = isset($_POST['display_gallery']) ? true : false;
$avatar_select = basename(request_var('avatar_select', ''));
$category = basename(request_var('category', ''));
if ($config['allow_avatar_local'] && $display_gallery) {
avatar_gallery($category, $avatar_select, 4);
}
$template->assign_vars(array('S_AVATAR' => true, 'S_CAN_UPLOAD' => $can_upload, 'S_UPLOAD_FILE' => $config['allow_avatar'] && $can_upload && $config['allow_avatar_upload'] ? true : false, 'S_REMOTE_UPLOAD' => $config['allow_avatar'] && $can_upload && $config['allow_avatar_remote_upload'] ? true : false, 'S_ALLOW_REMOTE' => $config['allow_avatar'] && $config['allow_avatar_remote'] ? true : false, 'S_DISPLAY_GALLERY' => $config['allow_avatar'] && $config['allow_avatar_local'] && !$display_gallery ? true : false, 'S_IN_GALLERY' => $config['allow_avatar'] && $config['allow_avatar_local'] && $display_gallery ? true : false, 'AVATAR_IMAGE' => $avatar_img, 'AVATAR_MAX_FILESIZE' => $config['avatar_filesize'], 'USER_AVATAR_WIDTH' => $user_row['user_avatar_width'], 'USER_AVATAR_HEIGHT' => $user_row['user_avatar_height'], 'L_AVATAR_EXPLAIN' => sprintf($user->lang['AVATAR_EXPLAIN'], $config['avatar_max_width'], $config['avatar_max_height'], round($config['avatar_filesize'] / 1024))));
break;
示例5: language_select
'ALWAYS_ADD_SIGNATURE_YES' => ( $attachsig ) ? 'checked="checked"' : '',
'ALWAYS_ADD_SIGNATURE_NO' => ( !$attachsig ) ? 'checked="checked"' : '',
'NOTIFY_REPLY_YES' => ( $notifyreply ) ? 'checked="checked"' : '',
'NOTIFY_REPLY_NO' => ( !$notifyreply ) ? 'checked="checked"' : '',
'ALWAYS_ALLOW_BBCODE_YES' => ( $allowbbcode ) ? 'checked="checked"' : '',
'ALWAYS_ALLOW_BBCODE_NO' => ( !$allowbbcode ) ? 'checked="checked"' : '',
'ALWAYS_ALLOW_HTML_YES' => ( $allowhtml ) ? 'checked="checked"' : '',
'ALWAYS_ALLOW_HTML_NO' => ( !$allowhtml ) ? 'checked="checked"' : '',
'ALWAYS_ALLOW_SMILIES_YES' => ( $allowsmilies ) ? 'checked="checked"' : '',
'ALWAYS_ALLOW_SMILIES_NO' => ( !$allowsmilies ) ? 'checked="checked"' : '',
'ALLOW_AVATAR' => $board_config['allow_avatar_upload'],
'AVATAR' => $avatar_img,
'AVATAR_SIZE' => $board_config['avatar_filesize'],
'LANGUAGE_SELECT' => language_select($user_lang, 'language'),
'STYLE_SELECT' => style_select($user_style, 'style'),
'TIMEZONE_SELECT' => tz_select($user_timezone, 'timezone'),
'DATE_FORMAT' => $user_dateformat,
'HTML_STATUS' => $html_status,
'BBCODE_STATUS' => sprintf($bbcode_status, '<a href="' . append_sid("faq.php?mode=bbcode") . '" target="_phpbbcode">', '</a>'),
'SMILIES_STATUS' => $smilies_status,
'L_CURRENT_PASSWORD' => $lang['Current_password'],
'L_NEW_PASSWORD' => ( $mode == 'register' ) ? $lang['Password'] : $lang['New_password'],
'L_CONFIRM_PASSWORD' => $lang['Confirm_password'],
'L_CONFIRM_PASSWORD_EXPLAIN' => ( $mode == 'editprofile' ) ? $lang['Confirm_password_explain'] : '',
'L_PASSWORD_IF_CHANGED' => ( $mode == 'editprofile' ) ? $lang['password_if_changed'] : '',
'L_PASSWORD_CONFIRM_IF_CHANGED' => ( $mode == 'editprofile' ) ? $lang['password_confirm_if_changed'] : '',
'L_SUBMIT' => $lang['Submit'],
'L_RESET' => $lang['Reset'],
'L_ICQ_NUMBER' => $lang['ICQ'],
'L_MESSENGER' => $lang['MSNM'],
示例6: message_die
$sql = 'INSERT INTO ' . CONFIRM_TABLE . " (confirm_id, session_id, code) \n\t\t\tVALUES ('{$confirm_id}', '" . $userdata['session_id'] . "', '{$code}')";
if (!$db->sql_query($sql)) {
message_die(GENERAL_ERROR, 'Could not insert new confirm code information', '', __LINE__, __FILE__, $sql);
}
unset($code);
$confirm_image = '<img src="' . append_sid("profile.{$phpEx}?mode=confirm&id={$confirm_id}") . '" alt="" title="" />';
$s_hidden_fields .= '<input type="hidden" name="confirm_id" value="' . $confirm_id . '" />';
$template->assign_block_vars('switch_confirm', array());
}
//
// Let's do an overall check for settings/versions which would prevent
// us from doing file uploads....
//
$ini_val = phpversion() >= '4.0.0' ? 'ini_get' : 'get_cfg_var';
$form_enctype = @$ini_val('file_uploads') == '0' || strtolower(@$ini_val('file_uploads') == 'off') || phpversion() == '4.0.4pl1' || !$board_config['allow_avatar_upload'] || phpversion() < '4.0.3' && @$ini_val('open_basedir') != '' ? '' : 'enctype="multipart/form-data"';
$template->assign_vars(array('USERNAME' => isset($username) ? $username : '', 'CUR_PASSWORD' => isset($cur_password) ? $cur_password : '', 'NEW_PASSWORD' => isset($new_password) ? $new_password : '', 'PASSWORD_CONFIRM' => isset($password_confirm) ? $password_confirm : '', 'EMAIL' => isset($email) ? $email : '', 'CONFIRM_IMG' => $confirm_image, 'YIM' => $yim, 'ICQ' => $icq, 'MSN' => $msn, 'AIM' => $aim, 'OCCUPATION' => $occupation, 'INTERESTS' => $interests, 'LOCATION' => $location, 'WEBSITE' => $website, 'SIGNATURE' => str_replace('<br />', "\n", $signature), 'VIEW_EMAIL_YES' => $viewemail ? 'checked="checked"' : '', 'VIEW_EMAIL_NO' => !$viewemail ? 'checked="checked"' : '', 'HIDE_USER_YES' => !$allowviewonline ? 'checked="checked"' : '', 'HIDE_USER_NO' => $allowviewonline ? 'checked="checked"' : '', 'NOTIFY_PM_YES' => $notifypm ? 'checked="checked"' : '', 'NOTIFY_PM_NO' => !$notifypm ? 'checked="checked"' : '', 'POPUP_PM_YES' => $popup_pm ? 'checked="checked"' : '', 'POPUP_PM_NO' => !$popup_pm ? 'checked="checked"' : '', 'ALWAYS_ADD_SIGNATURE_YES' => $attachsig ? 'checked="checked"' : '', 'ALWAYS_ADD_SIGNATURE_NO' => !$attachsig ? 'checked="checked"' : '', 'NOTIFY_REPLY_YES' => $notifyreply ? 'checked="checked"' : '', 'NOTIFY_REPLY_NO' => !$notifyreply ? 'checked="checked"' : '', 'ALWAYS_ALLOW_BBCODE_YES' => $allowbbcode ? 'checked="checked"' : '', 'ALWAYS_ALLOW_BBCODE_NO' => !$allowbbcode ? 'checked="checked"' : '', 'ALWAYS_ALLOW_HTML_YES' => $allowhtml ? 'checked="checked"' : '', 'ALWAYS_ALLOW_HTML_NO' => !$allowhtml ? 'checked="checked"' : '', 'ALWAYS_ALLOW_SMILIES_YES' => $allowsmilies ? 'checked="checked"' : '', 'ALWAYS_ALLOW_SMILIES_NO' => !$allowsmilies ? 'checked="checked"' : '', 'ALLOW_AVATAR' => $board_config['allow_avatar_upload'], 'AVATAR' => $avatar_img, 'AVATAR_SIZE' => $board_config['avatar_filesize'], 'LANGUAGE_SELECT' => language_select($user_lang, 'language'), 'STYLE_SELECT' => style_select($user_style, 'style'), 'TIMEZONE_SELECT' => tz_select($user_timezone, 'timezone'), 'DATE_FORMAT' => $user_dateformat, 'HTML_STATUS' => $html_status, 'BBCODE_STATUS' => sprintf($bbcode_status, '<a href="' . append_sid("faq.{$phpEx}?mode=bbcode") . '" target="_phpbbcode">', '</a>'), 'SMILIES_STATUS' => $smilies_status, 'L_CURRENT_PASSWORD' => $lang['Current_password'], 'L_NEW_PASSWORD' => $mode == 'register' ? $lang['Password'] : $lang['New_password'], 'L_CONFIRM_PASSWORD' => $lang['Confirm_password'], 'L_CONFIRM_PASSWORD_EXPLAIN' => $mode == 'editprofile' ? $lang['Confirm_password_explain'] : '', 'L_PASSWORD_IF_CHANGED' => $mode == 'editprofile' ? $lang['password_if_changed'] : '', 'L_PASSWORD_CONFIRM_IF_CHANGED' => $mode == 'editprofile' ? $lang['password_confirm_if_changed'] : '', 'L_SUBMIT' => $lang['Submit'], 'L_RESET' => $lang['Reset'], 'L_ICQ_NUMBER' => $lang['ICQ'], 'L_MESSENGER' => $lang['MSNM'], 'L_YAHOO' => $lang['YIM'], 'L_WEBSITE' => $lang['Website'], 'L_AIM' => $lang['AIM'], 'L_LOCATION' => $lang['Location'], 'L_OCCUPATION' => $lang['Occupation'], 'L_BOARD_LANGUAGE' => $lang['Board_lang'], 'L_BOARD_STYLE' => $lang['Board_style'], 'L_TIMEZONE' => $lang['Timezone'], 'L_DATE_FORMAT' => $lang['Date_format'], 'L_DATE_FORMAT_EXPLAIN' => $lang['Date_format_explain'], 'L_YES' => $lang['Yes'], 'L_NO' => $lang['No'], 'L_INTERESTS' => $lang['Interests'], 'L_ALWAYS_ALLOW_SMILIES' => $lang['Always_smile'], 'L_ALWAYS_ALLOW_BBCODE' => $lang['Always_bbcode'], 'L_ALWAYS_ALLOW_HTML' => $lang['Always_html'], 'L_HIDE_USER' => $lang['Hide_user'], 'L_ALWAYS_ADD_SIGNATURE' => $lang['Always_add_sig'], 'L_AVATAR_PANEL' => $lang['Avatar_panel'], 'L_AVATAR_EXPLAIN' => sprintf($lang['Avatar_explain'], $board_config['avatar_max_width'], $board_config['avatar_max_height'], round($board_config['avatar_filesize'] / 1024)), 'L_UPLOAD_AVATAR_FILE' => $lang['Upload_Avatar_file'], 'L_UPLOAD_AVATAR_URL' => $lang['Upload_Avatar_URL'], 'L_UPLOAD_AVATAR_URL_EXPLAIN' => $lang['Upload_Avatar_URL_explain'], 'L_AVATAR_GALLERY' => $lang['Select_from_gallery'], 'L_SHOW_GALLERY' => $lang['View_avatar_gallery'], 'L_LINK_REMOTE_AVATAR' => $lang['Link_remote_Avatar'], 'L_LINK_REMOTE_AVATAR_EXPLAIN' => $lang['Link_remote_Avatar_explain'], 'L_DELETE_AVATAR' => $lang['Delete_Image'], 'L_CURRENT_IMAGE' => $lang['Current_Image'], 'L_SIGNATURE' => $lang['Signature'], 'L_SIGNATURE_EXPLAIN' => sprintf($lang['Signature_explain'], $board_config['max_sig_chars']), 'L_NOTIFY_ON_REPLY' => $lang['Always_notify'], 'L_NOTIFY_ON_REPLY_EXPLAIN' => $lang['Always_notify_explain'], 'L_NOTIFY_ON_PRIVMSG' => $lang['Notify_on_privmsg'], 'L_POPUP_ON_PRIVMSG' => $lang['Popup_on_privmsg'], 'L_POPUP_ON_PRIVMSG_EXPLAIN' => $lang['Popup_on_privmsg_explain'], 'L_PREFERENCES' => $lang['Preferences'], 'L_PUBLIC_VIEW_EMAIL' => $lang['Public_view_email'], 'L_ITEMS_REQUIRED' => $lang['Items_required'], 'L_REGISTRATION_INFO' => $lang['Registration_info'], 'L_PROFILE_INFO' => $lang['Profile_info'], 'L_PROFILE_INFO_NOTICE' => $lang['Profile_info_warn'], 'L_EMAIL_ADDRESS' => $lang['Email_address'], 'L_CONFIRM_CODE_IMPAIRED' => sprintf($lang['Confirm_code_impaired'], '<a href="mailto:' . $board_config['board_email'] . '">', '</a>'), 'L_CONFIRM_CODE' => $lang['Confirm_code'], 'L_CONFIRM_CODE_EXPLAIN' => $lang['Confirm_code_explain'], 'S_ALLOW_AVATAR_UPLOAD' => $board_config['allow_avatar_upload'], 'S_ALLOW_AVATAR_LOCAL' => $board_config['allow_avatar_local'], 'S_ALLOW_AVATAR_REMOTE' => $board_config['allow_avatar_remote'], 'S_HIDDEN_FIELDS' => $s_hidden_fields, 'S_FORM_ENCTYPE' => $form_enctype, 'S_PROFILE_ACTION' => append_sid("profile.{$phpEx}")));
//
// This is another cheat using the block_var capability
// of the templates to 'fake' an IF...ELSE...ENDIF solution
// it works well :)
//
if ($mode != 'register') {
if ($userdata['user_allowavatar'] && ($board_config['allow_avatar_upload'] || $board_config['allow_avatar_local'] || $board_config['allow_avatar_remote'])) {
$template->assign_block_vars('switch_avatar_block', array());
if ($board_config['allow_avatar_upload'] && file_exists(@phpbb_realpath('./' . $board_config['avatar_path']))) {
if ($form_enctype != '') {
$template->assign_block_vars('switch_avatar_block.switch_avatar_local_upload', array());
}
$template->assign_block_vars('switch_avatar_block.switch_avatar_remote_upload', array());
}
if ($board_config['allow_avatar_remote']) {
示例7: class_users
if (empty($class_users)) {
$class_users = new class_users();
}
$class_users->profile_update($target_profile_data);
unset($clean_password);
unset($target_profile_data);
// PROFILE EDIT BRIDGE - END
board_stats();
$message = $lang['Account_added'];
message_die(GENERAL_MESSAGE, $message);
}
}
// End of submit
if ($error) {
// If an error occured we need to htmlspecialchars again username for output on returned data
$username = htmlspecialchars($username);
$new_password = '';
$password_confirm = '';
}
// Default pages
include_once IP_ROOT_PATH . 'includes/functions_selects.' . PHP_EXT;
if ($error) {
$template->set_filenames(array('reg_header' => 'error_body.tpl'));
$template->assign_vars(array('ERROR_MESSAGE' => $error_msg));
$template->assign_var_from_handle('ERROR_BOX', 'reg_header');
}
$template->set_filenames(array('body' => ADM_TPL . 'admin_add_user_body.tpl'));
// Let's do an overall check for settings/versions which would prevent us from doing file uploads....
$template->assign_vars(array('USERNAME' => $username, 'CUR_PASSWORD' => $cur_password, 'NEW_PASSWORD' => $new_password, 'PASSWORD_CONFIRM' => $password_confirm, 'EMAIL' => $email, 'LANGUAGE_SELECT' => language_select('language', $config['default_lang']), 'STYLE_SELECT' => style_select('style', $config['default_style']), 'TIMEZONE_SELECT' => tz_select('timezone', $config['board_timezone']), 'DATE_FORMAT_SELECT' => date_select('dateformat', $config['default_dateformat']), 'L_USERNAME' => $lang['Username'], 'L_CURRENT_PASSWORD' => $lang['Current_password'], 'L_NEW_PASSWORD' => $lang['Password'], 'L_CONFIRM_PASSWORD' => $lang['Confirm_password'], 'L_SUBMIT' => $lang['Submit'], 'L_RESET' => $lang['Reset'], 'L_BOARD_LANGUAGE' => $lang['Board_lang'], 'L_BOARD_STYLE' => $lang['Board_style'], 'L_TIMEZONE' => $lang['Timezone'], 'L_DATE_FORMAT' => $lang['Date_format'], 'L_DATE_FORMAT_EXPLAIN' => $lang['Date_format_explain'], 'L_YES' => $lang['Yes'], 'L_NO' => $lang['No'], 'L_ITEMS_REQUIRED' => $lang['Items_required'], 'L_PREFERENCES' => $lang['Preferences'], 'L_REGISTRATION_INFO' => $lang['Registration_info'], 'L_PROFILE_INFO' => $lang['Profile_info'], 'L_PROFILE_INFO_NOTICE' => $lang['Profile_info_warn'], 'L_EMAIL_ADDRESS' => $lang['Email_address'], 'L_VALIDATION' => $lang['Validation'], 'L_VALIDATION_EXPLAIN' => $lang['Validation_explain'], 'S_HIDDEN_FIELDS' => $s_hidden_fields, 'S_PROFILE_ACTION' => append_sid('admin_user_register.' . PHP_EXT)));
$template->pparse('body');
include IP_ROOT_PATH . ADM . '/page_footer_admin.' . PHP_EXT;
示例8: tz_select
<td class='cellOne'>
<label for="db_pass" class='defaultBold'><?php
echo $lang_set_timezone;
?>
</label>
<div class="explain"><?php
echo $lang_set_timezone_msg;
?>
</div>
</td>
<td class='cellOne'>
<select name="pp_timezone" id="pp_timezone"<?php
echo $disabled;
?>
><?php
echo tz_select('0', true, '75');
?>
</select>
</td>
</tr>
<tr>
<td class='cellOne'>
<label for="db_pass" class='defaultBold'><?php
echo $lang_set_tz_dst;
?>
</label>
<div class="explain"><?php
echo $lang_set_tz_dst_msg;
?>
</div>
</td>
示例9: bb_die
}
$sql = "SELECT * FROM " . BB_RANKS . " WHERE rank_special = 1 ORDER BY rank_title";
if (!($result = DB()->sql_query($sql))) {
bb_die('Could not obtain ranks data');
}
$rank_select_box = '';
if (DB()->num_rows($result) != 0) {
$template->assign_block_vars('ranks_exist', array());
while ($row = DB()->sql_fetchrow($result)) {
$rank = $row['rank_title'];
$rank_id = $row['rank_id'];
$rank_select_box .= '<option value="' . $rank_id . '">' . $rank . '</option>';
}
}
$language_list = language_select('', 'language_type');
$timezone_list = tz_select('', 'timezone_type');
$sql = "SELECT f.forum_id, f.forum_name, f.forum_parent, c.cat_id, c.cat_title\n\t\t\t\tFROM ( " . BB_FORUMS . " AS f INNER JOIN " . BB_CATEGORIES . " AS c ON c.cat_id = f.cat_id )\n\t\t\t\tORDER BY c.cat_order, f.forum_order ASC";
if (!($result = DB()->sql_query($sql))) {
bb_die('Could not select forum data');
}
$forums = array();
if (DB()->num_rows($result) != 0) {
$template->assign_block_vars('forums_exist', array());
$last_cat_id = -1;
$forums_list = '';
while ($row = DB()->sql_fetchrow($result)) {
if ($row['cat_id'] != $last_cat_id) {
$forums_list .= '<optgroup label="' . htmlCHR($row['cat_title']) . '">';
$last_cat_id = $row['cat_id'];
}
$forums_list .= '<option value="' . $row['forum_id'] . '">' . ($row['forum_parent'] ? HTML_SF_SPACER : '') . htmlCHR($row['forum_name']) . '</option>';
示例10: main
//.........这里部分代码省略.........
{
$s_hidden_fields['coppa'] = $coppa;
}
$s_hidden_fields = build_hidden_fields($s_hidden_fields);
$confirm_image = '';
// Visual Confirmation - Show images
if ($config['enable_confirm'])
{
$str = '';
if (!$change_lang)
{
$user->confirm_gc(CONFIRM_REG);
$sql = 'SELECT COUNT(session_id) AS attempts
FROM ' . CONFIRM_TABLE . "
WHERE session_id = '" . $db->sql_escape($user->session_id) . "'
AND confirm_type = " . CONFIRM_REG;
$result = $db->sql_query($sql);
$attempts = (int) $db->sql_fetchfield('attempts');
$db->sql_freeresult($result);
if ($config['max_reg_attempts'] && $attempts > $config['max_reg_attempts'])
{
trigger_error('TOO_MANY_REGISTERS');
}
$code = gen_rand_string(mt_rand(5, 8));
$confirm_id = md5(unique_id($user->ip));
$seed = hexdec(substr(unique_id(), 4, 10));
// compute $seed % 0x7fffffff
$seed -= 0x7fffffff * floor($seed / 0x7fffffff);
$sql = 'INSERT INTO ' . CONFIRM_TABLE . ' ' . $db->sql_build_array('INSERT', array(
'confirm_id' => (string) $confirm_id,
'session_id' => (string) $user->session_id,
'confirm_type' => (int) CONFIRM_REG,
'code' => (string) $code,
'seed' => (int) $seed)
);
$db->sql_query($sql);
}
else
{
$str .= '&change_lang=' . $change_lang;
}
$confirm_image = '<img src="' . append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=confirm&id=' . $confirm_id . '&type=' . CONFIRM_REG . $str) . '" alt="" title="" />';
$s_hidden_fields .= '<input type="hidden" name="confirm_id" value="' . $confirm_id . '" />';
}
//
$l_reg_cond = '';
switch ($config['require_activation'])
{
case USER_ACTIVATION_SELF:
$l_reg_cond = $user->lang['UCP_EMAIL_ACTIVATE'];
break;
case USER_ACTIVATION_ADMIN:
$l_reg_cond = $user->lang['UCP_ADMIN_ACTIVATE'];
break;
}
$template->assign_vars(array(
'ERROR' => (sizeof($error)) ? implode('<br />', $error) : '',
'USERNAME' => $data['username'],
'PASSWORD' => $data['new_password'],
'PASSWORD_CONFIRM' => $data['password_confirm'],
'EMAIL' => $data['email'],
'EMAIL_CONFIRM' => $data['email_confirm'],
'CONFIRM_IMG' => $confirm_image,
'L_CONFIRM_EXPLAIN' => sprintf($user->lang['CONFIRM_EXPLAIN'], '<a href="mailto:' . htmlspecialchars($config['board_contact']) . '">', '</a>'),
'L_REG_COND' => $l_reg_cond,
'L_USERNAME_EXPLAIN' => sprintf($user->lang[$config['allow_name_chars'] . '_EXPLAIN'], $config['min_name_chars'], $config['max_name_chars']),
'L_PASSWORD_EXPLAIN' => sprintf($user->lang[$config['pass_complex'] . '_EXPLAIN'], $config['min_pass_chars'], $config['max_pass_chars']),
'S_LANG_OPTIONS' => language_select($data['lang']),
'S_TZ_OPTIONS' => tz_select($data['tz']),
'S_CONFIRM_CODE' => ($config['enable_confirm']) ? true : false,
'S_COPPA' => $coppa,
'S_HIDDEN_FIELDS' => $s_hidden_fields,
'S_UCP_ACTION' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=register'),
'S_TIME' => 1000 * ((int) $config['min_time_reg']),
)
);
//
$user->profile_fields = array();
// Generate profile fields -> Template Block Variable profile_fields
$cp->generate_profile_fields('register', $user->get_iso_lang_id());
//
$this->tpl_name = 'ucp_register';
$this->page_title = 'UCP_REGISTRATION';
}
示例11: phpversion
if ($config['ajax_checks_register'] == true) {
$verify_un_js = 'onblur="verifyUsername(this.value)"';
$verify_email_js = 'onblur="verifyEmail(this.value)"';
/*
$verify_un_js = 'onKeyUp="verifyUsername(this.value)"';
$verify_email_js = 'onKeyUp="verifyEmail(this.value)"';
*/
}
// Let's do an overall check for settings/versions which would prevent us from doing file uploads....
$ini_val = phpversion() >= '4.0.0' ? 'ini_get' : 'get_cfg_var';
$form_enctype = @$ini_val('file_uploads') == '0' || strtolower(@$ini_val('file_uploads') == 'off') || phpversion() == '4.0.4pl1' || !$config['allow_avatar_upload'] || phpversion() < '4.0.3' && @$ini_val('open_basedir') != '' ? '' : 'enctype="multipart/form-data"';
$user_sn_im_array = get_user_sn_im_array();
foreach ($user_sn_im_array as $k => $v) {
$template->assign_var(strtoupper($v['form']), ${$v}['form']);
}
$template->assign_vars(array('S_REGISTER_MESSAGE' => empty($lang['REGISTER_MESSAGE']) ? false : true, 'L_YES' => $lang['Yes'], 'L_NO' => $lang['No'], 'USERNAME' => isset($username) ? $username : '', 'CUR_PASSWORD' => isset($cur_password) ? htmlspecialchars($cur_password) : '', 'NEW_PASSWORD' => isset($new_password) ? htmlspecialchars($new_password) : '', 'PASSWORD_CONFIRM' => isset($password_confirm) ? htmlspecialchars($password_confirm) : '', 'EMAIL' => isset($email) ? $email : '', 'SIG_EDIT_LINK' => append_sid(CMS_PAGE_PROFILE . '?mode=signature'), 'SIG_DESC' => $lang['sig_description'], 'SIG_BUTTON_DESC' => $lang['sig_edit'], 'CONFIRM_IMG' => $confirm_image, 'USER_FIRST_NAME' => $user_first_name, 'USER_LAST_NAME' => $user_last_name, 'OCCUPATION' => $occupation, 'INTERESTS' => $interests, 'FLAG_SELECT' => $flag_select, 'FLAG_START' => $flag_start_image, 'PHONE' => $phone, 'SELFDES' => str_replace('<br />', "\n", $selfdes), 'L_FLAG' => $lang['Country_Flag'], 'L_PHONE' => $lang['UserPhone'], 'L_EXTRA_PROFILE_INFO' => $lang['Extra_profile_info'], 'L_EXTRA_PROFILE_INFO_EXPLAIN' => sprintf($lang['Extra_profile_info_explain'], $config['extra_max']), 'PROFILE_VIEW_POPUP_YES' => $profile_view_popup ? 'checked="checked"' : '', 'PROFILE_VIEW_POPUP_NO' => !$profile_view_popup ? 'checked="checked"' : '', 'L_PROFILE_VIEW_POPUP' => $lang['Profile_view_option'], 'S_BIRTHDAY' => $s_birthday, 'BIRTHDAY_REQUIRED' => $config['birthday_required'] ? '*' : '', 'LOCATION' => $location, 'WEBSITE' => $website, 'SIGNATURE' => str_replace('<br />', "\n", $signature), 'LOCK_GENDER' => $mode != 'register' ? 'DISABLED' : '', 'GENDER' => $gender, 'GENDER_REQUIRED' => $config['gender_required'] ? ' *' : '', 'GENDER_NO_SPECIFY_CHECKED' => $gender_no_specify_checked, 'GENDER_MALE_CHECKED' => $gender_male_checked, 'GENDER_FEMALE_CHECKED' => $gender_female_checked, 'UPI2DB_SYSTEM' => $upi2db_which_system ? 'checked="checked"' : '', 'COOKIE_SYSTEM' => !$upi2db_which_system ? 'checked="checked"' : '', 'UPI2DB_NEW_WORD_YES' => $upi2db_new_word ? 'checked="checked"' : '', 'UPI2DB_NEW_WORD_NO' => !$upi2db_new_word ? 'checked="checked"' : '', 'UPI2DB_EDIT_WORD_YES' => $upi2db_edit_word ? 'checked="checked"' : '', 'UPI2DB_EDIT_WORD_NO' => !$upi2db_edit_word ? 'checked="checked"' : '', 'UPI2DB_UNREAD_COLOR_YES' => $upi2db_unread_color ? 'checked="checked"' : '', 'UPI2DB_UNREAD_COLOR_NO' => !$upi2db_unread_color ? 'checked="checked"' : '', 'HIDE_USER_YES' => !$allowviewonline ? 'checked="checked"' : '', 'HIDE_USER_NO' => $allowviewonline ? 'checked="checked"' : '', 'VIEW_EMAIL_YES' => $viewemail ? 'checked="checked"' : '', 'VIEW_EMAIL_NO' => !$viewemail ? 'checked="checked"' : '', 'ALLOW_MASS_EMAIL_YES' => $allowmassemail ? 'checked="checked"' : '', 'ALLOW_MASS_EMAIL_NO' => !$allowmassemail ? 'checked="checked"' : '', 'ALLOW_PM_IN_YES' => $allowpmin ? 'checked="checked"' : '', 'ALLOW_PM_IN_NO' => !$allowpmin ? 'checked="checked"' : '', 'NOTIFY_PM_YES' => $notifypm ? 'checked="checked"' : '', 'NOTIFY_PM_NO' => !$notifypm ? 'checked="checked"' : '', 'POPUP_PM_YES' => $popup_pm ? 'checked="checked"' : '', 'POPUP_PM_NO' => !$popup_pm ? 'checked="checked"' : '', 'ALWAYS_ADD_SIGNATURE_YES' => $attachsig ? 'checked="checked"' : '', 'ALWAYS_ADD_SIGNATURE_NO' => !$attachsig ? 'checked="checked"' : '', 'ALWAYS_SET_BOOKMARK_YES' => $setbm ? 'checked="checked"' : '', 'ALWAYS_SET_BOOKMARK_NO' => !$setbm ? 'checked="checked"' : '', 'NOTIFY_REPLY_YES' => $notifyreply ? 'checked="checked"' : '', 'NOTIFY_REPLY_NO' => !$notifyreply ? 'checked="checked"' : '', 'ALWAYS_ALLOW_BBCODE_YES' => $allowbbcode ? 'checked="checked"' : '', 'ALWAYS_ALLOW_BBCODE_NO' => !$allowbbcode ? 'checked="checked"' : '', 'ALWAYS_ALLOW_HTML_YES' => $allowhtml ? 'checked="checked"' : '', 'ALWAYS_ALLOW_HTML_NO' => !$allowhtml ? 'checked="checked"' : '', 'ALWAYS_ALLOW_SMILIES_YES' => $allowsmilies ? 'checked="checked"' : '', 'ALWAYS_ALLOW_SMILIES_NO' => !$allowsmilies ? 'checked="checked"' : '', 'SHOW_AVATARS_YES' => $showavatars ? 'checked="checked"' : '', 'SHOW_AVATARS_NO' => !$showavatars ? 'checked="checked"' : '', 'SHOW_SIGNATURES_YES' => $showsignatures ? 'checked="checked"' : '', 'SHOW_SIGNATURES_NO' => !$showsignatures ? 'checked="checked"' : '', 'ALWAYS_ALLOW_SWEARYWORDS_YES' => $allowswearywords ? 'checked="checked"' : '', 'ALWAYS_ALLOW_SWEARYWORDS_NO' => !$allowswearywords ? 'checked="checked"' : '', 'POSTS_PER_PAGE' => empty($user->data['user_posts_per_page']) ? $config['posts_per_page'] : intval($user->data['user_posts_per_page']), 'TOPICS_PER_PAGE' => empty($user->data['user_topics_per_page']) ? $config['topics_per_page'] : intval($user->data['user_topics_per_page']), 'HOT_TOPIC' => empty($user->data['user_hot_threshold']) ? $config['hot_threshold'] : $user->data['user_hot_threshold'], 'USER_TOPIC_SHOW_DAYS_SELECT' => $user_topic_show_days_select, 'USER_TOPIC_SORTBY_TYPE_SELECT' => $user_topic_sortby_type_select, 'USER_TOPIC_SORTBY_DIR_SELECT' => $user_topic_sortby_dir_select, 'USER_POST_SHOW_DAYS_SELECT' => $user_post_show_days_select, 'USER_POST_SORTBY_TYPE_SELECT' => $user_post_sortby_type_select, 'USER_POST_SORTBY_DIR_SELECT' => $user_post_sortby_dir_select, 'ALLOW_AVATAR' => $config['allow_avatar_upload'], 'AVATAR' => $avatar_img, 'AVATAR_SIZE' => $config['avatar_filesize'], 'GRAVATAR' => $user->data['user_avatar_type'] == USER_GRAVATAR ? $user->data['user_avatar'] : '', 'LANGUAGE_SELECT' => language_select('language', $user_lang), 'STYLE_SELECT' => style_select('style', $user_style), 'TIMEZONE_SELECT' => tz_select('timezone', $user_timezone), 'DATE_FORMAT' => date_select('dateformat', $user_dateformat), 'TIME_MODE' => $time_mode, 'TIME_MODE_MANUAL_CHECKED' => $time_mode_manual_checked, 'TIME_MODE_MANUAL_DST_CHECKED' => $time_mode_manual_dst_checked, 'TIME_MODE_SERVER_SWITCH_CHECKED' => $time_mode_server_switch_checked, 'DST_TIME_LAG' => $dst_time_lag, 'HTML_STATUS' => $html_status, 'BBCODE_STATUS' => sprintf($bbcode_status, '<a href="' . append_sid('faq.' . PHP_EXT . '?mode=bbcode') . '" target="_blank">', '</a>'), 'SMILIES_STATUS' => $smilies_status, 'L_CURRENT_PASSWORD' => $lang['Current_password'], 'L_NEW_PASSWORD' => $mode == 'register' ? $lang['Password'] : $lang['New_password'], 'L_CONFIRM_PASSWORD' => $lang['Confirm_password'], 'L_CONFIRM_PASSWORD_EXPLAIN' => $mode == 'editprofile' ? $lang['Confirm_password_explain'] : '', 'L_PASSWORD_IF_CHANGED' => $mode == 'editprofile' ? $lang['password_if_changed'] : '', 'L_PASSWORD_CONFIRM_IF_CHANGED' => $mode == 'editprofile' ? $lang['password_confirm_if_changed'] : '', 'L_SUBMIT' => $lang['Submit'], 'L_RESET' => $lang['Reset'], 'L_ICQ_NUMBER' => $lang['ICQ'], 'L_MESSENGER' => $lang['MSNM'], 'L_YAHOO' => $lang['YIM'], 'L_SKYPE' => $lang['SKYPE'], 'L_WEBSITE' => $lang['Website'], 'L_AIM' => $lang['AIM'], 'L_LOCATION' => $lang['Location'], 'L_OCCUPATION' => $lang['Occupation'], 'L_BOARD_LANGUAGE' => $lang['Board_lang'], 'L_BOARD_STYLE' => $lang['Board_style'], 'L_TIMEZONE' => $lang['Timezone'], 'L_TIME_MODE' => $lang['time_mode'], 'L_TIME_MODE_TEXT' => $lang['time_mode_text'], 'L_TIME_MODE_MANUAL' => $lang['time_mode_manual'], 'L_TIME_MODE_DST' => $lang['time_mode_dst'], 'L_TIME_MODE_DST_OFF' => $l_time_mode_0, 'L_TIME_MODE_DST_ON' => $l_time_mode_1, 'L_TIME_MODE_DST_SERVER' => $l_time_mode_2, 'L_TIME_MODE_DST_TIME_LAG' => $lang['time_mode_dst_time_lag'], 'L_TIME_MODE_DST_MN' => $lang['time_mode_dst_mn'], 'L_TIME_MODE_TIMEZONE' => $lang['time_mode_timezone'], 'L_TIME_MODE_AUTO' => $lang['time_mode_auto'], 'L_DATE_FORMAT' => $lang['Date_format'], 'L_DATE_FORMAT_EXPLAIN' => $lang['Date_format_explain'], 'L_INTERESTS' => $lang['Interests'], 'L_GENDER' => $lang['Gender'], 'L_GENDER_MALE' => $lang['Male'], 'L_GENDER_FEMALE' => $lang['Female'], 'L_GENDER_NOT_SPECIFY' => $lang['No_gender_specify'], 'L_BIRTHDAY' => $lang['Birthday'], 'L_ALWAYS_ALLOW_SMILIES' => $lang['Always_smile'], 'L_ALWAYS_ALLOW_SWEARYWORDS' => $lang['Always_swear'], 'L_ALWAYS_ALLOW_BBCODE' => $lang['Always_bbcode'], 'L_ALWAYS_ALLOW_HTML' => $lang['Always_html'], 'L_HOT_THRESHOLD' => $lang['Hot_threshold'], 'L_POSTS_PER_PAGE' => $lang['Posts_per_page'], 'L_TOPICS_PER_PAGE' => $lang['Topics_per_page'], 'L_HIDE_USER' => $lang['Hide_user'], 'L_ALWAYS_ADD_SIGNATURE' => $lang['Always_add_sig'], 'L_ALWAYS_SET_BOOKMARK' => $lang['Always_set_bm'], 'L_SHOW_AVATARS' => $lang['Show_avatars'], 'L_SHOW_SIGNATURES' => $lang['Show_signatures'], 'L_RETRO_SIG' => $lang['Retro_sig'], 'L_RETRO_SIG_EXPLAIN' => $lang['Retro_sig_explain'], 'L_RETRO_SIG_CHECKBOX' => $lang['Retro_sig_checkbox'], 'L_AVATAR_SIGNATURE' => $lang['Signature_Panel'], 'L_AVATAR_PANEL' => $lang['Avatar_panel'], 'L_AVATAR_EXPLAIN' => sprintf($lang['Avatar_explain'], $config['avatar_max_width'], $config['avatar_max_height'], round($config['avatar_filesize'] / 1024)), 'L_UPLOAD_AVATAR_FILE' => $lang['Upload_Avatar_file'], 'L_UPLOAD_AVATAR_URL' => $lang['Upload_Avatar_URL'], 'L_UPLOAD_AVATAR_URL_EXPLAIN' => $lang['Upload_Avatar_URL_explain'], 'L_AVATAR_GALLERY' => $lang['Select_from_gallery'], 'L_SHOW_GALLERY' => $lang['View_avatar_gallery'], 'L_GENERATE_AVATAR' => $lang['Create_with_generator'], 'L_AVATAR_GENERATOR' => $lang['View_avatar_generator'], 'L_LINK_REMOTE_AVATAR' => $lang['Link_remote_Avatar'], 'L_LINK_REMOTE_AVATAR_EXPLAIN' => $lang['Link_remote_Avatar_explain'], 'L_GRAVATAR' => $lang['Gravatar'], 'L_GRAVATAR_EXPLAIN' => $lang['Gravatar_explain'], 'L_DELETE_AVATAR' => $lang['Delete_Image'], 'L_CURRENT_IMAGE' => $lang['Current_Image'], 'L_SIGNATURE' => $lang['Signature'], 'L_SIGNATURE_EXPLAIN' => sprintf($lang['Signature_explain'], $config['max_sig_chars']), 'L_NOTIFY_ON_REPLY' => $lang['Always_notify'], 'L_NOTIFY_ON_REPLY_EXPLAIN' => $lang['Always_notify_explain'], 'L_NOTIFY_ON_PRIVMSG' => $lang['Notify_on_privmsg'], 'L_POPUP_ON_PRIVMSG' => $lang['Popup_on_privmsg'], 'L_POPUP_ON_PRIVMSG_EXPLAIN' => $lang['Popup_on_privmsg_explain'], 'L_PREFERENCES' => $lang['Preferences'], 'L_UPI2DB_SYSTEM' => $lang['upi2db_system'], 'L_UPI2DB_WHICH_SYSTEM' => $lang['upi2db_which_system'], 'L_UPI2DB_WHICH_SYSTEM_EXPLAIN' => $lang['upi2db_which_system_explain'], 'L_UPI2DB_NEW_WORD' => $lang['upi2db_new_word'], 'L_UPI2DB_NEW_WORD_EXPLAIN' => $lang['upi2db_new_word_explain'], 'L_UPI2DB_EDIT_WORD' => $lang['upi2db_edit_word'], 'L_UPI2DB_EDIT_WORD_EXPLAIN' => $lang['upi2db_edit_word_explain'], 'L_COOKIE_SYSTEM' => $lang['cookie_system'], 'L_UPI2DB_SYSTEM' => $lang['upi2db_system'], 'L_UPI2DB_UNREAD_COLOR' => $lang['upi2db_unread_color'], 'L_PUBLIC_VIEW_EMAIL' => $lang['Public_view_email'], 'L_MASS_EMAIL' => $lang['Admin_Emails'], 'L_PM_IN' => $lang['Allow_PM_IN'], 'L_PM_IN_EXPLAIN' => $lang['Allow_PM_IN_Explain'], 'L_ITEMS_REQUIRED' => $lang['Items_required'], 'L_REGISTRATION_INFO' => $lang['Registration_info'], 'L_PROFILE_INFO' => $lang['Profile_info'], 'L_PROFILE_INFO_NOTICE' => $lang['Profile_info_warn'], 'L_EMAIL_ADDRESS' => $lang['Email_address'], 'L_CONFIRM_EMAIL' => $lang['Email_confirm'], 'EMAIL_CONFIRM' => $email_confirm, 'L_CONFIRM_CODE_IMPAIRED' => sprintf($lang['CONFIRM_CODE_IMPAIRED'], '<a href="mailto:' . $config['board_email'] . '">', '</a>'), 'U_AJAX_VERIFY' => 'ajax_verify.' . PHP_EXT, 'VERIFY_UN_JS' => $verify_un_js, 'VERIFY_EMAIL_JS' => $verify_email_js, 'L_UN_SHORT' => $lang['Reg_Username_Short'], 'L_UN_LONG' => $lang['Reg_Username_Long'], 'L_UN_TAKEN' => $lang['Reg_Username_Taken'], 'L_UN_FREE' => $lang['Reg_Username_Free'], 'L_PWD_SHORT' => $lang['Reg_PWD_Short'], 'L_PWD_EASY' => $lang['Reg_PWD_Easy'], 'L_PWD_OK' => $lang['Reg_PWD_OK'], 'L_EMAIL_INVALID' => $lang['Reg_Email_Invalid'], 'L_EMAIL_OK' => $lang['Reg_Email_OK'], 'S_ALLOW_AVATAR_UPLOAD' => $config['allow_avatar_upload'], 'S_ALLOW_AVATAR_LOCAL' => $config['allow_avatar_local'], 'S_ALLOW_AVATAR_REMOTE' => $config['allow_avatar_remote'], 'S_ALLOW_AVATAR_GENERATOR' => $config['allow_avatar_generator'], 'S_ENABLE_GRAVATARS' => $config['enable_gravatars'], 'S_HIDDEN_FIELDS' => $s_hidden_fields, 'S_FORM_ENCTYPE' => $form_enctype, 'S_PROFILE_ACTION' => append_sid(CMS_PAGE_PROFILE . '?cpl_mode=' . $cpl_mode . $social_connect_append)));
//
// This is another cheat using the block_var capability
// of the templates to 'fake' an IF...ELSE...ENDIF solution
// it works well :)
//
if ($mode != 'register') {
if ($user->data['user_allowavatar'] && ($config['allow_avatar_upload'] || $config['allow_avatar_local'] || $config['allow_avatar_remote'] || $config['enable_gravatars'] || $config['allow_avatar_generator'])) {
$template->assign_block_vars($cpl_avatar_control . 'switch_avatar_block', array());
if ($config['allow_avatar_upload'] && file_exists(@phpbb_realpath('./' . $config['avatar_path']))) {
if ($form_enctype != '') {
$template->assign_block_vars($cpl_avatar_control . 'switch_avatar_block.switch_avatar_local_upload', array());
}
$template->assign_block_vars($cpl_avatar_control . 'switch_avatar_block.switch_avatar_remote_upload', array());
}
if ($config['allow_avatar_remote']) {
示例12: meta_refresh
$emailer->reset();
$message = $lang['PROFILE_UPDATED_INACTIVE'];
$user->session_end();
} else {
meta_refresh('index.php', 10);
$message = $lang['PROFILE_UPDATED'];
}
$sql_args = DB()->build_array('UPDATE', $db_data);
DB()->query("UPDATE " . BB_USERS . " SET {$sql_args} WHERE user_id = {$pr_data['user_id']} LIMIT 1");
if ($pr_data['user_id'] != $userdata['user_id']) {
if ($pr_data['user_level'] == MOD && !empty($db_data['username'])) {
$datastore->update('moderators');
}
}
cache_rm_user_sessions($pr_data['user_id']);
if ($adm_edit) {
bb_die($lang['PROFILE_USER'] . ' <b>' . profile_url($pr_data) . '</b> ' . $lang['GOOD_UPDATE']);
} elseif (!$pr_data['user_active']) {
bb_die($lang['PROFILE_UPDATED_INACTIVE']);
} else {
meta_refresh('index.php', 10);
bb_die($lang['PROFILE_UPDATED']);
}
} else {
bb_die($lang['NOTHING_HAS_CHANGED']);
}
}
}
$template->assign_vars($tp_data);
$template->assign_vars(array('PAGE_TITLE' => $mode == 'editprofile' ? $lang['EDIT_PROFILE'] . ($adm_edit ? " :: {$pr_data['username']}" : '') : $lang['REGISTER'], 'SHOW_REG_AGREEMENT' => $mode == 'register' && !IS_ADMIN, 'ERROR_MESSAGE' => $errors ? join('<br />', array_unique($errors)) : '', 'MODE' => $mode, 'EDIT_PROFILE' => $mode == 'editprofile', 'ADM_EDIT' => $adm_edit, 'SHOW_PASS' => $adm_edit || $mode == 'register' && IS_ADMIN, 'CAPTCHA_HTML' => $need_captcha ? bb_captcha('get') : '', 'LANGUAGE_SELECT' => language_select($pr_data['user_lang'], 'user_lang'), 'TIMEZONE_SELECT' => tz_select($pr_data['user_timezone'], 'user_timezone'), 'USER_TIMEZONE' => $pr_data['user_timezone'], 'AVATAR_EXPLAIN' => sprintf($lang['AVATAR_EXPLAIN'], $bb_cfg['avatars']['max_width'], $bb_cfg['avatars']['max_height'], round($bb_cfg['avatars']['max_size'] / 1024)), 'AVATAR_DISALLOWED' => bf($pr_data['user_opt'], 'user_opt', 'dis_avatar'), 'AVATAR_DIS_EXPLAIN' => sprintf($lang['AVATAR_DISABLE'], $bb_cfg['terms_and_conditions_url']), 'AVATAR_IMG' => get_avatar($pr_data['user_id'], $pr_data['avatar_ext_id'], !bf($pr_data['user_opt'], 'user_opt', 'dis_avatar')), 'SIGNATURE_EXPLAIN' => sprintf($lang['SIGNATURE_EXPLAIN'], $bb_cfg['max_sig_chars']), 'SIG_DISALLOWED' => bf($pr_data['user_opt'], 'user_opt', 'dis_sig'), 'PR_USER_ID' => $pr_data['user_id'], 'U_RESET_AUTOLOGIN' => LOGIN_URL . "?logout=1&reset_autologin=1&sid={$userdata['session_id']}"));
print_page('usercp_register.tpl');
示例13: main
//.........这里部分代码省略.........
include_once $phpbb_root_path . 'includes/functions_messenger.' . $phpEx;
$messenger = new messenger(false);
$messenger->template($email_template, $lang);
$messenger->replyto($config['board_contact']);
$messenger->to($email, $username);
$messenger->headers('X-AntiAbuse: Board servername - ' . $config['server_name']);
$messenger->headers('X-AntiAbuse: User_id - ' . $user->data['user_id']);
$messenger->headers('X-AntiAbuse: Username - ' . $user->data['username']);
$messenger->headers('X-AntiAbuse: User IP - ' . $user->ip);
$messenger->assign_vars(array('SITENAME' => $config['sitename'], 'WELCOME_MSG' => sprintf($user->lang['WELCOME_SUBJECT'], $config['sitename']), 'USERNAME' => html_entity_decode($username), 'PASSWORD' => html_entity_decode($password_confirm), 'EMAIL_SIG' => str_replace('<br />', "\n", "-- \n" . $config['board_email_sig']), 'U_ACTIVATE' => "{$server_url}/ucp.{$phpEx}?mode=activate&u={$user_id}&k={$user_actkey}"));
if ($coppa) {
$messenger->assign_vars(array('FAX_INFO' => $config['coppa_fax'], 'MAIL_INFO' => $config['coppa_mail'], 'EMAIL_ADDRESS' => $email, 'SITENAME' => $config['sitename']));
}
$messenger->send(NOTIFY_EMAIL);
if ($config['require_activation'] == USER_ACTIVATION_ADMIN) {
// Grab an array of user_id's with a_user permissions ... these users can activate a user
$admin_ary = $auth->acl_get_list(false, 'a_user', false);
$sql = 'SELECT user_id, username, user_email, user_lang, user_jabber, user_notify_type
FROM ' . USERS_TABLE . '
WHERE user_id IN (' . implode(', ', $admin_ary[0]['a_user']) . ')';
$result = $db->sql_query($sql);
while ($row = $db->sql_fetchrow($result)) {
$messenger->template('admin_activate', $row['user_lang']);
$messenger->replyto($config['board_contact']);
$messenger->to($row['user_email'], $row['username']);
$messenger->im($row['user_jabber'], $row['username']);
$messenger->assign_vars(array('USERNAME' => html_entity_decode($username), 'EMAIL_SIG' => str_replace('<br />', "\n", "-- \n" . $config['board_email_sig']), 'U_ACTIVATE' => "{$server_url}/ucp.{$phpEx}?mode=activate&u={$user_id}&k={$user_actkey}"));
$messenger->send($row['user_notify_type']);
}
$db->sql_freeresult($result);
}
}
if ($user_type == USER_NORMAL || !$config['email_enable']) {
set_config('newest_user_id', $user_id, true);
set_config('newest_username', $username, true);
set_config('num_users', $config['num_users'] + 1, true);
}
unset($data);
$message = $message . '<br /><br />' . sprintf($user->lang['RETURN_INDEX'], '<a href="' . append_sid("{$phpbb_root_path}index.{$phpEx}") . '">', '</a>');
trigger_error($message);
}
}
$s_hidden_fields = build_hidden_fields(array('agreed' => 'true', 'coppa' => $coppa, 'change_lang' => 0));
$confirm_image = '';
// Visual Confirmation - Show images
if ($config['enable_confirm']) {
if (!$change_lang) {
$sql = 'SELECT session_id
FROM ' . SESSIONS_TABLE;
$result = $db->sql_query($sql);
if ($row = $db->sql_fetchrow($result)) {
$sql_in = array();
do {
$sql_in[] = "'" . $db->sql_escape($row['session_id']) . "'";
} while ($row = $db->sql_fetchrow($result));
$sql = 'DELETE FROM ' . CONFIRM_TABLE . '
WHERE session_id NOT IN (' . implode(', ', $sql_in) . ')
AND confirm_type = ' . CONFIRM_REG;
$db->sql_query($sql);
}
$db->sql_freeresult($result);
$sql = 'SELECT COUNT(session_id) AS attempts
FROM ' . CONFIRM_TABLE . "\n\t\t\t\t\tWHERE session_id = '" . $db->sql_escape($user->session_id) . "'\n\t\t\t\t\t\tAND confirm_type = " . CONFIRM_REG;
$result = $db->sql_query($sql);
$attempts = (int) $db->sql_fetchfield('attempts');
$db->sql_freeresult($result);
if ($config['max_reg_attempts'] && $attempts > $config['max_reg_attempts']) {
trigger_error($user->lang['TOO_MANY_REGISTERS']);
}
$code = gen_rand_string(mt_rand(5, 8));
$confirm_id = md5(unique_id($user->ip));
$sql = 'INSERT INTO ' . CONFIRM_TABLE . ' ' . $db->sql_build_array('INSERT', array('confirm_id' => (string) $confirm_id, 'session_id' => (string) $user->session_id, 'confirm_type' => (int) CONFIRM_REG, 'code' => (string) $code));
$db->sql_query($sql);
}
$confirm_image = '<img src="' . append_sid("{$phpbb_root_path}ucp.{$phpEx}", 'mode=confirm&id=' . $confirm_id . '&type=' . CONFIRM_REG) . '" alt="" title="" />';
$s_hidden_fields .= '<input type="hidden" name="confirm_id" value="' . $confirm_id . '" />';
}
//
$l_reg_cond = '';
switch ($config['require_activation']) {
case USER_ACTIVATION_SELF:
$l_reg_cond = $user->lang['UCP_EMAIL_ACTIVATE'];
break;
case USER_ACTIVATION_ADMIN:
$l_reg_cond = $user->lang['UCP_ADMIN_ACTIVATE'];
break;
}
$user_char_ary = array('.*' => 'USERNAME_CHARS_ANY', '[\\w]+' => 'USERNAME_ALPHA_ONLY', '[\\w_\\+\\. \\-\\[\\]]+' => 'USERNAME_ALPHA_SPACERS');
$lang = isset($lang) ? $lang : $config['default_lang'];
$tz = isset($tz) ? $tz : $config['board_timezone'];
//
$template->assign_vars(array('ERROR' => sizeof($error) ? implode('<br />', $error) : '', 'USERNAME' => isset($username) ? $username : '', 'PASSWORD' => isset($new_password) ? $new_password : '', 'PASSWORD_CONFIRM' => isset($password_confirm) ? $password_confirm : '', 'EMAIL' => isset($email) ? $email : '', 'EMAIL_CONFIRM' => isset($email_confirm) ? $email_confirm : '', 'CONFIRM_IMG' => $confirm_image, 'L_CONFIRM_EXPLAIN' => sprintf($user->lang['CONFIRM_EXPLAIN'], '<a href="mailto:' . htmlentities($config['board_contact']) . '">', '</a>'), 'L_ITEMS_REQUIRED' => $l_reg_cond, 'L_USERNAME_EXPLAIN' => sprintf($user->lang[$user_char_ary[str_replace('\\\\', '\\', $config['allow_name_chars'])] . '_EXPLAIN'], $config['min_name_chars'], $config['max_name_chars']), 'L_NEW_PASSWORD_EXPLAIN' => sprintf($user->lang['NEW_PASSWORD_EXPLAIN'], $config['min_pass_chars'], $config['max_pass_chars']), 'S_LANG_OPTIONS' => language_select($lang), 'S_TZ_OPTIONS' => tz_select($tz), 'S_CONFIRM_CODE' => $config['enable_confirm'] ? true : false, 'S_COPPA' => $coppa, 'S_HIDDEN_FIELDS' => $s_hidden_fields, 'S_UCP_ACTION' => append_sid("{$phpbb_root_path}ucp.{$phpEx}", 'mode=register')));
//
$user->profile_fields = array();
// Generate profile fields -> Template Block Variable profile_fields
$cp->generate_profile_fields('register', $user->get_iso_lang_id());
//
$this->tpl_name = 'ucp_register';
$this->page_title = 'UCP_REGISTRATION';
}
示例14: str_replace
}
if (isset($HTTP_POST_VARS['submit'])) {
$sql = "UPDATE " . CONFIG_TABLE . " SET\r\n\t\t\t\tconfig_value = '" . str_replace("\\'", "''", $new[$config_name]) . "'\r\n\t\t\t\tWHERE config_name = '{$config_name}'";
if (!$db->sql_query($sql)) {
message_die(GENERAL_ERROR, "Failed to update general configuration for {$config_name}", "", __LINE__, __FILE__, $sql);
}
}
}
if (isset($HTTP_POST_VARS['submit'])) {
$message = $lang['Config_updated'] . "<br /><br />" . sprintf($lang['Click_return_config'], "<a href=\"" . append_sid("admin_board.{$phpEx}") . "\">", "</a>") . "<br /><br />" . sprintf($lang['Click_return_admin_index'], "<a href=\"" . append_sid("index.{$phpEx}?pane=right") . "\">", "</a>");
message_die(GENERAL_MESSAGE, $message);
}
}
$style_select = style_select($new['default_style'], 'default_style', "../templates");
$lang_select = language_select($new['default_lang'], 'default_lang', "../language");
$timezone_select = tz_select($new['board_timezone'], 'board_timezone');
$disable_board_yes = $new['board_disable'] ? "checked=\"checked\"" : "";
$disable_board_no = !$new['board_disable'] ? "checked=\"checked\"" : "";
$cookie_secure_yes = $new['cookie_secure'] ? "checked=\"checked\"" : "";
$cookie_secure_no = !$new['cookie_secure'] ? "checked=\"checked\"" : "";
$html_tags = $new['allow_html_tags'];
$override_user_style_yes = $new['override_user_style'] ? "checked=\"checked\"" : "";
$override_user_style_no = !$new['override_user_style'] ? "checked=\"checked\"" : "";
$html_yes = $new['allow_html'] ? "checked=\"checked\"" : "";
$html_no = !$new['allow_html'] ? "checked=\"checked\"" : "";
$bbcode_yes = $new['allow_bbcode'] ? "checked=\"checked\"" : "";
$bbcode_no = !$new['allow_bbcode'] ? "checked=\"checked\"" : "";
$activation_none = $new['require_activation'] == USER_ACTIVATION_NONE ? "checked=\"checked\"" : "";
$activation_user = $new['require_activation'] == USER_ACTIVATION_SELF ? "checked=\"checked\"" : "";
$activation_admin = $new['require_activation'] == USER_ACTIVATION_ADMIN ? "checked=\"checked\"" : "";
$confirm_yes = $new['enable_confirm'] ? 'checked="checked"' : '';
示例15: switch
}
}
switch ($mode) {
case 'config_mods':
$template->assign_vars(array('S_CONFIG_ACTION' => 'admin_board.php?mode=config_mods', 'CONFIG_MODS' => true, 'MAGNET_LINKS_ENABLED' => $new['magnet_links_enabled'], 'GENDER' => $new['gender'], 'CALLSEED' => $new['callseed'], 'TOR_STATS' => $new['tor_stats'], 'SHOW_LATEST_NEWS' => $new['show_latest_news'], 'MAX_NEWS_TITLE' => $new['max_news_title'], 'LATEST_NEWS_COUNT' => $new['latest_news_count'], 'LATEST_NEWS_FORUM_ID' => $new['latest_news_forum_id'], 'SHOW_NETWORK_NEWS' => $new['show_network_news'], 'MAX_NET_TITLE' => $new['max_net_title'], 'NETWORK_NEWS_COUNT' => $new['network_news_count'], 'NETWORK_NEWS_FORUM_ID' => $new['network_news_forum_id'], 'WHOIS_INFO' => $new['whois_info'], 'SHOW_MOD_INDEX' => $new['show_mod_index'], 'BIRTHDAY_ENABLED' => $new['birthday_enabled'], 'BIRTHDAY_MAX_AGE' => $new['birthday_max_age'], 'BIRTHDAY_MIN_AGE' => $new['birthday_min_age'], 'BIRTHDAY_CHECK_DAY' => $new['birthday_check_day'], 'PREMOD' => $new['premod'], 'TOR_COMMENT' => $new['tor_comment'], 'NEW_TPLS' => $new['new_tpls'], 'SEED_BONUS_ENABLED' => $new['seed_bonus_enabled'], 'SEED_BONUS_TOR_SIZE' => $new['seed_bonus_tor_size'], 'SEED_BONUS_USER_REGDATE' => $new['seed_bonus_user_regdate']));
if ($new['seed_bonus_points'] && $new['seed_bonus_release']) {
$seed_bonus = unserialize($new['seed_bonus_points']);
$seed_release = unserialize($new['seed_bonus_release']);
foreach ($seed_bonus as $i => $row) {
if (!$row || !$seed_release[$i]) {
continue;
}
$template->assign_block_vars('seed_bonus', array('RELEASE' => $seed_release[$i], 'POINTS' => $row));
}
}
if ($new['bonus_upload'] && $new['bonus_upload_price']) {
$upload_row = unserialize($new['bonus_upload']);
$price_row = unserialize($new['bonus_upload_price']);
foreach ($upload_row as $i => $row) {
if (!$row || !$price_row[$i]) {
continue;
}
$template->assign_block_vars('bonus_upload', array('UP' => $row, 'PRICE' => $price_row[$i]));
}
}
break;
default:
$template->assign_vars(array('S_CONFIG_ACTION' => 'admin_board.php?mode=config', 'CONFIG' => true, 'SITENAME' => htmlCHR($new['sitename']), 'CONFIG_SITE_DESCRIPTION' => htmlCHR($new['site_desc']), 'DISABLE_BOARD' => $new['board_disable'] ? true : false, 'ALLOW_AUTOLOGIN' => $new['allow_autologin'] ? true : false, 'AUTOLOGIN_TIME' => (int) $new['max_autologin_time'], 'MAX_POLL_OPTIONS' => $new['max_poll_options'], 'FLOOD_INTERVAL' => $new['flood_interval'], 'TOPICS_PER_PAGE' => $new['topics_per_page'], 'POSTS_PER_PAGE' => $new['posts_per_page'], 'HOT_TOPIC' => $new['hot_threshold'], 'DEFAULT_DATEFORMAT' => $new['default_dateformat'], 'LANG_SELECT' => language_select($new['default_lang'], 'default_lang'), 'TIMEZONE_SELECT' => tz_select($new['board_timezone'], 'board_timezone'), 'MAX_LOGIN_ATTEMPTS' => $new['max_login_attempts'], 'LOGIN_RESET_TIME' => $new['login_reset_time'], 'PRUNE_ENABLE' => $new['prune_enable'] ? true : false, 'ALLOW_BBCODE' => $new['allow_bbcode'] ? true : false, 'ALLOW_SMILIES' => $new['allow_smilies'] ? true : false, 'ALLOW_SIG' => $new['allow_sig'] ? true : false, 'SIG_SIZE' => $new['max_sig_chars'], 'ALLOW_NAMECHANGE' => $new['allow_namechange'] ? true : false, 'SMILIES_PATH' => $new['smilies_path']));
break;
}
print_page('admin_board.tpl', 'admin');