bug fixes
This commit is contained in:
parent
6f782914ca
commit
edb4504a5c
|
@ -37,10 +37,10 @@ $userrow = dorow(doquery("SELECT * FROM <<users>> WHERE id='".$acctrow["activech
|
|||
if ($userrow != false) { $userrow = array_map("stripslashes", $userrow); }
|
||||
|
||||
// World row.
|
||||
$worldrow = dorow(doquery("SELECT * FROM <<worlds>> WHERE id='".$userrow["world"]."' LIMIT 1"));
|
||||
$worldrow = dorow(doquery("SELECT * FROM <<worlds>> WHERE id='".($userrow["world"] ?? 1)."' LIMIT 1"));
|
||||
|
||||
// Town row.
|
||||
if ($userrow["currentaction"] == "In Town") {
|
||||
if (isset($userrow["currentaction"]) && $userrow["currentaction"] == "In Town") {
|
||||
$townrow = dorow(doquery("SELECT * FROM <<towns>> WHERE world='".$userrow["world"]."' AND longitude='".$userrow["longitude"]."' AND latitude='".$userrow["latitude"]."' LIMIT 1"));
|
||||
} else {
|
||||
$townrow = false;
|
||||
|
|
2
lib.php
2
lib.php
|
@ -216,7 +216,7 @@ function display($title, $content, $panels = true) { // Finalize page and output
|
|||
$row = array();
|
||||
$row["gamename"] = $controlrow["gamename"];
|
||||
$row["pagetitle"] = $title;
|
||||
$row["background"] = "background" . $userrow["world"];
|
||||
$row["background"] = (isset($userrow['world'])) ? "background" . $userrow["world"] : "background";
|
||||
$row["version"] = $version;
|
||||
$row["content"] = $content;
|
||||
$row["moddedby"] = $controlrow["moddedby"];
|
||||
|
|
|
@ -126,7 +126,11 @@ function paneltop($loggedin = true) {
|
|||
global $acctrow, $userrow;
|
||||
if ($loggedin == true || isset($acctrow)) {
|
||||
|
||||
if ($userrow == false) { $userrow["charname"] = "No Characters Yet"; $userrow["guild"] = 0; }
|
||||
if (empty($userrow) || !isset($userrow) || $userrow === false) {
|
||||
$userrow = [];
|
||||
$userrow["charname"] = "No Characters Yet";
|
||||
$userrow["guild"] = 0;
|
||||
}
|
||||
//if ($acctrow["authlevel"] == 255) { $admin = " (<a href=\"admin/index.php\">Admin</a>)"; } else { $admin = ""; }
|
||||
$admin = "";
|
||||
if ($userrow["guild"] != 0) {
|
||||
|
|
|
@ -358,6 +358,7 @@ function charnew() {
|
|||
$characternamequery = doquery("SELECT charname FROM <<users>> WHERE charname='$charname' LIMIT 1");
|
||||
if (mysql_num_rows($characternamequery) > 0) { $errors++; $errorlist .= "Character Name already taken - unique Character Name required.<br />"; }
|
||||
|
||||
|
||||
// Upload new charpicture, if required.
|
||||
if ($_FILES["intavatar"]["error"] != 4) {
|
||||
|
||||
|
@ -377,6 +378,8 @@ function charnew() {
|
|||
if (!move_uploaded_file($_FILES["intavatar"]["tmp_name"], $uploadfile)) { die("Unable to upload avatar."); }
|
||||
$newcharpicture = $controlrow["avatarurl"] . $acctrow["username"] . $randomext . $type;
|
||||
|
||||
} else {
|
||||
$newcharpicture = $controlrow["avatarurl"] . "nopicture.gif";
|
||||
}
|
||||
|
||||
// Process everything else important.
|
||||
|
|
Loading…
Reference in New Issue
Block a user