diff --git a/towns.php b/towns.php index 5725f83..5df457a 100644 --- a/towns.php +++ b/towns.php @@ -274,7 +274,12 @@ function maps() { // List maps the user can buy. if ($townrow["latitude"] >= 0) { $latitude = $townrow["latitude"] . "N,"; } else { $latitude = ($townrow["latitude"]*-1) . "S,"; } if ($townrow["longitude"] >= 0) { $longitude = $townrow["longitude"] . "E"; } else { $longitude = ($townrow["longitude"]*-1) . "W"; } - if ($mappedtowns[$townrow["id"]] == 0) { + + $mapped = false; + foreach($mappedtowns as $a => $b) { + if ($b == $townrow["id"]) { $mapped = true; } + } + if ($mapped == false) { $page .= "".$townrow["name"]."Price: ".$townrow["mapprice"]." goldBuy map to reveal details.\n"; } else { $page .= "".$townrow["name"]."Already mapped.Location: $latitude $longitudeTP: ".$townrow["travelpoints"]."\n"; @@ -315,9 +320,7 @@ function maps3($id) { // Add new map to user's profile. if ($userrow["gold"] < $townrow["mapprice"]) { display("You do not have enough gold to buy this map.

You may return to town, store, or use the direction buttons on the left to start exploring.", "Buy Maps"); die(); } - $mappedtowns = explode(",",$userrow["towns"]); - $mappedtowns[$id] = 1; - $mappedtowns = implode(",",$mappedtowns); + $mappedtowns = $userrow["towns"].",$id"; $newgold = $userrow["gold"] - $townrow["mapprice"]; $updatequery = doquery("UPDATE {{table}} SET towns='$mappedtowns',gold='$newgold' WHERE id='".$userrow["id"]."' LIMIT 1", "users"); diff --git a/users.php b/users.php index 7345845..30645c2 100644 --- a/users.php +++ b/users.php @@ -203,14 +203,15 @@ function mymail($to, $title, $body, $from = '') { // thanks to arto dot PLEASE d $controlquery = doquery("SELECT * FROM {{table}} WHERE id='1' LIMIT 1", "control"); $controlrow = mysql_fetch_array($controlquery); extract($controlrow); + $from = trim($from); if (!$from) { - $from = 'Dragon Knight <$adminemail>'; + $from = '<'.$controlrow["adminemail"].'>'; } - $rp = '$adminemail'; + $rp = $controlrow["adminemail"]; $org = '$gameurl'; $mailer = 'PHP';