PDA

View Full Version : Making a map... help!


dulop
05-23-2012, 03:12 AM
Hello.
i have seen the tutorial "Exploring system (http://www.mysidiaadoptables.com/forum/showthread.php?t=1827)" from PTGigi.

I understand it, but i have a problem.

When i put "hello" (for example) in the article content, the pages works fine and show "hello".

$act = $_GET["act"];
$act = preg_replace("/[^a-zA-Z0-9\\040.]/", "", $act);
$act = secure($act);

$num = $_GET["num"];
$num = preg_replace("/[^a-zA-Z0-9\\040.]/", "", $num);
$num = secure($num);

if ($act == ""){
$article_title = "Magical Forest!";
$article_content = "Hello";
}

But when i try to put a map, the pages become white D: and don't work!


$act = $_GET["act"];
$act = preg_replace("/[^a-zA-Z0-9\\040.]/", "", $act);
$act = secure($act);

$num = $_GET["num"];
$num = preg_replace("/[^a-zA-Z0-9\\040.]/", "", $num);
$num = secure($num);

if ($act == ""){
$article_title = "Magical Forest!";
$article_content = "
<html>
<head>
</head>
<body>
<map name="mapa1">
<area alt="Pulsa para conocer mi trabajo" shape="rect" coords="419,93,448,121" href="www.digiforos.net">
<area alt="Pulsa para ver la página de mis amigos" shape="rect" coords="64,32,96,64" href="www.digiforos.net">
<area alt="Pulsa para ver mi novia" shape="rect" coords="450,37,480,67" href="www.digiforos.net">
<area alt="Pulsa para conocer a mi Familia" shape="ret" coords="129,158,164,190" href="www.digiforos.net">
<area alt="Pulsa para conocer mi trabajo" shape="rect" coords="481,195,510,223" href="www.digiforos.net">
<area alt="Pulsa para conocer mi trabajo" shape="rect" coords="353,256,386,288" href="www.digiforos.net">

</map>
<img src="www.digiforos.net/digiadoptables/historia/ciudad.png"alt="Mapa de imágenes. Pulsa en cada una de los cÃ*rculos." border="0" usemap="mapa1">
</body>
</html>";
}

I have been all night trying to fix, but i can't :S

Please can you help me? thanks

AlexC
05-23-2012, 05:13 AM
The code probably isn't working because html and php don't just mix like that. Inside the article content tag, turn all of the double quotes to one quotes and see if that works (but not outside, because that's php code).

That code is rather outdated as well and doesn't work properly, anyway. :c If you'd like, I uses php code for a random explore page - it doesn't let you do scripted adventures, but it lets you do random phrases that it'll select on and also chances (so you can do it that an adoptable promo code page could be more rare or something). I can give you that.

dulop
05-23-2012, 12:24 PM
Thanks! with the single quote it works!

$article_title = "Ciudad data";
$article_content = "<map name='mapa1'>
<area shape='rect' coords='419,93,448,121' href='http://www.digiforos.net'>
</map>
<img src='http://www.digiforos.net/digiadoptables/historia/ciudad.png' usemap='#mapa1'> ";
}


Thank you

AlexC
05-23-2012, 02:30 PM
glad to know that was what fixed it. :3 You should always keep that in the back of your head when working with html and php - all html needs to be in single quotes. it'll save your life, trust me. (so many support threads before I learnt that...)

PTGigi
05-23-2012, 03:37 PM
Gah, sorry! I hadn't realized my year-old tutorial was still in use, even if I never got around to completing it. XD I've added a note at the top of the tutorial now that states it's outdated so it won't confuse people anymore. Sorry again about that ^-^"

Maybe I'll get around to updating it (or more likely, just making a new thread) when I actually start up a new site :3

dulop
05-23-2012, 08:14 PM
glad to know that was what fixed it. :3 You should always keep that in the back of your head when working with html and php - all html needs to be in single quotes. it'll save your life, trust me. (so many support threads before I learnt that...)
Haha thank you! ^^

Gah, sorry! I hadn't realized my year-old tutorial was still in use, even if I never got around to completing it. XD I've added a note at the top of the tutorial now that states it's outdated so it won't confuse people anymore. Sorry again about that ^-^"

Maybe I'll get around to updating it (or more likely, just making a new thread) when I actually start up a new site :3
Hahaha is very usefull your tutorial! it's a shame that you never continue with next parts!
I have been trying and i can make a map x) but i dont know how to, for example, add cash when i click in a specify place.
Would be great if you continue with the tutorial! :B i will be waiting!

P.D.: Sorry if i speak a bad english, i'm not native speaker xD