本文整理汇总了PHP中request_post_var函数的典型用法代码示例。如果您正苦于以下问题:PHP request_post_var函数的具体用法?PHP request_post_var怎么用?PHP request_post_var使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了request_post_var函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: main
function main($action)
{
global $template, $lang, $config, $pafiledb_config, $db, $user, $pafiledb_functions, $pafiledb_user;
$file_id = request_var('file_id', 0);
if (empty($file_id)) {
message_die(GENERAL_MESSAGE, $lang['File_not_exist']);
}
$rating = request_post_var('rating', 0);
$sql = 'SELECT file_name, file_catid
FROM ' . PA_FILES_TABLE . "\n\t\t\tWHERE file_id = {$file_id}";
$result = $db->sql_query($sql);
if (!($file_data = $db->sql_fetchrow($result))) {
message_die(GENERAL_MESSAGE, $lang['File_not_exist']);
}
$db->sql_freeresult($result);
if (!$this->auth[$file_data['file_catid']]['auth_rate']) {
if (!$user->data['session_logged_in']) {
redirect(append_sid(CMS_PAGE_LOGIN . '?redirect=dload.' . PHP_EXT . '&action=rate&file_id=' . $file_id, true));
}
$message = sprintf($lang['Sorry_auth_rate'], $this->auth[$file_data['file_catid']]['auth_rate_type']);
message_die(GENERAL_MESSAGE, $message);
}
$this->generate_category_nav($file_data['file_catid']);
$template->assign_vars(array('L_INDEX' => sprintf($lang['Forum_Index'], $config['sitename']), 'L_RATE' => $lang['Rate'], 'L_HOME' => $lang['Home'], 'CURRENT_TIME' => sprintf($lang['Current_time'], create_date($config['default_dateformat'], time(), $config['board_timezone'])), 'U_INDEX_HOME' => append_sid(CMS_PAGE_HOME), 'U_DOWNLOAD_HOME' => append_sid('dload.' . PHP_EXT), 'U_FILE_NAME' => append_sid('dload.' . PHP_EXT . '?action=file&file_id=' . $file_id), 'FILE_NAME' => $file_data['file_name'], 'DOWNLOAD' => $pafiledb_config['settings_dbname']));
if (isset($_POST['submit'])) {
$result_msg = str_replace("{filename}", $file_data['file_name'], $lang['Rconf']);
$result_msg = str_replace("{rate}", $rating, $result_msg);
if ($rating <= 0 or $rating > 10) {
message_die(GENERAL_ERROR, 'Bad submited value');
}
$pafiledb_user->update_voter_info($file_id, $rating);
$rate_info = $pafiledb_functions->get_rating($file_id);
$result_msg = str_replace("{newrating}", $rate_info, $result_msg);
$message = $result_msg . '<br /><br />' . sprintf($lang['Click_return'], '<a href="' . append_sid('dload.' . PHP_EXT . '?action=file&file_id=' . $file_id) . '">', '</a>') . '<br /><br />' . sprintf($lang['Click_return_forum'], '<a href="' . append_sid('index.' . PHP_EXT) . '">', '</a>');
message_die(GENERAL_MESSAGE, $message);
} else {
$rate_info = str_replace("{filename}", $file_data['file_name'], $lang['Rateinfo']);
$template->assign_vars(array('S_RATE_ACTION' => append_sid('dload.' . PHP_EXT . '?action=rate&file_id=' . $file_id), 'L_RATE' => $lang['Rate'], 'L_RERROR' => $lang['Rerror'], 'L_R1' => $lang['R1'], 'L_R2' => $lang['R2'], 'L_R3' => $lang['R3'], 'L_R4' => $lang['R4'], 'L_R5' => $lang['R5'], 'L_R6' => $lang['R6'], 'L_R7' => $lang['R7'], 'L_R8' => $lang['R8'], 'L_R9' => $lang['R9'], 'L_R10' => $lang['R10'], 'RATEINFO' => $rate_info, 'ID' => $file_id));
}
$this->display($lang['Download'], 'pa_rate_body.tpl');
}
示例2: check_code
function check_code()
{
global $db, $cache, $config, $user, $lang;
$return_array = array('error' => false, 'error_msg' => '');
$confirm_id = request_post_var('confirm_id', '');
$confirm_code = request_post_var('confirm_code', '');
if (empty($confirm_id)) {
$return_array['error'] = true;
$return_array['error_msg'] = $lang['CONFIRM_CODE_WRONG'];
} else {
if (!preg_match('/^[A-Za-z0-9]+$/', $confirm_id)) {
$confirm_id = '';
}
$sql = "SELECT code\n\t\t\t\tFROM " . CONFIRM_TABLE . "\n\t\t\t\tWHERE confirm_id = '" . $db->sql_escape($confirm_id) . "'\n\t\t\t\t\tAND session_id = '" . $db->sql_escape($user->data['session_id']) . "'";
$result = $db->sql_query($sql);
if ($row = $db->sql_fetchrow($result)) {
if ($row['code'] != $confirm_code) {
$return_array['error'] = true;
$return_array['error_msg'] = $lang['CONFIRM_CODE_WRONG'];
} else {
// Maybe better reset the whole session_id and not only the confirmation code...
/*
$sql = "DELETE FROM " . CONFIRM_TABLE . "
WHERE confirm_id = '" . $db->sql_escape($confirm_id) . "'
AND session_id = '" . $db->sql_escape($user->data['session_id']) . "'";
*/
$sql = "DELETE FROM " . CONFIRM_TABLE . " WHERE session_id = '" . $db->sql_escape($user->data['session_id']) . "'";
$result = $db->sql_query($sql);
}
} else {
$return_array['error'] = true;
$return_array['error_msg'] = $lang['CONFIRM_CODE_WRONG'];
}
$db->sql_freeresult($result);
}
if ($return_array['error']) {
$this->check_attempts(false);
}
return $return_array;
}
示例3: gmmktime
$news_date_posting = gmmktime(gmdate('H'), gmdate('i'), gmdate('s'), $date_month, $date_day, $date_split[2]);
$sql = "SELECT MAX(news_id) AS max_id\n\t\t\t\tFROM " . XS_NEWS_TABLE;
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
$max_id = $row['max_id'];
$next_id = $max_id + 1;
$sql = "INSERT INTO " . XS_NEWS_TABLE . " (news_id, news_date, news_text, news_display, news_smilies" . ")\n\t\t\t\tVALUES ('" . $next_id . "', '" . $news_date_posting . "', '" . $db->sql_escape($news_item) . "', '" . intval($_POST['news_display']) . "', '" . intval($_POST['news_smilies']) . "')";
$result = $db->sql_query($sql);
$db->clear_cache('xs_');
$message = $lang['n_news_item_added'] . '<br /><br />' . sprintf($lang['n_click_return_newslist'], '<a href="' . append_sid('admin_xs_news.' . PHP_EXT) . '">', '</a>') . '<br /><br />' . sprintf($lang['Click_return_admin_index'], '<a href="' . append_sid('index.' . PHP_EXT . '?pane=right') . '">', '</a>');
message_die(GENERAL_MESSAGE, $message);
break;
case 'modnews':
// Modify a news item in the DB
$news_item = xsm_prepare_message($news_text);
$news_date = request_post_var('news_date', '');
$news_date = empty($news_date) ? create_date($date_format_ae, time(), $config['board_timezone']) : $news_date;
$date_split = explode('/', $news_date);
$date_month = $config['xs_news_dateformat'] == 1 ? $date_split[0] : $date_split[1];
$date_day = $config['xs_news_dateformat'] == 1 ? $date_split[1] : $date_split[0];
$date_error = $config['xs_news_dateformat'] == 1 ? 'mm/dd' : 'dd/mm';
if (!checkdate($date_month, $date_day, $date_split[2])) {
$message = str_replace('dd/mm', $date_error, $lang['xs_news_invalid_date']) . '<br /><br />' . sprintf($lang['n_click_return_newslist'], '<a href="' . append_sid('admin_xs_news.' . PHP_EXT) . '">', '</a>') . '<br /><br />' . sprintf($lang['Click_return_admin_index'], '<a href="' . append_sid('index.' . PHP_EXT . '?pane=right') . '">', '</a>');
message_die(GENERAL_MESSAGE, $message);
}
$news_date_posting = gmmktime(gmdate('H'), gmdate('i'), gmdate('s'), $date_month, $date_day, $date_split[2]);
$sql = "UPDATE " . XS_NEWS_TABLE . "\n\t\t\t\tSET news_date = " . $news_date_posting . ", news_text = '" . $db->sql_escape($news_item) . "', news_display = " . intval($_POST['news_display']) . ", news_smilies = " . intval($_POST['news_smilies']) . "\n\t\t\t\tWHERE news_id = " . intval($_POST['id']);
$result = $db->sql_query($sql);
$db->clear_cache('xs_');
$message = $lang['n_news_updated'] . '<br /><br />' . sprintf($lang['n_click_return_newslist'], '<a href="' . append_sid('admin_xs_news.' . PHP_EXT) . '">', '</a>') . '<br /><br />' . sprintf($lang['Click_return_admin_index'], '<a href="' . append_sid('index.' . PHP_EXT . '?pane=right') . '">', '</a>');
message_die(GENERAL_MESSAGE, $message);
示例4: array
}
// Update the Cash Table
$sql[] = "UPDATE " . CASH_TABLE . "\n\t\t\t\t\t\tSET cash_name = '" . $db->sql_escape($newname) . "', cash_default = '" . $newdefault . "', cash_decimals = '" . $newdecimal . "'\n\t\t\t\t\t\tWHERE cash_id = " . $c_cur->id();
for ($i = 0; $i < sizeof($sql); $i++) {
$db->sql_query($sql[$i]);
}
// Log the action
// [admin/mod id][admin/mod name][copied currency name][copied over currency name]
$action = array($user->data['user_id'], $user->data['username'], $c_cur->name(true), $newname);
cash_create_log(CASH_LOG_ADMIN_RENAME_CURRENCY, $action);
$db->clear_cache('cash_');
}
break;
case 'deletecurrency':
// Delete Currency
$cid = request_post_var('cid', 0);
if (!empty($cid) && !isset($_POST['cancel']) && $cash->currency_exists($cid)) {
$c_cur = $cash->currency($cid);
if (!isset($_POST['confirm'])) {
$s_hidden_fields = '<input type="hidden" name="set" value="deletecurrency" />';
$s_hidden_fields .= '<input type="hidden" name="cid" value="' . $c_cur->id() . '" />';
$l_confirm = sprintf($lang['Cash_confirm_delete'], $c_cur->name(true));
$template->set_filenames(array('confirm_body' => ADM_TPL . 'confirm_body.tpl'));
$template->assign_vars(array('MESSAGE_TITLE' => $lang['Information'], 'MESSAGE_TEXT' => $l_confirm, 'L_YES' => $lang['Yes'], 'L_NO' => $lang['No'], 'S_CONFIRM_ACTION' => append_sid('cash_currencies.' . PHP_EXT), 'S_HIDDEN_FIELDS' => $s_hidden_fields));
$template->pparse('confirm_body');
include 'page_footer_admin.' . PHP_EXT;
} else {
// Delete the field
$sql = array();
$sql[] = "ALTER TABLE " . USERS_TABLE . " DROP " . $c_cur->db();
for ($i = 0; $i < sizeof($sql); $i++) {
示例5: check_authorization
function check_authorization($die = true)
{
global $db, $cache, $lang, $dbuser, $dbpasswd, $option;
$auth_method = request_post_var('auth_method', '');
$board_user = request_post_var('board_user', '', true);
$board_user = htmlspecialchars_decode($board_user, ENT_COMPAT);
$board_password = request_post_var('board_password', '', true);
$board_password = htmlspecialchars_decode($board_password, ENT_COMPAT);
$db_user = request_post_var('db_user', '', true);
$db_user = htmlspecialchars_decode($db_user, ENT_COMPAT);
$db_password = request_post_var('db_password', '', true);
$db_password = htmlspecialchars_decode($db_password, ENT_COMPAT);
// Change authentication mode if selected option does not allow database authentication
if ($option == 'rld' || $option == 'rtd') {
$auth_method = 'board';
}
switch ($auth_method) {
case 'board':
include_once IP_ROOT_PATH . 'includes/auth_db.' . PHP_EXT;
$login_result = login_db($board_user, $board_password, false, true);
$allow_access = false;
if ($login_result['status'] === LOGIN_SUCCESS && $login_result['user_row']['user_level'] == ADMIN) {
$allow_access = true;
}
break;
case 'db':
if ($db_user == $dbuser && $db_password == $dbpasswd) {
$allow_access = true;
} else {
$allow_access = false;
}
break;
default:
$allow_access = false;
}
if (!$allow_access && $die) {
?>
<p><span style="color: red;"><?php
echo $lang['Auth_failed'];
?>
</span></p>
</body>
</html>
<?php
exit;
}
return $allow_access;
}
示例6: request_var
$mode = request_var('mode', '');
$mode = check_var_value($mode, array('pack', 'key'), '');
$level = request_var('level', 'normal');
$level = check_var_value($level, array('normal', 'admin'));
// pack file
$pack_file = request_post_var('pack_file', '');
$pack_file = empty($pack_file) ? request_get_var('pack', '') : $pack_file;
$pack_file = urldecode($pack_file);
if (!isset($packs[$pack_file])) {
$pack_file = '';
$mode = '';
}
// keys
$key_main = request_post_var('key_main', '');
$key_main = empty($key_main) ? request_get_var('key', '') : $key_main;
$key_sub = request_post_var('key_sub', '');
$key_sub = empty($key_sub) ? request_get_var('sub', '') : $key_sub;
if (empty($key_main)) {
$key_sub = '';
}
if (!isset($entries['admin'][$key_main][$key_sub])) {
$key_main = '';
$key_sub = '';
}
// buttons
$submit = isset($_POST['submit']);
$delete = isset($_POST['delete']);
$cancel = isset($_POST['cancel']);
$add = isset($_POST['add']);
if ($add || $delete) {
$mode = 'key';
示例7: request_post_var
// Check and initialize some variables if needed
if (isset($_POST['submit'])) {
include_once IP_ROOT_PATH . 'includes/bbcode.' . PHP_EXT;
include_once IP_ROOT_PATH . 'includes/functions_validate.' . PHP_EXT;
include_once IP_ROOT_PATH . 'includes/functions_post.' . PHP_EXT;
$username = request_post_var('username', '', true);
$username = htmlspecialchars_decode($username, ENT_COMPAT);
$new_password = request_post_var('new_password', '', true);
$new_password = htmlspecialchars_decode($new_password, ENT_COMPAT);
$password_confirm = request_post_var('password_confirm', '', true);
$password_confirm = htmlspecialchars_decode($password_confirm, ENT_COMPAT);
$email = request_post_var('email', '', true);
$user_style = request_post_var('style', $config['default_style']);
$user_lang = request_post_var('language', $config['default_lang']);
$user_timezone = request_post_var('timezone', $config['board_timezone']);
$user_dateformat = request_post_var('dateformat', $config['default_dateformat']);
}
if (!empty($username) && $username == $user->data['username']) {
message_die(GENERAL_MESSAGE, $lang['Username_taken'], '', __LINE__, __FILE__);
}
// Did the user submit? In this case build a query to update the users profile in the DB
if (isset($_POST['submit'])) {
$passwd_sql = '';
if (empty($username) || empty($new_password) || empty($password_confirm) || empty($email)) {
$error = true;
$error_msg .= (isset($error_msg) ? '<br />' : '') . $lang['Fields_empty'];
} elseif (empty($new_password) && !empty($password_confirm) || !empty($new_password) && empty($password_confirm) || $new_password != $password_confirm) {
$error = true;
$error_msg .= (isset($error_msg) ? '<br />' : '') . $lang['Password_mismatch'];
}
// Do a ban check on this email address
示例8: define
*/
define('IN_ICYPHOENIX', true);
if (!empty($setmodules)) {
$filename = basename(__FILE__);
$module['1200_Forums']['240_Replace_title'] = $filename;
return;
}
if (!defined('IP_ROOT_PATH')) {
define('IP_ROOT_PATH', './../');
}
if (!defined('PHP_EXT')) {
define('PHP_EXT', substr(strrchr(__FILE__, '.'), 1));
}
require 'pagestart.' . PHP_EXT;
$str_old = request_post_var('str_old', '', true);
$str_new = request_post_var('str_new', '', true);
if ($_POST['submit'] && !empty($str_old) && $str_old != $str_new) {
$template->assign_block_vars("switch_forum_sent", array());
$sql = "SELECT f.forum_id, f.forum_name, t.topic_id, t.topic_title, p.post_id, p.post_time, p.post_text, u.user_id, u.username\n\t\tFROM " . FORUMS_TABLE . " f, " . TOPICS_TABLE . " t, " . POSTS_TABLE . " p, " . USERS_TABLE . " u\n\t\tWHERE post_text LIKE '%" . $db->sql_escape($str_old) . "%'\n\t\tAND p.topic_id = t.topic_id\n\t\tAND p.forum_id = f.forum_id\n\t\tAND p.poster_id = u.user_id\n\t\tORDER BY p.post_id DESC;";
$result = $db->sql_query($sql);
if ($db->sql_numrows($result) >= 1) {
for ($i = 1; $row = $db->sql_fetchrow($result); $i++) {
$template->assign_block_vars('switch_forum_sent.replaced', array('ROW_CLASS' => !($i % 2) ? $theme['td_class1'] : $theme['td_class2'], 'NUMBER' => $i, 'FORUM_NAME' => $row['forum_name'], 'TOPIC_TITLE' => $row['topic_title'], 'AUTHOR' => $row['username'], 'POST' => create_date($config['default_dateformat'], $row['post_time'], $config['board_timezone']), 'U_FORUM' => append_sid('../' . CMS_PAGE_VIEWFORUM . '?' . POST_FORUM_URL . '=' . $row['forum_id']), 'U_TOPIC' => append_sid('../' . CMS_PAGE_VIEWTOPIC . '?' . POST_TOPIC_URL . '=' . $row['topic_id']), 'U_AUTHOR' => append_sid('../' . CMS_PAGE_PROFILE . '?mode=viewprofile&' . POST_USERS_URL . '=' . $row['user_id']), 'U_POST' => append_sid('../' . CMS_PAGE_VIEWTOPIC . '?' . POST_POST_URL . '=' . $row['post_id']) . '#p' . $row['post_id']));
$sql = "UPDATE " . POSTS_TABLE . "\n\t\t\t\tSET post_text = '" . $db->sql_escape(str_replace($str_old, $str_new, $row['post_text'])) . "'\n\t\t\t\tWHERE post_id = " . $row['post_id'];
$result = $db->sql_query($sql);
}
} else {
$template->assign_block_vars('switch_forum_sent.switch_no_results', array());
}
}
$template->set_filenames(array('body' => ADM_TPL . 'replace_body.tpl'));
示例9: define
}
// Load default Header
if (!defined('IP_ROOT_PATH')) {
define('IP_ROOT_PATH', './../');
}
if (!defined('PHP_EXT')) {
define('PHP_EXT', substr(strrchr(__FILE__, '.'), 1));
}
require 'pagestart.' . PHP_EXT;
include_once IP_ROOT_PATH . 'includes/functions_selects.' . PHP_EXT;
// Pull all config data
$tmp_config = array();
$tmp_config = get_config(false);
foreach ($tmp_config as $k => $v) {
$default_config[$k] = $v;
$tmp_value = request_post_var($k, '', true);
$new[$k] = isset($_POST[$k]) ? $tmp_value : $default_config[$k];
$new[$k] = fix_config_values($k, $new[$k]);
if (isset($_POST['submit']) && isset($_POST[$k])) {
set_config($k, $new[$k], false);
}
}
if (isset($_POST['submit'])) {
$cache->destroy('config');
$message = $lang['Config_updated'] . '<br /><br />' . sprintf($lang['Click_return_config'], '<a href="' . append_sid('admin_board.' . PHP_EXT) . '">', '</a>') . '<br /><br />' . sprintf($lang['Click_return_admin_index'], '<a href="' . append_sid('index.' . PHP_EXT . '?pane=right') . '">', '</a>');
message_die(GENERAL_MESSAGE, $message);
}
$switch_header_table_yes = $new['switch_header_table'] ? 'checked="checked"' : '';
$switch_header_table_no = !$new['switch_header_table'] ? 'checked="checked"' : '';
// Ajax Shoutbox - BEGIN
$shoutguest_yes = $new['shout_allow_guest'] == 1 ? 'checked="checked"' : '';
示例10: request_post_var
$upi2db_on_2 = $new['upi2db_on'] == 2 ? 'checked="checked"' : '';
$no_group_upi2db_on_yes = $new['upi2db_no_group_upi2db_on'] ? 'checked="checked"' : '';
$no_group_upi2db_on_no = !$new['upi2db_no_group_upi2db_on'] ? 'checked="checked"' : '';
$edit_as_new_yes = $new['upi2db_edit_as_new'] ? 'checked="checked"' : '';
$edit_as_new_no = !$new['upi2db_edit_as_new'] ? 'checked="checked"' : '';
$last_edit_as_new_yes = $new['upi2db_last_edit_as_new'] ? 'checked="checked"' : '';
$last_edit_as_new_no = !$new['upi2db_last_edit_as_new'] ? 'checked="checked"' : '';
$edit_topic_first_yes = $new['upi2db_edit_topic_first'] ? 'checked="checked"' : '';
$edit_topic_first_no = !$new['upi2db_edit_topic_first'] ? 'checked="checked"' : '';
$template->set_filenames(array('body' => ADM_TPL . 'upi2db_config_body.tpl'));
$sql = "SELECT *\n\tFROM " . GROUPS_TABLE . "\n\tWHERE group_single_user <> " . TRUE;
$result = $db->sql_query($sql);
if (isset($_POST['submit'])) {
$group_upi2db_on = request_post_var('group_upi2db_on', array(0));
$group_min_posts = request_post_var('group_min_posts', array(0));
$group_min_regdays = request_post_var('group_min_regdays', array(0));
while ($row = $db->sql_fetchrow($result)) {
$sql = "UPDATE " . GROUPS_TABLE . "\n\t\t\tSET upi2db_on = " . $group_upi2db_on[$row['group_id']] . " ,\n\t\t\tupi2db_min_posts = " . $group_min_posts[$row['group_id']] . ",\n\t\t\tupi2db_min_regdays = " . $group_min_regdays[$row['group_id']] . "\n\t\t\tWHERE group_id = " . $row['group_id'];
$db->sql_query($sql);
}
}
while ($row = $db->sql_fetchrow($result)) {
$group_upi2db_on_yes = $row['upi2db_on'] ? 'checked="checked"' : '';
$group_upi2db_on_no = !$row['upi2db_on'] ? 'checked="checked"' : '';
$upi2db_min_posts = empty($row['upi2db_min_posts']) ? 0 : $row['upi2db_min_posts'];
$upi2db_min_regdays = empty($row['upi2db_min_regdays']) ? 0 : $row['upi2db_min_regdays'];
$template->assign_block_vars('group_loop', array('GROUP_ID' => $row['group_id'], 'GROUP_NAME' => $row['group_name'], 'GROUP_MIN_POSTS' => $upi2db_min_posts, 'GROUP_MIN_REGDAYS' => $upi2db_min_regdays, 'GROUP_UPI2DB_ON_YES' => $group_upi2db_on_yes, 'GROUP_UPI2DB_ON_NO' => $group_upi2db_on_no));
}
if (isset($_POST['submit'])) {
$message = $lang['Config_updated'] . '<br /><br />' . sprintf($lang['Click_return_config'], '<a href="' . append_sid('admin_upi2db.' . PHP_EXT) . '">', '</a>') . '<br /><br />' . sprintf($lang['Click_return_admin_index'], '<a href="' . append_sid('index.' . PHP_EXT . '?pane=right') . '">', '</a>');
message_die(GENERAL_MESSAGE, $message);
示例11: update_block_config
function update_block_config($blockfile)
{
global $db;
$block_vars_default = array();
$block_count_variables = 0;
if (!empty($blockfile)) {
$block_vars_default = $this->get_block_vars_default($blockfile);
$block_count_variables = sizeof($block_vars_default);
$block_vars_default_names = array();
for ($i = 0; $i < $block_count_variables; $i++) {
$block_vars_default_names[$block_vars_default[$i]['config_name']] = $i;
}
}
if (!empty($block_vars_default)) {
// Let's empty the previously created config vars...
$sql = "SELECT * FROM " . $this->tables['block_config_table'] . " WHERE bid = '" . $this->bs_id . "'";
$result = $db->sql_query($sql);
while ($row = $db->sql_fetchrow($result)) {
$delete_var = in_array($row['config_name'], $block_vars_default_names) ? false : true;
if (!empty($delete_var)) {
$this->delete_block_config_single($row['config_name']);
}
}
$db->sql_freeresult($result);
for ($i = 0; $i < $block_count_variables; $i++) {
$config_value_tmp = request_post_var($block_vars_default[$i]['config_name'], '', true);
$config_value_tmp = htmlspecialchars_decode($config_value_tmp, ENT_COMPAT);
if (check_http_var_exists($block_vars_default[$i]['config_name'], true)) {
$block_vars_default[$i]['config_value'] = $config_value_tmp;
}
$block_var_exists = $this->block_var_exists($block_vars_default[$i]['config_name']);
if (empty($block_var_exists)) {
$sql = "INSERT INTO " . $this->tables['block_variable_table'] . " (bid, label, sub_label, config_name, field_options, field_values, type, block)\n\t\t\t\t\t\tVALUES ('" . $this->bs_id . "', '" . $db->sql_escape($block_vars_default[$i]['label']) . "', '" . $db->sql_escape($block_vars_default[$i]['sub_label']) . "', '" . $db->sql_escape($block_vars_default[$i]['config_name']) . "', '" . $db->sql_escape($block_vars_default[$i]['field_options']) . "', '" . $block_vars_default[$i]['field_values'] . "', '" . $block_vars_default[$i]['type'] . "', '" . $db->sql_escape($block_vars_default[$i]['block']) . "')";
$result = $db->sql_query($sql);
$sql = "INSERT INTO " . $this->tables['block_config_table'] . " (bid, config_name, config_value)\n\t\t\t\t\t\tVALUES ('" . $this->bs_id . "', '" . $db->sql_escape($block_vars_default[$i]['config_name']) . "', '" . $db->sql_escape($block_vars_default[$i]['config_value']) . "')";
$result = $db->sql_query($sql);
} else {
$sql = "UPDATE " . $this->tables['block_config_table'] . " SET config_value = '" . $db->sql_escape($block_vars_default[$i]['config_value']) . "'\n\t\t\t\t\t\t\t\t\tWHERE config_name = '" . $db->sql_escape($block_vars_default[$i]['config_name']) . "'\n\t\t\t\t\t\t\t\t\t\tAND bid = " . $this->bs_id;
$result = $db->sql_query($sql);
}
}
} else {
$this->delete_block_config_all();
}
return true;
}
示例12: request_post_var
// encoding match for workaround
$multibyte_charset = 'utf-8, big5, shift_jis, euc-kr, gb2312';
// Begin core code
if (($search_mode == 'bookmarks') && !$user->data['session_logged_in'])
{
redirect(append_sid(CMS_PAGE_LOGIN . '?redirect=' . CMS_PAGE_SEARCH . '?search_id=bookmarks&search_mode=bookmarks', true));
}
if (($search_mode == 'bookmarks') && ($mode == 'removebm'))
{
// Delete Bookmarks
$delete = (isset($_POST['delete'])) ? true : false;
if ($delete && isset($_POST['topic_id_list']))
{
$topics = request_post_var('topic_id_list', array(0));
$topic_list = implode(',', $topics);
if ($user->data['session_logged_in'])
{
remove_bookmark($topic_list);
redirect(append_sid(CMS_PAGE_SEARCH . '?search_id=bookmarks&search_mode=bookmarks' . (!empty($start) ? ('&start=' . $start) : ''), true));
}
}
// Reset settings
$mode = '';
}
if ($mode == 'searchuser')
{
// This handles the simple windowed user search functions called from various other scripts
$search_username = request_var('search_username', '', true);
示例13: include
if (!defined('PHP_EXT')) define('PHP_EXT', substr(strrchr(__FILE__, '.'), 1));
include(IP_ROOT_PATH . 'common.' . PHP_EXT);
// Start session management
$user->session_begin();
$auth->acl($user->data);
$user->setup();
// End session management
setup_extra_lang(array('lang_rate'));
include_once(IP_ROOT_PATH . 'includes/functions_rate.' . PHP_EXT);
$rate_mode = request_var('rate_mode', '');
$forum_top = request_var('forum_top', '');
$topic_id = request_var('topic_id', 0);
$rating = request_post_var('rating', 0);
// Page Titles if Specific!
$meta_content['description'] = '';
$meta_content['keywords'] = '';
switch($rate_mode)
{
case 'rate':
$meta_content['page_title'] = $lang['Rating'];
case 'rerate':
$redirect_url = append_sid(CMS_PAGE_VIEWTOPIC . '?' . POST_TOPIC_URL . '=' . $topic_id);
meta_refresh(3, $redirect_url);
break;
case 'detailed':
if ($topic_id == '')
示例14: define
}
if (!defined('PHP_EXT')) {
define('PHP_EXT', substr(strrchr(__FILE__, '.'), 1));
}
require 'pagestart.' . PHP_EXT;
define('IN_PA_CONFIG_ADMIN', 1);
include IP_ROOT_PATH . 'includes/pafiledb_common.' . PHP_EXT;
$submit = isset($_POST['submit']) ? true : false;
$size = request_var('max_size', '');
$sql = 'SELECT * FROM ' . PA_CONFIG_TABLE;
$result = $db->sql_query($sql);
while ($row = $db->sql_fetchrow($result)) {
$config_name = $row['config_name'];
$config_value = $row['config_value'];
$default_config[$config_name] = $config_value;
$new[$config_name] = isset($_POST[$config_name]) ? request_post_var($config_name, '') : $default_config[$config_name];
if (empty($size) && !$submit && $config_name == 'max_file_size') {
$size = intval($default_config[$config_name]) >= 1048576 ? 'mb' : (intval($default_config[$config_name]) >= 1024 ? 'kb' : 'b');
}
if (!$submit && $config_name == 'max_file_size') {
if ($new[$config_name] >= 1048576) {
$new[$config_name] = round($new[$config_name] / 1048576 * 100) / 100;
} else {
if ($new[$config_name] >= 1024) {
$new[$config_name] = round($new[$config_name] / 1024 * 100) / 100;
}
}
}
if ($submit) {
if ($config_name == 'max_file_size') {
$new[$config_name] = $size == 'kb' ? round($new[$config_name] * 1024) : ($size == 'mb' ? round($new[$config_name] * 1048576) : $new[$config_name]);
示例15: die
*
* @Extra credits for this file
* ycl6 (damian at phpbb dot cc)
*
*/
if (!defined('IN_ICYPHOENIX')) {
die('Hacking attempt');
exit;
}
if (intval($config['require_activation']) == USER_ACTIVATION_ADMIN) {
message_die(GENERAL_ERROR, 'Invalid_activation');
}
if (isset($_POST['submit'])) {
$username = phpbb_clean_username(request_post_var('username', '', true));
$username = htmlspecialchars_decode($username, ENT_COMPAT);
$email = request_post_var('email', '');
$sql = "SELECT user_id, user_email, user_active, user_actkey, user_lang, user_last_login_attempt\n\t\tFROM " . USERS_TABLE . "\n\t\tWHERE username_clean = '" . $db->sql_escape(utf8_clean_string($username)) . "'";
$result = $db->sql_query($sql);
if (!($row = $db->sql_fetchrow($result))) {
// No such name
message_die(GENERAL_ERROR, 'User_not_exist');
}
if ($row['user_email'] != $email) {
// Wrong Email provided
message_die(GENERAL_ERROR, 'No_email_match');
}
if (!empty($row['user_active'])) {
// Already activated
message_die(GENERAL_ERROR, 'Already_activated');
}
if (empty($row['user_actkey'])) {