PyroGriffin, I just recreated the zip file fresh and uploaded it again. It that still doesn't work.
Copy and paste this into Notepad. Then save as imagemap.php. Make sure it does not add .txt.
<?PHP
// Gaia Sig Mapper
// Regions are Defined By Rect Normally
// Jakobo @ Gaia Online
// Class Definition
// This is responsible for the definition of coordinates
class imageMap {
var $locale,
$defaultURL,
$size;
function imageMap() {
// makes locale ready for data
$this->locale = array()
$this->size = 0;
}
function setDefaultURL($inUrl) {
$this->defaultURL = $inUrl;
}
function addToMap($Region) {
$this->locale[$this->size] = $Region;
$this->size++;
}
function testMap($inX, $inY) {
foreach($this->locale as $Region) {
$Region->goIfInside($inX, $inY)
}
// we didn't go anywhere, load the default
header("Location: " . $this->defaultURL)
}
}
class Region {
var $type, // type of region
$url; // url of region
function Region() {
// empty constructor
}
}
class Rect extends Region {
var $x1,
$y1,
$x2,
$y2;
function Rect($inX1, $inY1, $inX2, $inY2, $inUrl) {
$this->x1 = $inX1;
$this->y1 = $inY1;
$this->x2 = $inX2;
$this->y2 = $inY2;
$this->url = $inUrl;
$this->type = "rect";
}
function isInside($clickedX = -1, $clickedY = -1) {
// if X and Y are not set, -1 is used
// placing it outside of the image map
if(($clickedX >= $this->x1 && $clickedX <= $this->x2) && ($clickedY >= $this->y1 && $clickedY <= $this->y2) ) {
return true;
} else {
return false;
}
}
function goIfInside($clickedX = -1, $clickedY = -1) {
// goes to object's URL if inside
if($this->isInside($clickedX, $clickedY)) {
header("Location: " . $this->url)
exit;
}
}
}
?>
Copy and paste this as map.php.
<?PHP
/* Gaia Image Map Go-er
Rudolph J Heuser (Jakobo on GaiaOnline.com
Modified: John T Wu (borobdin on GaiaOnline.com)
*/
require_once("imagemap.php")
// new imageMap
$myImageMap = new imageMap()
// define regions
$area = new Rect(X_left,Y_top,X_right,Y_bottom,"URL")
$myImageMap->addToMap($area)
$myImageMap->setDefaultURL("")
// capture X and Y from query string
$x_and_y = $_SERVER["QUERY_STRING"]
$x_and_y = explode(",",$x_and_y)
$inX = $x_and_y[0]
$inY = $x_and_y[1]
unset($x_and_y)
// echo $inX. "," . $inY;
$myImageMap->testMap($inX, $inY)
?>