> WHERE id='1' LIMIT 1")); // Account row. include("cookies.php"); $acctrow = checkcookies(); if ($acctrow == false && substr($_SERVER["REQUEST_URI"], -21) != "users.php?do=register") { die(header("Location: login.php?do=login")); } if ($acctrow != false && $acctrow["characters"] == 0 && substr($_SERVER["REQUEST_URI"], -20) != "users.php?do=charnew") { die(header("Location: users.php?do=charnew")); } // User row. if (substr($_SERVER["REQUEST_URI"], -19) != "login.php?do=logout") { $online = doquery("UPDATE <> SET onlinetime=NOW() WHERE id='".$acctrow["activechar"]."' LIMIT 1"); } else { $online = doquery("UPDATE <> SET onlinetime = DATE_SUB(onlinetime, INTERVAL 11 MINUTE) WHERE id='".$acctrow["activechar"]."' LIMIT 1"); } $userrow = dorow(doquery("SELECT * FROM <> WHERE id='".$acctrow["activechar"]."' LIMIT 1")); if ($userrow != false) { $userrow = array_map("stripslashes", $userrow); } // World row. $worldrow = dorow(doquery("SELECT * FROM <> WHERE id='".($userrow["world"] ?? 1)."' LIMIT 1")); // Town row. if (isset($userrow["currentaction"]) && $userrow["currentaction"] == "In Town") { $townrow = dorow(doquery("SELECT * FROM <> WHERE world='".$userrow["world"]."' AND longitude='".$userrow["longitude"]."' AND latitude='".$userrow["latitude"]."' LIMIT 1")); } else { $townrow = false; } // Spells. $spells = dorow(doquery("SELECT * FROM <> ORDER BY id", "spells"), "id"); // Global fightrow. $fightrow = array( "playerphysdamage"=>0, "playermagicdamage"=>0, "playerfiredamage"=>0, "playerlightdamage"=>0, "monsterphysdamage"=>0, "monstermagicdamage"=>0, "monsterfiredamage"=>0, "monsterlightdamage"=>0, "track"=>"", "message"=>""); ?>