035a48fbfe
2.26.2006 - Build 14 (Pete Rose): - The poor sods who are stuck on dial-up can now select to not show the minimap in their account settings. - Fixed a problem with guild names in paneltop. - Fixed minor bug in account settings that caused a server error when not changing your password. - Manually logging out of the game now resets your onlinetime so you no longer appear in Who's Online. - Letting a duel time out after it's been accepted now counts against your duelling wins/losses. - Overhauled dorow() to allow forcing array indexes by a specific column. Modified several functions accordingly. - Guild Honor is now shown correctly on the main Guild Hall page immediately after an update. - Guild shoutboxes now add the guild ID from userrow instead of in the GET request. More secure. - Guild minimim join/start levels are now admin-editable in controlrow. - updateuserrow() now array_maps addslashes to allow apostrophes in item names.
50 lines
2.1 KiB
PHP
50 lines
2.1 KiB
PHP
<?php // globals.php :: Storage for lots of super important arrays we're probably going to need eventually.
|
|
|
|
// Config.php.
|
|
include("config.php");
|
|
if (trim($dbsettings["secretword"]) == "") { die("Invalid setting for secretword in config.php. This setting must never be blank."); }
|
|
|
|
// Control row.
|
|
$controlrow = dorow(doquery("SELECT * FROM {{table}} WHERE id='1' LIMIT 1", "control"));
|
|
|
|
// 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 {{table}} SET onlinetime=NOW() WHERE id='".$acctrow["activechar"]."' LIMIT 1", "users");
|
|
} else {
|
|
$online = doquery("UPDATE {{table}} SET onlinetime = DATE_SUB(onlinetime, INTERVAL 11 MINUTE) WHERE id='".$acctrow["activechar"]."' LIMIT 1", "users");
|
|
}
|
|
$userrow = dorow(doquery("SELECT * FROM {{table}} WHERE id='".$acctrow["activechar"]."' LIMIT 1", "users"));
|
|
if ($userrow != false) { $userrow = array_map("stripslashes", $userrow); }
|
|
|
|
// World row.
|
|
$worldrow = dorow(doquery("SELECT * FROM {{table}} WHERE id='".$userrow["world"]."' LIMIT 1", "worlds"));
|
|
|
|
// Town row.
|
|
if ($userrow["currentaction"] == "In Town") {
|
|
$townrow = dorow(doquery("SELECT * FROM {{table}} WHERE world='".$userrow["world"]."' AND longitude='".$userrow["longitude"]."' AND latitude='".$userrow["latitude"]."' LIMIT 1", "towns"));
|
|
} else {
|
|
$townrow = false;
|
|
}
|
|
|
|
// Spells.
|
|
$spells = dorow(doquery("SELECT * FROM {{table}} 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,
|
|
"message"=>"");
|
|
|
|
?>
|