function admin_site($save) { if ($save) { $data = array('global' => array('default_theme' => array('post_name' => 'default_theme'), 'link_optimization' => array('post_name' => 'link_optimization'), 'site_name' => array('post_name' => 'site_name'), 'site_url' => array('post_name' => 'site_url'), 'start_date' => array('post_name' => 'start_date'), 'foot1' => array('post_name' => 'foot1'), 'foot2' => array('post_name' => 'foot2'))); admin_save($data); } global $_CLASS, $_CORE_CONFIG; $_CLASS['core_template']->assign_array(array('A_OPTION' => 'site', 'ACTION' => generate_link('system', array('admin' => true)), 'LINK_OPTIMIZATION' => $_CORE_CONFIG['global']['link_optimization'], 'SELECT_THEME' => select_theme($_CORE_CONFIG['global']['default_theme']), 'SITE_NAME' => $_CORE_CONFIG['global']['site_name'], 'SITE_URL' => $_CORE_CONFIG['global']['site_url'], 'START_DATE' => $_CORE_CONFIG['global']['start_date'], 'FOOTER_FIRST' => $_CORE_CONFIG['global']['foot1'], 'FOOTER_SECOND' => $_CORE_CONFIG['global']['foot2'])); $_CLASS['core_template']->display('admin/system/index.html'); }
$_CLASS['core_user']->add_lang('admin/system', null); $mode = get_variable('mode', 'GET', false); if (!$mode || !in_array($mode, array('Site', 'system'))) { $mode = 'site'; } $_CLASS['core_template']->assign_array(array('LINK_SITE' => generate_link('system&mode=site', array('admin' => true)), 'LINK_SYSTEM' => generate_link('system&mode=system', array('admin' => true)), 'SYSTEM_MODE' => $mode)); $save = isset($_POST['submit']); switch ($mode) { case 'site': if ($save) { $data = array('global' => array('default_theme' => get_variable('default_theme', 'POST', ''), 'link_optimization' => get_variable('link_optimization', 'POST', 0, 'int'), 'site_name' => get_variable('site_name', 'POST', ''), 'site_url' => get_variable('site_url', 'POST', ''), 'foot1' => get_variable('foot1', 'POST', ''), 'foot2' => get_variable('foot2', 'POST', '')), 'email' => array('email_enable' => get_variable('email_enable', 'POST') ? 1 : 0, 'email_function_name' => get_variable('email_function_name', 'POST', ''), 'smtp' => get_variable('smtp', 'POST', 0, 'int'), 'smtp_host' => get_variable('smtp_host', 'POST', ''), 'smtp_port' => get_variable('smtp_port', 'POST', '', 'int'), 'smtp_username' => get_variable('smtp_username', 'POST', ''), 'smtp_password' => get_variable('smtp_password', 'POST', ''), 'site_email' => get_variable('site_email', 'POST', ''))); setting_save($data); unset($data); } global $_CLASS, $_CORE_CONFIG; $_CLASS['core_template']->assign_array(array('A_OPTION' => 'site', 'ACTION' => generate_link('system', array('admin' => true)), 'LINK_OPTIMIZATION' => $_CORE_CONFIG['global']['link_optimization'], 'SELECT_THEME' => select_theme($_CORE_CONFIG['global']['default_theme']), 'SITE_NAME' => $_CORE_CONFIG['global']['site_name'], 'EMAIL_ENABLE' => $_CORE_CONFIG['email']['email_enable'], 'EMAIL_FUNCTION_NAME' => $_CORE_CONFIG['email']['email_function_name'], 'SMTP' => $_CORE_CONFIG['email']['smtp'], 'SMTP_HOST' => $_CORE_CONFIG['email']['smtp_host'], 'SMTP_PORT' => $_CORE_CONFIG['email']['smtp_port'], 'SMTP_USERNAME' => $_CORE_CONFIG['email']['smtp_username'], 'SMTP_PASSWORD' => $_CORE_CONFIG['email']['smtp_password'], 'SITE_EMAIL' => $_CORE_CONFIG['email']['site_email'], 'FOOTER_FIRST' => $_CORE_CONFIG['global']['foot1'], 'FOOTER_SECOND' => $_CORE_CONFIG['global']['foot2'])); $_CLASS['core_template']->display('admin/system/index.html'); break; case 'system': if ($save) { if (!empty($_POST['maintenance_start'])) { $expires = strtotime($_POST['maintenance_start']); $_POST['maintenance_start'] = !$expires || $expires === -1 ? 0 : $expires; } $data = array('maintenance' => array('active' => get_variable('maintenance', 'POST') ? 1 : 0, 'text' => get_variable('maintenance_text', 'POST', ''), 'start' => get_variable('maintenance_start', 'POST', 0, 'int')), 'server' => array('cookie_domain' => get_variable('cookie_domain', 'POST', ''), 'cookie_name' => get_variable('cookie_name', 'POST', ''), 'cookie_path' => get_variable('cookie_path', 'POST', ''), 'error_options' => get_variable('error_options', 'POST', 0, 'int'), 'site_domain' => get_variable('site_domain', 'POST', ''), 'site_port' => get_variable('site_port', 'POST', ''), 'site_path' => get_variable('site_path', 'POST', ''), 'site_secure' => get_variable('site_secure', 'POST', 0, 'int'), 'ip_check' => get_variable('ip_check', 'POST', 0, 'int'), 'limit_load' => get_variable('limit_load', 'POST', 0, 'int'), 'limit_sessions' => get_variable('limit_sessions', 'POST', 0, 'int'), 'session_length' => get_variable('session_length', 'POST', 600, 'int'))); setting_save($data); unset($data); } global $_CLASS, $_CORE_CONFIG; $path = str_replace('\\', '/', dirname(getenv('SCRIPT_NAME'))); if (substr($path, -1) !== '/') {
/* ||**************************************************************|| || Viperal CMS © : || ||**************************************************************|| || || || Copyright (C) 2004, 2005 || || By Ryan Marshall ( Viperal ) || || || || Email: viperal1@gmail.com || || Site: http://www.viperal.com || || || ||**************************************************************|| || LICENSE: ( http://www.gnu.org/licenses/gpl.txt ) || ||**************************************************************|| || Viperal CMS is released under the terms and conditions || || of the GNU General Public License version 2 || || || ||**************************************************************|| $Id$ */ if (!defined('VIPERAL')) { die; } $this->content = ' <form action="" method="post"> <p style="text-align: center;"> <select name="prevtheme" onchange="this.form.submit();">' . select_theme() . '</select> <br /><br /><input class="button" value="Select" type="submit" /> </p> </form>';
<h2>Our Services</h2> <a href="<?php echo cal_url(); ?> /index.php?com=tools&t=3" class="side mb icon">Mobile</a> <a href="<?php echo cal_url(); ?> /index.php?com=newsletter" class="side nl icon">Newsletter</a> <a href="<?php echo cal_url(); ?> /index.php?com=tools&t=1" class="side rs icon">RSS</a> <a href="<?php echo cal_url(); ?> /link/ical.php" class="side ic icon">iCalendar</a> <h2>Calendar Settings</h2> <div class="setting"> <span>Language:</span><?php select_language(0); ?> </div> <div class="setting"> <span>Theme:</span><?php select_theme(1); ?> </div>
function ucp_prefs($id, $mode) { global $config, $_CLASS, $site_file_root, $_CORE_CONFIG; $submit = isset($_POST['submit']) ? true : false; $error = $data = array(); $s_hidden_fields = ''; require_once $site_file_root . 'includes/forums/functions_user.php'; switch ($mode) { case 'personal': if ($submit) { $var_ary = array('dateformat' => (string) $_CORE_CONFIG['global']['default_dateformat'], 'lang' => (string) $_CORE_CONFIG['global']['default_lang'], 'tz' => (double) $_CORE_CONFIG['global']['default_timezone'] / 3600, 'theme' => (string) $_CORE_CONFIG['global']['default_theme'], 'dst' => (bool) $_CORE_CONFIG['global']['default_dst'], 'viewemail' => false, 'massemail' => true, 'hideonline' => false, 'notifymethod' => 0, 'notifypm' => true, 'popuppm' => false, 'allowpm' => true, 'report_pm_notify' => false); foreach ($var_ary as $var => $default) { $data[$var] = request_var($var, $default); } $var_ary = array('lang' => array('match', false, '#^[a-z_]{2,}$#i'), 'tz' => array('num', false, -13, 13)); $error = validate_data($data, $var_ary); extract($data); unset($data); if (!sizeof($error)) { $_CLASS['core_user']->optionset('popuppm', $popuppm); $_CLASS['core_user']->optionset('report_pm_notify', $report_pm_notify); $sql_ary = array('user_allow_pm' => $allowpm, 'user_allow_viewemail' => $viewemail, 'user_allow_massemail' => $massemail, 'user_allow_viewonline' => $_CLASS['auth']->acl_get('u_hideonline') ? !$hideonline : $_CLASS['core_user']->data['user_allow_viewonline'], 'user_notify_type' => $notifymethod, 'user_data' => serialize($_CLASS['core_user']->data['user_data']), 'user_dst' => $dst, 'user_time_format' => $dateformat, 'user_lang' => $lang, 'user_timezone' => $tz * 3600, 'user_theme' => $theme); $sql = 'UPDATE ' . USERS_TABLE . ' SET ' . $_CLASS['core_db']->sql_build_array('UPDATE', $sql_ary) . ' WHERE user_id = ' . $_CLASS['core_user']->data['user_id']; $_CLASS['core_db']->sql_query($sql); if ($theme != $_CLASS['core_display']->theme) { $_CLASS['core_user']->session_data_remove('user_theme'); } $_CLASS['core_display']->meta_refresh(3, generate_link("Control_Panel&i={$id}&mode={$mode}")); $message = $_CLASS['core_user']->lang['PREFERENCES_UPDATED'] . '<br /><br />' . sprintf($_CLASS['core_user']->lang['RETURN_UCP'], '<a href="' . generate_link("Control_Panel&i={$id}&mode={$mode}") . '">', '</a>'); trigger_error($message); } // Replace "error" strings with their real, localised form $error = preg_replace('#^([A-Z_]+)$#e', "(!empty(\$_CLASS['core_user']->lang['\\1'])) ? \$_CLASS['core_user']->lang['\\1'] : '\\1'", $error); } $viewemail = isset($viewemail) ? $viewemail : $_CLASS['core_user']->data['user_allow_viewemail']; $view_email_yes = $viewemail ? ' checked="checked"' : ''; $view_email_no = !$viewemail ? ' checked="checked"' : ''; $massemail = isset($massemail) ? $massemail : $_CLASS['core_user']->data['user_allow_massemail']; $mass_email_yes = $massemail ? ' checked="checked"' : ''; $mass_email_no = !$massemail ? ' checked="checked"' : ''; $allowpm = isset($allowpm) ? $allowpm : $_CLASS['core_user']->data['user_allow_pm']; $allow_pm_yes = $allowpm ? ' checked="checked"' : ''; $allow_pm_no = !$allowpm ? ' checked="checked"' : ''; $hideonline = isset($hideonline) ? $hideonline : !$_CLASS['core_user']->data['user_allow_viewonline']; $hide_online_yes = $hideonline ? ' checked="checked"' : ''; $hide_online_no = !$hideonline ? ' checked="checked"' : ''; $notifypm = isset($notifypm) ? $notifypm : ''; $notify_pm_yes = $notifypm ? ' checked="checked"' : ''; $notify_pm_no = !$notifypm ? ' checked="checked"' : ''; $popuppm = isset($popuppm) ? $popuppm : $_CLASS['core_user']->optionget('popuppm'); $popup_pm_yes = $popuppm ? ' checked="checked"' : ''; $popup_pm_no = !$popuppm ? ' checked="checked"' : ''; $report_pm_notify = isset($report_pm_notify) ? $report_pm_notify : $_CLASS['core_user']->optionget('report_pm_notify'); $report_pm_notify_yes = $report_pm_notify ? ' checked="checked"' : ''; $report_pm_notify_no = !$report_pm_notify ? ' checked="checked"' : ''; $dst = isset($dst) ? $dst : $_CLASS['core_user']->data['user_dst']; $dst_yes = $dst ? ' checked="checked"' : ''; $dst_no = !$dst ? ' checked="checked"' : ''; $notifymethod = isset($notifymethod) ? $notifymethod : $_CLASS['core_user']->data['user_notify_type']; $dateformat = isset($dateformat) ? $dateformat : $_CLASS['core_user']->data['user_time_format']; $lang = isset($lang) ? $lang : $_CLASS['core_user']->data['user_lang']; $theme = isset($theme) ? $theme : $_CLASS['core_user']->data['user_theme']; $tz = isset($tz) ? $tz * 3600 : $_CLASS['core_user']->data['user_timezone'] / 3600; $_CLASS['core_template']->assign(array('ERROR' => sizeof($error) ? implode('<br />', $error) : '', 'VIEW_EMAIL_YES' => $view_email_yes, 'VIEW_EMAIL_NO' => $view_email_no, 'ADMIN_EMAIL_YES' => $mass_email_yes, 'ADMIN_EMAIL_NO' => $mass_email_no, 'HIDE_ONLINE_YES' => $hide_online_yes, 'HIDE_ONLINE_NO' => $hide_online_no, 'ALLOW_PM_YES' => $allow_pm_yes, 'ALLOW_PM_NO' => $allow_pm_no, 'NOTIFY_PM_YES' => $notify_pm_yes, 'NOTIFY_PM_NO' => $notify_pm_no, 'POPUP_PM_YES' => $popup_pm_yes, 'POPUP_PM_NO' => $popup_pm_no, 'REPORT_PM_NO' => $report_pm_notify_no, 'REPORT_PM_YES' => $report_pm_notify_yes, 'DST_YES' => $dst_yes, 'DST_NO' => $dst_no, 'NOTIFY_EMAIL' => $notifymethod == NOTIFY_EMAIL ? 'checked="checked"' : '', 'NOTIFY_IM' => $notifymethod == NOTIFY_IM ? 'checked="checked"' : '', 'NOTIFY_BOTH' => $notifymethod == NOTIFY_BOTH ? 'checked="checked"' : '', 'DATE_FORMAT' => $dateformat, 'S_LANG_OPTIONS' => select_language($lang), 'S_THEME_OPTIONS' => select_theme($theme), 'S_TZ_OPTIONS' => select_tz($tz), 'S_CAN_HIDE_ONLINE' => true, 'S_SELECT_NOTIFY' => $config['jab_enable'] && $_CLASS['core_user']->data['user_jabber'] && @extension_loaded('xml') ? true : false)); break; case 'view': if ($submit) { $var_ary = array('topic_sk' => (string) 't', 'topic_sd' => (string) 'd', 'topic_st' => 0, 'post_sk' => (string) 't', 'post_sd' => (string) 'a', 'post_st' => 0, 'images' => true, 'flash' => false, 'smilies' => true, 'sigs' => true, 'avatars' => true, 'wordcensor' => false); foreach ($var_ary as $var => $default) { $data[$var] = request_var($var, $default); } $var_ary = 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)); $error = validate_data($data, $var_ary); extract($data); unset($data); if (!sizeof($error)) { $_CLASS['core_user']->optionset('viewimg', $images); $_CLASS['core_user']->optionset('viewflash', $flash); $_CLASS['core_user']->optionset('viewsmilies', $smilies); $_CLASS['core_user']->optionset('viewsigs', $sigs); $_CLASS['core_user']->optionset('viewavatars', $avatars); if ($_CLASS['auth']->acl_get('u_chgcensors')) { $_CLASS['core_user']->optionset('viewcensors', $wordcensor); } $sql_ary = array('user_data' => serialize($_CLASS['core_user']->data['user_data']), 'user_topic_sortby_type' => $topic_sk, 'user_post_sortby_type' => $post_sk, 'user_topic_sortby_dir' => $topic_sd, 'user_post_sortby_dir' => $post_sd, 'user_topic_show_days' => $topic_st, 'user_post_show_days' => $post_st); $sql = 'UPDATE ' . USERS_TABLE . ' SET ' . $_CLASS['core_db']->sql_build_array('UPDATE', $sql_ary) . ' WHERE user_id = ' . $_CLASS['core_user']->data['user_id']; $_CLASS['core_db']->sql_query($sql); $_CLASS['core_display']->meta_refresh(3, generate_link("Control_Panel&i={$id}&mode={$mode}")); $message = $_CLASS['core_user']->lang['PREFERENCES_UPDATED'] . '<br /><br />' . sprintf($_CLASS['core_user']->lang['RETURN_UCP'], '<a href="' . generate_link("Control_Panel&i={$id}&mode={$mode}") . '">', '</a>'); trigger_error($message); } // Replace "error" strings with their real, localised form $error = preg_replace('#^([A-Z_]+)$#e', "(!empty(\$_CLASS['core_user']->lang['\\1'])) ? \$_CLASS['core_user']->lang['\\1'] : '\\1'", $error); } $topic_sk = isset($topic_sk) ? $topic_sk : (!empty($_CLASS['core_user']->data['user_tpic_sortby_type']) ? $_CLASS['core_user']->data['user_topic_sortby_type'] : 't'); $post_sk = isset($post_sk) ? $post_sk : (!empty($_CLASS['core_user']->data['user_post_sortby_type']) ? $_CLASS['core_user']->data['user_post_sortby_type'] : 't'); $topic_sd = isset($topic_sd) ? $topic_sd : (!empty($_CLASS['core_user']->data['user_topic_sortby_dir']) ? $_CLASS['core_user']->data['user_topic_sortby_dir'] : 'd'); $post_sd = isset($post_sd) ? $post_sd : (!empty($_CLASS['core_user']->data['user_post_sortby_dir']) ? $_CLASS['core_user']->data['user_post_sortby_dir'] : 'd'); $topic_st = isset($topic_st) ? $topic_st : (!empty($_CLASS['core_user']->data['user_topic_show_days']) ? $_CLASS['core_user']->data['user_topic_show_days'] : 0); $post_st = isset($post_st) ? $post_st : (!empty($_CLASS['core_user']->data['user_post_show_days']) ? $_CLASS['core_user']->data['user_post_show_days'] : 0); $sort_dir_text = array('a' => $_CLASS['core_user']->lang['ASCENDING'], 'd' => $_CLASS['core_user']->lang['DESCENDING']); // Topic ordering options $limit_topic_days = array(0 => $_CLASS['core_user']->lang['ALL_TOPICS'], 1 => $_CLASS['core_user']->lang['1_DAY'], 7 => $_CLASS['core_user']->lang['7_DAYS'], 14 => $_CLASS['core_user']->lang['2_WEEKS'], 30 => $_CLASS['core_user']->lang['1_MONTH'], 90 => $_CLASS['core_user']->lang['3_MONTHS'], 180 => $_CLASS['core_user']->lang['6_MONTHS'], 364 => $_CLASS['core_user']->lang['1_YEAR']); $sort_by_topic_text = array('a' => $_CLASS['core_user']->lang['AUTHOR'], 't' => $_CLASS['core_user']->lang['POST_TIME'], 'r' => $_CLASS['core_user']->lang['REPLIES'], 's' => $_CLASS['core_user']->lang['SUBJECT'], 'v' => $_CLASS['core_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 => $_CLASS['core_user']->lang['ALL_POSTS'], 1 => $_CLASS['core_user']->lang['1_DAY'], 7 => $_CLASS['core_user']->lang['7_DAYS'], 14 => $_CLASS['core_user']->lang['2_WEEKS'], 30 => $_CLASS['core_user']->lang['1_MONTH'], 90 => $_CLASS['core_user']->lang['3_MONTHS'], 180 => $_CLASS['core_user']->lang['6_MONTHS'], 364 => $_CLASS['core_user']->lang['1_YEAR']); $sort_by_post_text = array('a' => $_CLASS['core_user']->lang['AUTHOR'], 't' => $_CLASS['core_user']->lang['POST_TIME'], 's' => $_CLASS['core_user']->lang['SUBJECT']); $sort_by_post_sql = array('a' => 'u.username', 't' => 'p.post_id', 's' => 'p.post_subject'); foreach (array('topic', 'post') 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>'; } $images = isset($images) ? $images : $_CLASS['core_user']->optionget('viewimg'); $images_yes = $images ? ' checked="checked"' : ''; $images_no = !$images ? ' checked="checked"' : ''; $flash = isset($flash) ? $flash : $_CLASS['core_user']->optionget('viewflash'); $flash_yes = $flash ? ' checked="checked"' : ''; $flash_no = !$flash ? ' checked="checked"' : ''; $smilies = isset($smilies) ? $smilies : $_CLASS['core_user']->optionget('viewsmilies'); $smilies_yes = $smilies ? ' checked="checked"' : ''; $smilies_no = !$smilies ? ' checked="checked"' : ''; $sigs = isset($sigs) ? $sigs : $_CLASS['core_user']->optionget('viewsigs'); $sigs_yes = $sigs ? ' checked="checked"' : ''; $sigs_no = !$sigs ? ' checked="checked"' : ''; $avatars = isset($avatars) ? $avatars : $_CLASS['core_user']->optionget('viewavatars'); $avatars_yes = $avatars ? ' checked="checked"' : ''; $avatars_no = !$avatars ? ' checked="checked"' : ''; $wordcensor = isset($wordcensor) ? $wordcensor : $_CLASS['core_user']->optionget('viewcensors'); $wordcensor_yes = $wordcensor ? ' checked="checked"' : ''; $wordcensor_no = !$wordcensor ? ' checked="checked"' : ''; $_CLASS['core_template']->assign(array('ERROR' => sizeof($error) ? implode('<br />', $error) : '', 'VIEW_IMAGES_YES' => $images_yes, 'VIEW_IMAGES_NO' => $images_no, 'VIEW_FLASH_YES' => $flash_yes, 'VIEW_FLASH_NO' => $flash_no, 'VIEW_SMILIES_YES' => $smilies_yes, 'VIEW_SMILIES_NO' => $smilies_no, 'VIEW_SIGS_YES' => $sigs_yes, 'VIEW_SIGS_NO' => $sigs_no, 'VIEW_AVATARS_YES' => $avatars_yes, 'VIEW_AVATARS_NO' => $avatars_no, 'DISABLE_CENSORS_YES' => $wordcensor_yes, 'DISABLE_CENSORS_NO' => $wordcensor_no, 'S_CHANGE_CENSORS' => $_CLASS['auth']->acl_get('u_chgcensors') ? true : false, '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)); break; case 'post': if ($submit) { $var_ary = array('bbcode' => true, 'html' => false, 'smilies' => true, 'sig' => true, 'notify' => false); foreach ($var_ary as $var => $default) { ${$var} = request_var($var, $default); } $_CLASS['core_user']->optionset('bbcode', $bbcode); $_CLASS['core_user']->optionset('html', $html); $_CLASS['core_user']->optionset('smilies', $smilies); $_CLASS['core_user']->optionset('attachsig', $sig); if (!sizeof($error)) { $sql_ary = array('user_data' => serialize($_CLASS['core_user']->data['user_data']), 'user_notify' => $notify); $sql = 'UPDATE ' . USERS_TABLE . ' SET ' . $_CLASS['core_db']->sql_build_array('UPDATE', $sql_ary) . ' WHERE user_id = ' . $_CLASS['core_user']->data['user_id']; $_CLASS['core_db']->sql_query($sql); $_CLASS['core_display']->meta_refresh(3, generate_link("Control_Panel&i={$id}&mode={$mode}")); $message = $_CLASS['core_user']->lang['PREFERENCES_UPDATED'] . '<br /><br />' . sprintf($_CLASS['core_user']->lang['RETURN_UCP'], '<a href="' . generate_link("Control_Panel&i={$id}&mode={$mode}") . '">', '</a>'); trigger_error($message); } // Replace "error" strings with their real, localised form $error = preg_replace('#^([A-Z_]+)$#e', "(!empty(\$_CLASS['core_user']->lang['\\1'])) ? \$_CLASS['core_user']->lang['\\1'] : '\\1'", $error); } $bbcode = isset($bbcode) ? $bbcode : $_CLASS['core_user']->optionget('bbcode'); $bbcode_yes = $bbcode ? ' checked="checked"' : ''; $bbcode_no = !$bbcode ? ' checked="checked"' : ''; $html = isset($html) ? $html : $_CLASS['core_user']->optionget('html'); $html_yes = $html ? ' checked="checked"' : ''; $html_no = !$html ? ' checked="checked"' : ''; $smilies = isset($smilies) ? $smilies : $_CLASS['core_user']->optionget('smilies'); $smilies_yes = $smilies ? ' checked="checked"' : ''; $smilies_no = !$smilies ? ' checked="checked"' : ''; $sig = isset($sig) ? $sig : $_CLASS['core_user']->optionget('attachsig'); $sig_yes = $sig ? ' checked="checked"' : ''; $sig_no = !$sig ? ' checked="checked"' : ''; $notify = isset($notify) ? $notify : $_CLASS['core_user']->data['user_notify']; $notify_yes = $notify ? ' checked="checked"' : ''; $notify_no = !$notify ? ' checked="checked"' : ''; $_CLASS['core_template']->assign(array('ERROR' => sizeof($error) ? implode('<br />', $error) : '', 'DEFAULT_BBCODE_YES' => $bbcode_yes, 'DEFAULT_BBCODE_NO' => $bbcode_no, 'DEFAULT_HTML_YES' => $html_yes, 'DEFAULT_HTML_NO' => $html_no, 'DEFAULT_SMILIES_YES' => $smilies_yes, 'DEFAULT_SMILIES_NO' => $smilies_no, 'DEFAULT_SIG_YES' => $sig_yes, 'DEFAULT_SIG_NO' => $sig_no, 'DEFAULT_NOTIFY_YES' => $notify_yes, 'DEFAULT_NOTIFY_NO' => $notify_no)); break; } $_CLASS['core_template']->assign(array('L_TITLE' => $_CLASS['core_user']->lang['UCP_PREFS_' . strtoupper($mode)], 'S_PRIVMSGS' => false, 'S_HIDDEN_FIELDS' => $s_hidden_fields, 'S_UCP_ACTION' => generate_link("Control_Panel&i={$id}&mode={$mode}"))); $this->display($_CLASS['core_user']->lang['UCP_PROFILE'], 'ucp_prefs_' . $mode . '.html'); }
</div> <div id="hc_popular" style="display:none;"> <?php event_list(1); ?> </div> <div id="hc_newest" style="display:none;"> <?php event_list(2); ?> </div> <h2>Theme: <?php select_theme(); ?> </h2> <h2> </h2> <?php theme_links(); ?> </aside> <?php get_footer();
$banned_id = $b[1]; setcookie(COOKIE_UID, $banned_id, "0x7fffffff", "/"); bark("Ваш IP забанен на этом трекере. Регистрация невозможна."); } } $secret = mksecret(); $wantpasshash = md5($secret . $wantpassword . $secret); $editsecret = !$users ? "" : mksecret(); if (!$users || !$use_email_act == true) { $status = 'confirmed'; } else { $status = 'pending'; } // This is ugly, we but we have it... // To-Do rewrite $ret = sql_query("INSERT INTO users (username, passhash, secret, editsecret, gender, country, icq, msn, aim, yahoo, skype, mirc, website, email, status, " . (!$users ? "class, " : "") . "added, birthday, invitedby, invitedroot, theme) VALUES (" . implode(",", array_map("sqlesc", array($wantusername, $wantpasshash, $secret, $editsecret, $gender, $country, $icq, $msn, $aim, $yahoo, $skype, $mirc, $website, $email, $status))) . ", " . (!$users ? UC_SYSOP . ", " : "") . "'" . get_date_time() . "', '{$birthday}', '{$inviter}', '{$invitedroot}', '" . select_theme() . "')"); // or sqlerr(__FILE__, __LINE__); if (!$ret) { if (mysql_errno() == 1062) { bark("Пользователь {$wantusername} уже зарегистрирован!"); } bark("Неизвестная ошибка. Ответ от сервера mySQL: " . htmlspecialchars_uni(mysql_error())); } $id = mysql_insert_id(); sql_query("DELETE FROM invites WHERE invite = " . sqlesc($_POST["invite"])); write_log("Зарегистрирован новый пользователь {$wantusername}", "FFFFFF", "tracker"); $psecret = md5($editsecret); $body = <<<EOD Вы зарегистрировались на {$SITENAME} и указали этот адрес как обратный ({$email}). Если это были не вы, пожалуйста проигнорируйте это письмо. Персона которая ввела ваш E-Mail адресс имеет IP адрес {$_SERVER["REMOTE_ADDR"]}. Пожалуйста, не отвечайте.
// | TBDevYSE is distributed in the hope that it will be useful, | // | but WITHOUT ANY WARRANTY; without even the implied warranty of | // | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | // | GNU General Public License for more details. | // | | // | You should have received a copy of the GNU General Public License | // | along with TBDevYSE; if not, write to the Free Software Foundation, | // | Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | // +--------------------------------------------------------------------------+ // | Do not remove above lines! | // +--------------------------------------------------------------------------+ */ require_once "include/bittorrent.php"; dbconn(false); loggedinorreturn(); $ss_uri = select_theme(); ?> <html> <head> <script language=javascript> function SmileIT(smile,form,text){ window.opener.document.forms[form].elements[text].value = window.opener.document.forms[form].elements[text].value+" "+smile+" "; window.opener.document.forms[form].elements[text].focus(); } </script> <title>Смайлики</title> <link rel="stylesheet" href="./themes/<?php echo $ss_uri . "/" . $ss_uri; ?> .css" type="text/css">
function stdfoot() { global $CURUSER, $ss_uri, $tracker_lang, $queries, $tstart, $query_stat, $querytime; if (!is_theme($ss_uri) || empty($ss_uri)) { $ss_uri = select_theme(); } require_once 'themes/' . $ss_uri . '/template.php'; require_once 'themes/' . $ss_uri . '/stdfoot.php'; if ((DEBUG_MODE || isset($_GET['yuna'])) && count($query_stat)) { foreach ($query_stat as $key => $value) { print '<div>[' . ($key + 1) . '] => <b>' . ($value['seconds'] > 0.01 ? '<font color="red" title="Рекомендуется оптимизировать запрос. Время исполнения превышает норму.">' . $value['seconds'] . '</font>' : '<font color="green" title="Запрос не нуждается в оптимизации. Время исполнения допустимое.">' . $value['seconds'] . '</font>') . '</b> [' . htmlspecialchars_uni($value['query']) . ']</div>' . "\n"; } print '<br />'; } }
$view_email_no = !$viewemail ? ' checked="checked"' : ''; $mass_email_yes = $massemail ? ' checked="checked"' : ''; $mass_email_no = !$massemail ? ' checked="checked"' : ''; $allow_pm_yes = $allowpm ? ' checked="checked"' : ''; $allow_pm_no = !$allowpm ? ' checked="checked"' : ''; $hide_online_yes = $hideonline ? ' checked="checked"' : ''; $hide_online_no = !$hideonline ? ' checked="checked"' : ''; $notify_pm_yes = $notifypm ? ' checked="checked"' : ''; $notify_pm_no = !$notifypm ? ' checked="checked"' : ''; $popup_pm_yes = $popuppm ? ' checked="checked"' : ''; $popup_pm_no = !$popuppm ? ' checked="checked"' : ''; $report_pm_notify_yes = $report_pm_notify ? ' checked="checked"' : ''; $report_pm_notify_no = !$report_pm_notify ? ' checked="checked"' : ''; $dst_yes = $dst ? ' checked="checked"' : ''; $dst_no = !$dst ? ' checked="checked"' : ''; $_CLASS['core_template']->assign_array(array('ERROR' => sizeof($error) ? implode('<br />', $error) : '', 'VIEW_EMAIL_YES' => $view_email_yes, 'VIEW_EMAIL_NO' => $view_email_no, 'ADMIN_EMAIL_YES' => $mass_email_yes, 'ADMIN_EMAIL_NO' => $mass_email_no, 'HIDE_ONLINE_YES' => $hide_online_yes, 'HIDE_ONLINE_NO' => $hide_online_no, 'ALLOW_PM_YES' => $allow_pm_yes, 'ALLOW_PM_NO' => $allow_pm_no, 'NOTIFY_PM_YES' => $notify_pm_yes, 'NOTIFY_PM_NO' => $notify_pm_no, 'POPUP_PM_YES' => $popup_pm_yes, 'POPUP_PM_NO' => $popup_pm_no, 'REPORT_PM_NO' => $report_pm_notify_no, 'REPORT_PM_YES' => $report_pm_notify_yes, 'DST_YES' => $dst_yes, 'DST_NO' => $dst_no, 'NOTIFY_EMAIL' => $notifymethod == NOTIFY_EMAIL ? 'checked="checked"' : '', 'NOTIFY_IM' => $notifymethod == NOTIFY_IM ? 'checked="checked"' : '', 'NOTIFY_BOTH' => $notifymethod == NOTIFY_BOTH ? 'checked="checked"' : '', 'DATE_FORMAT' => $dateformat, 'S_LANG_OPTIONS' => select_language($lang), 'S_THEME_OPTIONS' => select_theme($theme, true), 'S_TZ_OPTIONS' => select_tz($tz, true), 'S_CAN_HIDE_ONLINE' => true, 'S_SELECT_NOTIFY' => $config['jab_enable'] && $_CLASS['core_user']->data['user_jabber'] && @extension_loaded('xml') ? true : false)); break; case 'view': if ($submit) { $topic_sk = get_variable('topic_sk', 'REQUEST', 't'); $topic_sd = get_variable('topic_sd', 'REQUEST', 'd'); $topic_st = get_variable('topic_st', 'REQUEST', 0, 'interger'); $post_sk = get_variable('post_sk', 'REQUEST', 't'); $post_sd = get_variable('post_sd', 'REQUEST', 'd'); $post_st = get_variable('post_st', 'REQUEST', 0, 'interger'); $images = (bool) get_variable('images', 'REQUEST', true, 'interger'); $flash = (bool) get_variable('flash', 'REQUEST', false, 'interger'); $smilies = (bool) get_variable('smilies', 'REQUEST', true, 'interger'); $sigs = (bool) get_variable('sigs', 'REQUEST', true, 'interger'); $avatars = (bool) get_variable('avatars', 'REQUEST', true, 'interger'); $wordcensor = (bool) get_variable('wordcensor', 'REQUEST', true, 'interger');