本文整理汇总了PHP中Main::db_rows方法的典型用法代码示例。如果您正苦于以下问题:PHP Main::db_rows方法的具体用法?PHP Main::db_rows怎么用?PHP Main::db_rows使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Main
的用法示例。
在下文中一共展示了Main::db_rows方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: elseif
} elseif (isset($_GET['pass_recover']) && $GLOBALS['CONFIG_RECOVER_PASS']) {
$template_location[] = 'pass_recover.html';
$template_vars['val_mail'] = isset($_POST['recover_mail']) ? $_POST['recover_mail'] : '';
if (isset($_POST['recover_mail']) && isset($_POST['recover_submit']) && $acc->validate_email($_POST['recover_mail'])) {
$recover_mail = htmlspecialchars($_POST['recover_mail']);
if ($this->server_type == 1) {
$query = Main::db_query(sprintf($GLOBALS['DBQUERY_1_1'], $GLOBALS['DBSTRUCT_L2OFF_SSN_NAME'], $GLOBALS['DBSTRUCT_L2OFF_SSN_TABLE'], $GLOBALS['DBSTRUCT_L2OFF_SSN_EMAIL'], Main::db_escape_string($recover_mail, $GLOBALS['DB_LOGIN_SERVER'])), $GLOBALS['DB_LOGIN_SERVER']);
} else {
$query = Main::db_query(sprintf($GLOBALS['DBQUERY_1_1'], $GLOBALS['DBSTRUCT_L2J_ACCOUNTS_NAME'], $GLOBALS['DBSTRUCT_L2J_ACCOUNTS_TABLE'], $GLOBALS['DBSTRUCT_L2J_ACCOUNTS_MAIL'], Main::db_escape_string($recover_mail, $GLOBALS['DB_LOGIN_SERVER'])), $GLOBALS['DB_LOGIN_SERVER']);
}
if (Main::db_rows($query) == 1) {
$recover_account = Main::db_result($query, 0);
if (Account::recover_check($recover_account)) {
$query = Main::db_query(sprintf($GLOBALS['DBQUERY_CHECK_ACCOUNT'], 'mail_check', 'user', Main::db_escape_string($recover_account, $GLOBALS['DB_LOGIN_SERVER'])), $GLOBALS['DB_LOGIN_SERVER']);
$query2 = Main::db_query(sprintf($GLOBALS['DBQUERY_CHECK_EMAIL'], 'mail_check', 'email', Main::db_escape_string($recover_mail, $GLOBALS['DB_LOGIN_SERVER'])), $GLOBALS['DB_LOGIN_SERVER']);
if (Main::db_rows($query) == 0 && Main::db_rows($query2) == 0) {
$mail = new Mail();
$recover_flood = new AFlood('recover');
if (!$recover_flood->check()) {
$GLOBALS['the_status'] = $GLOBALS['LANG_ERROR_RECOVER_TIME'];
} else {
$recover_id = substr(sha1(base64_encode(rand(10, 999))), 1, 15);
$recover_page = $GLOBALS['CONFIG_WEBSITE_URL'] . '/index.php?page=recover&uname=' . $recover_account;
$recover_link = $recover_page . '&rid=' . $recover_id;
$generated_pass = substr(sha1(base64_encode(rand(10, 999))), 1, 8);
Main::db_query(sprintf($GLOBALS['DBQUERY_MCHECK_CREATE'], Main::db_escape_string($recover_account, $GLOBALS['DB_LOGIN_SERVER']), Main::db_escape_string($recover_mail, $GLOBALS['DB_LOGIN_SERVER']), $generated_pass, Main::db_escape_string(USER_IP, $GLOBALS['DB_LOGIN_SERVER']), $recover_id, time(), null), $GLOBALS['DB_LOGIN_SERVER']);
$mail->Send($recover_mail, $GLOBALS['CONFIG_ADMIN_MAIL'], sprintf($GLOBALS['LANG_RECOVER_MAIL_SUBJECT'], $GLOBALS['CONFIG_WEBSITE_NAME']), sprintf($GLOBALS['LANG_RECOVER_MAIL'], $recover_account, $recover_link, $recover_id, $recover_page, $GLOBALS['CONFIG_WEBSITE_NAME']));
$GLOBALS['the_status'] = sprintf($GLOBALS['LANG_RECOVER_ACTIVATE'], $recover_mail);
}
} else {
$GLOBALS['the_status'] = $GLOBALS['LANG_ERROR_MAIL'];
示例2: imagettftext
imagettftext($the_image, $size, 0, $x, $y, $alpha_color, $font, $text);
}
if (isset($_GET['char']) && $GLOBALS['CONFIG_STATS_PLAYER_SIGNATURE_ENABLED'] && ($GLOBALS['CONFIG_STATS_PLAYER_SIGNATURE_GUESTS'] || $this->logged)) {
$char_name = htmlspecialchars(trim($_GET['char']));
$image_cache = sep_path(CMS_DIR . '/cache/player_' . $char_name . '.png');
if (file_exists($image_cache) && time() - filemtime($image_cache) < $GLOBALS['CONFIG_STATS_PLAYER_SIGNATURE_CACHE']) {
header('Content-type: image/png');
imagecreatefrompng($image_cache);
imagepng(imagecreatefrompng($image_cache));
} else {
if ($GLOBALS['CONFIG_SERVER_TYPE'] == 1) {
$query = Main::db_query(sprintf($GLOBALS['DBQUERY_CHECK_STATS_ACCESS'], $GLOBALS['DBSTRUCT_L2OFF_USERDAT_TABLE'], $GLOBALS['DBSTRUCT_L2OFF_USERDAT_NAME'], Main::db_escape_string($char_name, $GLOBALS['DB_GAME_SERVER']), $GLOBALS['DBSTRUCT_L2OFF_USERDAT_VIEWSET'], '3', '5', '6'), $GLOBALS['DB_GAME_SERVER']);
} else {
$query = Main::db_query(sprintf($GLOBALS['DBQUERY_CHECK_STATS_ACCESS'], $GLOBALS['DBSTRUCT_L2J_CHARS_TABLE'], $GLOBALS['DBSTRUCT_L2J_CHARS_NAME'], Main::db_escape_string($char_name, $GLOBALS['DB_GAME_SERVER']), $GLOBALS['DBSTRUCT_L2J_CHARS_VIEWSET'], '3', '5', '6'), $GLOBALS['DB_GAME_SERVER']);
}
if (Main::db_rows($query) == 1 || $this->logged && strcasecmp(Main::db_result(Main::db_query($GLOBALS['CONFIG_SERVER_TYPE'] == 1 ? sprintf($GLOBALS['DBQUERY_1_1'], $GLOBALS['DBSTRUCT_L2OFF_USERDAT_ACC'], $GLOBALS['DBSTRUCT_L2OFF_USERDAT_TABLE'], $GLOBALS['DBSTRUCT_L2OFF_USERDAT_NAME'], Main::db_escape_string($char_name, $GLOBALS['DB_GAME_SERVER'])) : sprintf($GLOBALS['DBQUERY_1_1'], $GLOBALS['DBSTRUCT_L2J_CHARS_ACC'], $GLOBALS['DBSTRUCT_L2J_CHARS_TABLE'], $GLOBALS['DBSTRUCT_L2J_CHARS_NAME'], Main::db_escape_string($char_name, $GLOBALS['DB_GAME_SERVER'])), $GLOBALS['DB_GAME_SERVER']), 0), $acc->account_username) == 0) {
if ($GLOBALS['CONFIG_SERVER_TYPE'] == 1) {
$query = Main::db_query(sprintf($GLOBALS['DBQUERY_CHAR_DATA'], $GLOBALS['DBSTRUCT_L2OFF_USERDAT_LEVEL'], $GLOBALS['DBSTRUCT_L2OFF_USERDAT_PVP'], $GLOBALS['DBSTRUCT_L2OFF_USERDAT_PK'], $GLOBALS['DBSTRUCT_L2OFF_USERDAT_CLAN'], $GLOBALS['DBSTRUCT_L2OFF_USERDAT_CLASS'], $GLOBALS['DBSTRUCT_L2OFF_USERDAT_TITLE'], '0', $GLOBALS['DBSTRUCT_L2OFF_USERDAT_ONLINE_TIME'], $GLOBALS['DBSTRUCT_L2OFF_USERDAT_LAST_ACCESS'], '0', '0', $GLOBALS['DBSTRUCT_L2OFF_PLEDGE_NAME'], $GLOBALS['DBSTRUCT_L2OFF_PLEDGE_TABLE'], $GLOBALS['DBSTRUCT_L2OFF_PLEDGE_TABLE'] . '.' . $GLOBALS['DBSTRUCT_L2OFF_PLEDGE_ID'], $GLOBALS['DBSTRUCT_L2OFF_USERDAT_TABLE'] . '.' . $GLOBALS['DBSTRUCT_L2OFF_USERDAT_CLAN'], $GLOBALS['DBSTRUCT_L2OFF_USERDAT_TABLE'], $GLOBALS['DBSTRUCT_L2OFF_USERDAT_NAME'], Main::db_escape_string($char_name, $GLOBALS['DB_GAME_SERVER'])), $GLOBALS['DB_GAME_SERVER']);
} else {
$query = Main::db_query(sprintf($GLOBALS['DBQUERY_CHAR_DATA'], $GLOBALS['DBSTRUCT_L2J_CHARS_LEVEL'], $GLOBALS['DBSTRUCT_L2J_CHARS_PVP'], $GLOBALS['DBSTRUCT_L2J_CHARS_PK'], $GLOBALS['DBSTRUCT_L2J_CHARS_CLAN'], $GLOBALS['DBSTRUCT_L2J_CHARS_CLASS'], $GLOBALS['DBSTRUCT_L2J_CHARS_TITLE'], $GLOBALS['DBSTRUCT_L2J_CHARS_RECS'], $GLOBALS['DBSTRUCT_L2J_CHARS_ONLINE_TIME'], $GLOBALS['DBSTRUCT_L2J_CHARS_LAST_ACCESS'], $GLOBALS['DBSTRUCT_L2J_CHARS_NOBLE'], $GLOBALS['DBSTRUCT_L2J_CHARS_HERO'], $GLOBALS['DBSTRUCT_L2J_CLAN_NAME'], $GLOBALS['DBSTRUCT_L2J_CLAN_TABLE'], $GLOBALS['DBSTRUCT_L2J_CLAN_TABLE'] . '.' . $GLOBALS['DBSTRUCT_L2J_CLAN_ID'], $GLOBALS['DBSTRUCT_L2J_CHARS_TABLE'] . '.' . $GLOBALS['DBSTRUCT_L2J_CHARS_CLAN'], $GLOBALS['DBSTRUCT_L2J_CHARS_TABLE'], $GLOBALS['DBSTRUCT_L2J_CHARS_NAME'], Main::db_escape_string($char_name, $GLOBALS['DB_GAME_SERVER'])), $GLOBALS['DB_GAME_SERVER']);
}
$char_data = Main::db_fetch_row($query);
header('Content-type: image/png');
$image_path = sep_path(CMS_DIR . '/templates/' . Template::used_template() . '/' . $GLOBALS['CONFIG_TEMPLATE_IMAGES'] . '/player_signature.png');
$the_image = imagecreatefrompng($image_path);
$color_1 = imagecolorallocate($the_image, 234, 234, 174);
$color_2 = imagecolorallocate($the_image, 255, 255, 255);
$color_3 = imagecolorallocate($the_image, 151, 162, 120);
$shadow_color = imagecolorallocate($the_image, 0, 0, 0);
$shading_color = imagecolorallocatealpha($the_image, 0, 0, 0, 100);
draw_text($the_image, 17, 15, 23, $color_1, 110, $GLOBALS['CONFIG_WEBSITE_NAME']);
示例3: htmlspecialchars
$template_vars['val_user'] = null;
$template_vars['val_code'] = null;
$template_vars['status'] = null;
if (isset($_GET['uname'])) {
$template_vars['val_user'] = htmlspecialchars($_GET['uname']);
}
if (isset($_GET['rid'])) {
$template_vars['val_code'] = htmlspecialchars($_GET['rid']);
}
if (isset($_GET['uname']) && isset($_GET['rid'])) {
$rec_user = htmlspecialchars(trim($_GET['uname']));
$rec_rid = htmlspecialchars(trim($_GET['rid']));
if ($acc->validate_user($rec_user) && $acc->validate_code($rec_rid)) {
if (Account::recover_check($rec_user)) {
$query = Main::db_query(sprintf($GLOBALS['DBQUERY_MCHECK_CHECK'], Main::db_escape_string($rec_user, $GLOBALS['DB_LOGIN_SERVER']), Main::db_escape_string($rec_rid, $GLOBALS['DB_LOGIN_SERVER']), Main::db_escape_string(USER_IP, $GLOBALS['DB_LOGIN_SERVER'])), $GLOBALS['DB_LOGIN_SERVER']);
if (Main::db_rows($query) == 1) {
$query = Main::db_query(sprintf($GLOBALS['DBQUERY_MCHECK_DATA'], Main::db_escape_string($rec_user, $GLOBALS['DB_LOGIN_SERVER']), Main::db_escape_string($rec_rid, $GLOBALS['DB_LOGIN_SERVER']), Main::db_escape_string(USER_IP, $GLOBALS['DB_LOGIN_SERVER'])), $GLOBALS['DB_LOGIN_SERVER']);
$data = Main::db_fetch_row($query);
$new_pass = @Main::encrypt($data[2]);
if ($GLOBALS['CONFIG_SERVER_TYPE'] == 1) {
Main::db_query(sprintf($GLOBALS['DBQUERY_CHANGE_PASSWORD'], $GLOBALS['DBSTRUCT_L2OFF_USERAUT_TABLE'], $GLOBALS['DBSTRUCT_L2OFF_USERAUT_PASS'], 'CONVERT(binary, ' . $new_pass . ')', $GLOBALS['DBSTRUCT_L2OFF_USERAUT_ACCOUNT'], Main::db_escape_string($rec_user, $GLOBALS['DB_LOGIN_SERVER'])), $GLOBALS['DB_LOGIN_SERVER']);
} else {
Main::db_query(sprintf($GLOBALS['DBQUERY_CHANGE_PASSWORD'], $GLOBALS['DBSTRUCT_L2J_ACCOUNTS_TABLE'], $GLOBALS['DBSTRUCT_L2J_ACCOUNTS_PASS'], '\'' . $new_pass . '\'', $GLOBALS['DBSTRUCT_L2J_ACCOUNTS_NAME'], Main::db_escape_string($rec_user, $GLOBALS['DB_LOGIN_SERVER'])), $GLOBALS['DB_LOGIN_SERVER']);
}
Main::db_query(sprintf($GLOBALS['DBQUERY_MCHECK_DELETE'], Main::db_escape_string($rec_user, $GLOBALS['DB_LOGIN_SERVER'])), $GLOBALS['DB_LOGIN_SERVER']);
$mail = new Mail();
$mail->Send($data[1], $GLOBALS['CONFIG_ADMIN_MAIL'], sprintf($GLOBALS['LANG_RECOVER_PASS_MAIL_SUBJECT'], $GLOBALS['CONFIG_WEBSITE_NAME']), sprintf($GLOBALS['LANG_RECOVER_PASS_MAIL'], $data[0], $data[2], $GLOBALS['CONFIG_WEBSITE_NAME']));
$GLOBALS['the_status'] = $GLOBALS['LANG_RECOVER_SUCCEDED'];
} else {
$GLOBALS['the_status'] = $GLOBALS['LANG_ERROR_ACT_SESSION'];
}
示例4: check_step
//.........这里部分代码省略.........
$GLOBALS['DB_LOGIN_SERVER_LINK'] = @mssql_pconnect($GLOBALS['CONFIG_MSSQL_HOST_LS'], $GLOBALS['CONFIG_MSSQL_USER_LS'], $GLOBALS['CONFIG_MSSQL_PASS_LS']);
@mssql_select_db($GLOBALS['CONFIG_MSSQL_NAME_GS'], $GLOBALS['DB_GAME_SERVER_LINK']);
$GLOBALS['CURRENT_DB_P'] = 'S';
$GLOBALS['CURRENT_DB'] = '1';
}
$link = $_GET['p'] == 1 ? 1 : 2;
if ($_GET['r'] == '0') {
if (Main::db_result(Main::db_query(sprintf('IF OBJECT_ID (N\'%s\', N\'U\') IS NOT NULL SELECT 1 AS result ELSE SELECT 0 AS result', $_GET['q']), $link), 0) == 1) {
exit('1');
}
} else {
$qry = Main::db_query(sprintf('SELECT COLUMN_NAME FROM INFORMATION_SCHEMA.Columns WHERE TABLE_NAME = \'%s\'', $_GET['r']), $link);
while ($row = Main::db_fetch_row($qry)) {
if ($row[0] == $_GET['q']) {
exit('1');
}
}
}
if ($GLOBALS['CONFIG_USE_SQLSRV'] && extension_loaded('sqlsrv')) {
@sqlsrv_close($GLOBALS['DB_GAME_SERVER_LINK']);
@sqlsrv_close($GLOBALS['DB_LOGIN_SERVER_LINK']);
} else {
@mssql_close($GLOBALS['DB_GAME_SERVER_LINK']);
@mssql_close($GLOBALS['DB_LOGIN_SERVER_LINK']);
}
} else {
$GLOBALS['DB_GAME_SERVER_LINK'] = @mysql_pconnect($GLOBALS['CONFIG_MYSQL_HOST_GS'], $GLOBALS['CONFIG_MYSQL_USER_GS'], $GLOBALS['CONFIG_MYSQL_PASS_GS']);
$GLOBALS['DB_LOGIN_SERVER_LINK'] = @mysql_pconnect($GLOBALS['CONFIG_MYSQL_HOST_LS'], $GLOBALS['CONFIG_MYSQL_USER_LS'], $GLOBALS['CONFIG_MYSQL_PASS_LS']);
@mysql_select_db($GLOBALS['CONFIG_MYSQL_NAME_GS'], $GLOBALS['DB_GAME_SERVER_LINK']);
$GLOBALS['CURRENT_DB_P'] = 'Y';
$GLOBALS['CURRENT_DB'] = '1';
$link = $_GET['p'] == 1 ? 1 : 2;
if ($_GET['r'] == '0') {
if (Main::db_rows(Main::db_query(sprintf('SHOW TABLES LIKE \'%s\'', $_GET['q']), $link))) {
exit('1');
}
} else {
$qry = Main::db_query(sprintf('SHOW COLUMNS FROM %s', $_GET['r']), $link);
while ($row = Main::db_fetch_array($qry)) {
if ($row[0] == $_GET['q']) {
exit('1');
}
}
}
@mysql_close($GLOBALS['DB_GAME_SERVER_LINK']);
@mysql_close($GLOBALS['DB_LOGIN_SERVER_LINK']);
}
exit('2');
} else {
$vars['active_extra'] = 'active';
$GLOBALS['CONFIG_ACCESS_LEVELS_0'] = $GLOBALS['CONFIG_ACCESS_LEVELS_0'] == 'install' ? $GLOBALS['CONFIG_SERVER_TYPE'] == 1 ? '-1' : '-1' : $GLOBALS['CONFIG_ACCESS_LEVELS_0'];
$GLOBALS['CONFIG_ACCESS_LEVELS_1'] = $GLOBALS['CONFIG_ACCESS_LEVELS_1'] == 'install' ? $GLOBALS['CONFIG_SERVER_TYPE'] == 1 ? '0' : '0' : $GLOBALS['CONFIG_ACCESS_LEVELS_1'];
$GLOBALS['CONFIG_ACCESS_LEVELS_2'] = $GLOBALS['CONFIG_ACCESS_LEVELS_2'] == 'install' ? $GLOBALS['CONFIG_SERVER_TYPE'] == 1 ? '5' : '20' : $GLOBALS['CONFIG_ACCESS_LEVELS_2'];
$GLOBALS['CONFIG_ACCESS_LEVELS_3'] = $GLOBALS['CONFIG_ACCESS_LEVELS_3'] == 'install' ? $GLOBALS['CONFIG_SERVER_TYPE'] == 1 ? '4' : '50' : $GLOBALS['CONFIG_ACCESS_LEVELS_3'];
$GLOBALS['CONFIG_ACCESS_LEVELS_4'] = $GLOBALS['CONFIG_ACCESS_LEVELS_4'] == 'install' ? $GLOBALS['CONFIG_SERVER_TYPE'] == 1 ? '2' : '80' : $GLOBALS['CONFIG_ACCESS_LEVELS_4'];
$GLOBALS['CONFIG_ACCESS_LEVELS_5'] = $GLOBALS['CONFIG_ACCESS_LEVELS_5'] == 'install' ? $GLOBALS['CONFIG_SERVER_TYPE'] == 1 ? '1' : '100' : $GLOBALS['CONFIG_ACCESS_LEVELS_5'];
$step_vars['val_webname'] = $GLOBALS['CONFIG_WEBSITE_NAME'];
$step_vars['val_weburl'] = $GLOBALS['CONFIG_WEBSITE_URL'];
$step_vars['val_description'] = $GLOBALS['CONFIG_TEMPLATE_DESCRIPTION'];
$step_vars['val_keywords'] = $GLOBALS['CONFIG_TEMPLATE_KEYWORDS'];
$step_vars['val_author'] = $GLOBALS['CONFIG_TEMPLATE_AUTHOR'];
$step_vars['val_admin_mail'] = $GLOBALS['CONFIG_ADMIN_MAIL'];
$step_vars['val_smtp_server'] = $GLOBALS['CONFIG_SMTP_SERVER'];
$step_vars['val_smtp_port'] = $GLOBALS['CONFIG_SMTP_PORT'];
$step_vars['val_smtp_user'] = $GLOBALS['CONFIG_SMTP_USER'];
$step_vars['smtp_check_d'] = !isset($_POST['smtp_data']) || isset($_POST['smtp_data']) && $_POST['smtp_data'] == 0 ? 'checked="checked" ' : null;