PHP Developers Network

A community of PHP developers offering assistance, advice, discussion, and friendship.
 
Loading
It is currently Mon Sep 16, 2019 8:54 pm

All times are UTC - 5 hours




Post new topic Reply to topic  [ 7 posts ] 
Author Message
PostPosted: Thu Nov 22, 2007 5:31 pm 
Offline
Forum Contributor
User avatar

Joined: Tue Sep 11, 2007 3:25 pm
Posts: 316


Last edited by Josh1billion on Thu Nov 22, 2007 7:29 pm, edited 1 time in total.

Top
 Profile  
 
 Post subject:
PostPosted: Thu Nov 22, 2007 5:42 pm 
Offline
Tranquility In Moderation
User avatar

Joined: Sun Feb 06, 2005 8:18 pm
Posts: 5001
Location: Indiana

_________________
- A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Nov 23, 2007 12:55 am 
Offline
DevNet Master
User avatar

Joined: Wed Dec 06, 2006 5:14 pm
Posts: 3635
Location: Toronto, Canada
looks cool, but you need to close your img tag!


Top
 Profile  
 
 Post subject:
PostPosted: Sat Nov 24, 2007 4:03 pm 
Offline
Forum Contributor
User avatar

Joined: Tue Sep 11, 2007 3:25 pm
Posts: 316
If anyone wants to see a working example, I have one temporarily uploaded.

Here's a screenshot:


Here's the working example, though you'll need to be logged into SoTO to use it (the imagemap isn't the only purpose of the page):
http://www.seedsoftime.net/worldmap.php

Note: the compass is one single image. No need to upload the image in different sections.


Top
 Profile  
 
PostPosted: Fri Nov 25, 2011 7:23 pm 
Offline
Forum Newbie

Joined: Fri Nov 25, 2011 7:20 pm
Posts: 3
hi, im having trouble getting the tooltips to show on my image map. the code for the map is working fine but im not able to get the tooltips to appear. i know this is quite an old topic so will wait for a reply before posting any code! hope someone can help me!
spikereloaded


Top
 Profile  
 
PostPosted: Sat Nov 26, 2011 12:43 pm 
Offline
Forum Newbie

Joined: Fri Nov 25, 2011 7:20 pm
Posts: 3
thought id post the code in case anyone passes through and has any idea why this wont work for me!
Syntax: [ Download ] [ Hide ]
<?php
include "globals.php";
?>
<head>
<style type="text/css">

#dhtmltooltip{
        position: absolute;
        width: 150px;
        border: 2px solid black;
        padding: 2px;
        background-color: lightyellow;
        visibility: hidden;
        z-index: 100;
/*Remove below line to remove shadow. Below line should always appear last within this CSS*/
filter: progid:DXImageTransform.Microsoft.Shadow(color=gray,direction=135);
}

</style>
</head>
<?php
Include "map_functions.php";
$q=$db->query("SELECT u.*,c.* FROM users u LEFT JOIN cities c ON u.location=c.cityid WHERE u.userid=$userid");
$r=$db->fetch_row($q);
$_GET['to'] = abs((int) $_GET['to']);
if(!$_GET['to'])
{
print "Welcome to the Monorail Station. It costs \$1000 for a ticket.<br> <u><b>Please be aware that you will still be charged if you choose to travel to a location that you are already in. <br>You are Currently in {$r['cityname']}</b></u></br> <br />
Where would you like to travel today?<br />"
;
$q=$db->query("SELECT * FROM cities WHERE cityid != {$ir['location']} AND cityminlevel <= {$ir['level']}");
//code for the imagemap
map_Start("http://murdercountry.com/murdercountrymap.jpg");

        map_Entry("This is one place on the map", "white", 98, 496, 10, 10, "monorail.php?to=1", 500);
                map_entry("This is Thugville", "white", 141, 200, 10, 10, "monorail.php?to=2", 150);
                map_entry("This is Gangsterville", "white", 218, 49, 10, 10, "monorail.php?to=3", 150);

        map_End();
               
                //end code for imagemap
while($r=$db->fetch_row($q))
{

}

}
else
{
if($ir['money'] < 1000)
{
print "You don't have enough money.";
}
else if( ((int) $_GET['to']) != $_GET['to'])
{
print "Invalid city ID";
}
else
{
$q=$db->query("SELECT * FROM cities WHERE cityid = {$_GET['to']} AND cityminlevel <= {$ir['level']}");
if(!$db->num_rows($q))
{
print "Error, this city either does not exist or you are not a high enough level to go there.";
}
else
{
$db->query("UPDATE users SET money=money-1000,location={$_GET['to']} WHERE userid=$userid");
$r=$db->fetch_row($q);
print "Congratulations, you paid \$1000 and travelled to {$r['cityname']} on the monorail!";
}
}
}
$h->endpage();
?>
<body>
<div id="dhtmltooltip"></div>
<script type="text/javascript" src="tooltip.js"></script>
</body>


Top
 Profile  
 
PostPosted: Sun Nov 27, 2011 9:37 am 
Offline
Forum Newbie

Joined: Fri Nov 25, 2011 7:20 pm
Posts: 3
no wories sorted it. Had to put the Script in the header of the actual page rather than putting it in a seperate .js file.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group