Okay, let's fix main page

This commit is contained in:
lopar 2018-03-02 15:21:44 +02:00
parent 4aac64916d
commit 70a7ce3172

View File

@ -6,15 +6,15 @@ if(!isset($_SESSION['uid'])) { header("Location: index.php"); }
include("config.php"); include("config.php");
include("functions.php"); include("functions.php");
$tmaz = time(); $tmaz = time();
mysql_query("UPDATE `online` SET `real_time` = '".time()."' WHERE `id` = {$user['id']} LIMIT 1"); db::c()->query('UPDATE `online` SET `real_time` = ?i WHERE `id` = ?i', time(), $u->i()['id']);
if($user['battle'] != 0) { header('location: fbattle.php'); die(); } if($u->i()['battle'] != 0) { header('location: fbattle.php'); die(); }
if($user['klan']) { //if($user['klan']) {
$shadow = mysql_fetch_array(mysql_query("SELECT `id`, `mshadow`, `wshadow` FROM `clans` WHERE `id` = '{$user['klan']}' LIMIT 1")); // $shadow = mysql_fetch_array(mysql_query("SELECT `id`, `mshadow`, `wshadow` FROM `clans` WHERE `id` = '{$user['klan']}' LIMIT 1"));
} //}
if($_POST['bankpsw']) { if($_POST['bankpsw']) {
echo "<b style='color: Red;'>".auth_bank((int)$_POST['bank'], $_POST['bankpsw'], $user['id'])."</b>"; echo "<b style='color: Red;'>".auth_bank((int)$_POST['bank'], $_POST['bankpsw'], $u->i()['id'])."</b>";
} }
if($_GET['unset_bank'] == 1) { if($_GET['unset_bank'] == 1) {
@ -22,12 +22,18 @@ if($_GET['unset_bank'] == 1) {
} }
if($_GET['error'] == 'bank') { if($_GET['error'] == 'bank') {
echo '<b style=\'color: Red;\'>Работа со счётом завершена ..</b>'; err('Работа со счётом завершена.');
} }
function updstats() { function updstats() {
global $user; global $user;
$u1 = mysql_fetch_array(mysql_query("SELECT `sila`, `lovk`, `inta`, `intel`, `noj`, `mec`, `topor`, `dubina`, `mfire`, `mwater`, `mair`, `mearth`, `mlight`, `mgray`, `mdark`, `hp`, `maxhp` FROM `users` WHERE `id` = '$user[id]' LIMIT 1")); $u1 = mysql_fetch_array(mysql_query("
SELECT
`sila`, `lovk`, `inta`, `intel`,
`noj`, `mec`, `topor`, `dubina`,
`mfire`, `mwater`, `mair`, `mearth`,
`mlight`, `mgray`, `mdark`, `hp`, `maxhp`
FROM `users` WHERE `id` = '$user[id]' LIMIT 1"));
foreach($u1 as $k => $v) { foreach($u1 as $k => $v) {
$user[$k] = $v; $user[$k] = $v;
} }
@ -51,7 +57,7 @@ if(@$_GET['stackall']) {
*/ */
} }
if(@$_GET["stack"]) { if($_GET["stack"]) {
$_GET["stack"] = (int)$_GET["stack"]; $_GET["stack"] = (int)$_GET["stack"];
$rec = mysql_fetch_array(mysql_query("SELECT `id` FROM `inventory` WHERE `id` = '".mysql_real_escape_string($_GET['stack'])."' AND `owner` = '$user[id]' AND `setsale` = 0 LIMIT 1")); $rec = mysql_fetch_array(mysql_query("SELECT `id` FROM `inventory` WHERE `id` = '".mysql_real_escape_string($_GET['stack'])."' AND `owner` = '$user[id]' AND `setsale` = 0 LIMIT 1"));
if(isset($rec['id'])) { if(isset($rec['id'])) {
@ -60,7 +66,7 @@ if(@$_GET["stack"]) {
} }
} }
if(@$_GET['unstack']) { if($_GET['unstack']) {
unstack((int)$_GET['unstack'], (int)$_POST["qty"]); unstack((int)$_GET['unstack'], (int)$_POST["qty"]);
} }