Welcome to Gaia! ::


Hygienic Swapper

ok.. haven't checked for bugs, would appreciate on comments so I can work on them
Random image, and random link. the link corresponds to the image.
User Image - Blocked by "Display Image" Settings. Click to show.

should be simple enough to modify so it works with image map...
this post itself is a test, it worked when I tested it.. but the image wasn't located anywhere sweatdrop

edit: one glitch I'm pretty sure of... if the image is loaded in two different pages... the last loaded will be the the one defining where the link heads to, because of the session variable it uses.

source codes:
Random Image
Random Link

how:
looks inside the folder images and gets total listing of images, picks a random one and displays it, png,jpg and gif only.
Assigns a session variable telling the number chosen

when clicked on, it reads all the files inside the folder urls and loads the one that corresponds to the image chosen (text file with the same name as picture) it reads the file, and redirects to the URL contained in it.

I did it this way, because I think it would be easier to add more images into the rotation. If you want to use image maps though, you'd have to hardcode em into the script, or work on the formatting for the text file to read and build an image map for each image.
Choggo, that is awesome! biggrin
Skorpeyon
Jakobo
I'm just excited to see so many people using it. It looks like it was meeting a pretty helpful need. I don't know about other people, but I use my own sig to frequently jump to common threads. Having all the links there just make things easier biggrin

Oh, I agree, I love the fact that I have all my favorite sites linked in my sig, so I can jump to them whether I'm at home or not. All I have to do is find one post that I've made, and I'm good. xd

Now if I could just find out how to do something like Cremonte's shoutboxes, I'd combine the two like Rayquazza did in a sort of super-hybrid-psycho-sig.

hello i saw that you have med an ismap siggy thing.
and i dont understand a thing so can you plz help me!!
Chaos_91
hello i saw that you have med an ismap siggy thing.
and i dont understand a thing so can you plz help me!!


Could you provide a bit more information beyond that? I reccomend reading the first post, and if you are really hung up on that, let me know and I will try and flush out some of the parts that might be unclear. smile
I noticed a cool signature and asked the creator how they made it and if there is a cite or thread to teach my how, so they directed me here. These are very usefull and the guide is helpfull ^_^
.Thankie's so much's! This thing is so great's!.
Choggo
ok.. haven't checked for bugs, would appreciate on comments so I can work on them
Random image, and random link. the link corresponds to the image.
User Image - Blocked by "Display Image" Settings. Click to show.

should be simple enough to modify so it works with image map...
this post itself is a test, it worked when I tested it.. but the image wasn't located anywhere sweatdrop

edit: one glitch I'm pretty sure of... if the image is loaded in two different pages... the last loaded will be the the one defining where the link heads to, because of the session variable it uses.

source codes:
Random Image
Random Link

how:
looks inside the folder images and gets total listing of images, picks a random one and displays it, png,jpg and gif only.
Assigns a session variable telling the number chosen

when clicked on, it reads all the files inside the folder urls and loads the one that corresponds to the image chosen (text file with the same name as picture) it reads the file, and redirects to the URL contained in it.

I did it this way, because I think it would be easier to add more images into the rotation. If you want to use image maps though, you'd have to hardcode em into the script, or work on the formatting for the text file to read and build an image map for each image.
hahaha and Ray told me it couldn't be done XP I'll have to keep this in mind in the future when I stop whoring out my sig XP

but the real reason I came here... image mapping makes an awesome way to do "thread navigation" XD I'm using another map for a thread I'm doing and I have a "navigation bar" image and each picture takes you to a different post in the thread and looks far cooler than just plain boring text navigation XP

thanks again jakobo XD
Great work, Jakobo! I'm using the Map in my siggy right now ^____^
Jakobo
Chaos_91
hello i saw that you have med an ismap siggy thing.
and i dont understand a thing so can you plz help me!!


Could you provide a bit more information beyond that? I reccomend reading the first post, and if you are really hung up on that, let me know and I will try and flush out some of the parts that might be unclear. smile

yeah the thing is that i dont understand what to do after i have writen the links in the file.

i am in greece and will be home in about 2 weeks then you can help me thx!!
It works. I love you, Jakobo! heart xd

Shameless Fairy

12,375 Points
  • Bunny Spotter 50
  • Bunny Hunter 100
  • Bunny Hoarder 150
This is so cool! Nice work.

Dapper Lunatic

I wish i understood this better, because those are really kick a**. Alas, I am either to tired to entirely understand this, or i just don't understand it... maybe i'll have my friend explain it to me more later.
I will be updating this thread (after finishing this article for "The Daily Post" wink to include the new advanced code.

If you will notice, the linklist is now changing location, there is a quote box area, and the sig image is rotating. O_O I kinda got carried away for a bit in development. sweatdrop
Modification:
Random Images, Random Linklist, Random Quote Insertion

Level: VERY ADVANCED
Support: None right now

imagemap.class.php -unchanged

NEW FILE: image.php

<?PHP

define("NUMBER_OF_IMAGES", 2);

define("ALIGN_LEFT", 0);
define("ALIGN_CENTER", 1);
define("ALIGN_RIGHT", 2);
define("VALIGN_TOP", 0);
define("VALIGN_MIDDLE", 1);
define("VALIGN_BOTTOM", 2);

function imagestringbox(&$image, $font, $left, $top, $right, $bottom, $align, $valign, $leading, $text, $color) {
// Get size of box
$height = $bottom - $top;
$width = $right - $left;

// Break the text into lines, and into an array
$lines = wordwrap($text, floor($width / imagefontwidth($font)), "<br />", true);
$lines = explode("<br />", $lines);

// Other important numbers
$line_height = imagefontheight($font) + $leading;
$line_count = floor($height / $line_height);
$line_count = ($line_count > count($lines)) ? (count($lines)) : ($line_count);

// Loop through lines
for ($i = 0; $i < $line_count; $i++) {
// Vertical Align
switch ($valign) {
case VALIGN_TOP: // Top
$y = $top + ($i * $line_height);
break;
case VALIGN_MIDDLE: // Middle
$y = $top + (($height - ($line_count * $line_height)) / 2) + ($i * $line_height);
break;
case VALIGN_BOTTOM: // Bottom
$y = ($top + $height) - ($line_count * $line_height) + ($i * $line_height);
break;
default:
return false;
}

// Horizontal Align
$line_width = strlen($lines[$i]) * imagefontwidth($font);
switch ($align) {
case ALIGN_LEFT: // Left
$x = $left;
break;
case ALIGN_CENTER: // Center
$x = $left + (($width - $line_width) / 2);
break;
case ALIGN_RIGHT: // Right
$x = $left + ($width - $line_width);
break;
default:
return false;
}

// Draw
imagestring($image, $font, $x, $y, $lines[$i], $color);
}

return $image;
}


// seed random number
// srand((double)microtime()*1000000);

$image_number_name = str_pad((rand()%NUMBER_OF_IMAGES)+1,4,"0",STR_PAD_LEFT).".png";

$im_size = GetImageSize ($image_number_name);
$imageWidth = $im_size[0];
$imageHeight = $im_size[1];
$im = imagecreatetruecolor($imageWidth,$imageHeight);

$im2 = ImageCreateFromPNG($image_number_name);
ImageCopy ($im,$im2,0,0,0,0, $imageWidth, $imageHeight);
ImageDestroy ($im2);

// set some defaults
$font = 2;
$left = 0;
$top = 0;
$right = 500;
$bottom = 500;
$align = ALIGN_LEFT;
$valign = VALIGN_TOP;
$leading = 0;

switch($image_number_name) {
case "0001.png":
$font = 2;
$left = 10;
$top = 235;
$right = 490;
$bottom = 295;
$align = ALIGN_LEFT;
$valign = VALIGN_MIDDLE;
$leading = 0;
$color = imagecolorallocate($im, 0, 0, 0);
break;

case "0002.png":
$font = 2;
$left = 10;
$top = 175;
$right = 151;
$bottom = 366;
$align = ALIGN_LEFT;
$valign = VALIGN_TOP;
$leading = 0;
$color = imagecolorallocate($im, 21, 24, 101);
break;
}

// select a quote
$lines = file('quotes.txt');
$text = trim($lines[rand()%sizeof($lines)]);

// debug
// echo rand()%2;

imagestringbox($im, $font, $left, $top, $right, $bottom, $align, $valign, $leading, $text, $color);

// NEW: Drop a cookie about what image we used
setcookie("JakoboSigMap", $image_number_name,time()+60*60*24*30,"/",".felocity.org",0);

// Output
header("Content-type: image/png" wink ;
imagepng($im);

?>


MODIFIED map.php

<?PHP
/* Gaia Image Map Go-er
Rudolph J Heuser
*/

require_once("imagemap.class.php" wink ;

// new imageMap
$myImageMap = new imageMap();

// define regions
/*
$area = new Rect(,,,,"" wink ;
$myImageMap->addToMap($area);
*/

// HACK JAKOBO
// INSPIRED BY CHOGGO'S SOURCE
// 7-23-2004
$what_image = $_COOKIE["JakoboSigMap"];

if($what_image == "0001.png" wink {
// imagemap tutorial
$area = new Rect(329,42,491,53,"http://www.gaiaonline.com/forum/viewtopic.php?t=2469814" wink ;
$myImageMap->addToMap($area);

// The Daily Post
$area = new Rect(282,54,491,65,"http://www.gaiaonline.com/forum/viewtopic.php?t=2945499" wink ;
$myImageMap->addToMap($area);

// The Gaia Times
$area = new Rect(277,66,491,77,"http://www.gaiaonline.com/forum/viewtopic.php?p=150093441#150093441" wink ;
$myImageMap->addToMap($area);

// The Grey Kitsune
$area = new Rect(409,102,491,113,"http://www.gaiaonline.com/forum/viewtopic.php?t=329330" wink ;
$myImageMap->addToMap($area);

// Chord Hall
$area = new Rect(441,114,491,125,"http://www.gaiaonline.com/forum/viewtopic.php?t=2049197" wink ;
$myImageMap->addToMap($area);

// Charity for a Halo
$area = new Rect(408,150,491,161,"http://rufus.gaiaonline.com/forum/viewtopic.php?t=2771285" wink ;
$myImageMap->addToMap($area);

// mizu's ports quest
$area = new Rect(403,162,491,173,"http://www.gaiaonline.com/forum/viewtopic.php?t=2026160" wink ;
$myImageMap->addToMap($area);

// personal web site
$area = new Rect(345,198,491,209,"http://www.felocity.org" wink ;
$myImageMap->addToMap($area);

// fansub web site
$area = new Rect(313,210,491,221,"http://www.kaizoku-fansubs.com" wink ;
$myImageMap->addToMap($area);
}


if($what_image == "0002.png" wink {
// imagemap tutorial
$area = new Rect(5,18,180,32,"http://www.gaiaonline.com/forum/viewtopic.php?t=2469814" wink ;
$myImageMap->addToMap($area);
// The Daily Post
$area = new Rect(5,32,180,47,"http://www.gaiaonline.com/forum/viewtopic.php?t=2945499" wink ;
$myImageMap->addToMap($area);
// Project Halcyon
$area = new Rect(5,47,180,61,"http://www.gaiaonline.com/forum/viewtopic.php?t=1409276" wink ;
$myImageMap->addToMap($area);
// Nora Likes Art
$area = new Rect(5,61,180,75,"http://www.gaiaonline.com/forum/viewtopic.php?t=3106311" wink ;
$myImageMap->addToMap($area);
// Personal Web Site
$area = new Rect(5,75,180,90,"http://www.felocity.org" wink ;
$myImageMap->addToMap($area);
// Yaten Linking Action!
$area = new Rect(310,365,499,390,"http://www.gaiaonline.com/forum/viewtopic.php?t=2544460" wink ;
$myImageMap->addToMap($area);
$area = new Rect(415,310,499,365,"http://www.gaiaonline.com/forum/viewtopic.php?t=2544460" wink ;
$myImageMap->addToMap($area);
}



// load my profile if all else fails
// or if cookies are diabled
$myImageMap->setDefaultURL("http://www.gaiaonline.com/forum/profile.php?mode=viewprofile&u=507907" wink ;

// 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);

?>


NEW quotes.txr

dri: i've got more stupidity than i know what to do with it XP<br />Wolfie: try sell it in the marketplace...ppl go crazy for stupidity
siryn: I WILL EAT YOU, SUSHI!<br />Jakobo: maybe this is how the programmers remember how to eat?<br />* Jakobo sees sushi error, remembers he skipped dinner, eats.*
#go-gaia@irc.mynapster.net<br />Puck: <3<br />Puck: KISSY, NOT ASSHAT
siryn probably owns my soul for giving me an Angelic Scarf...
Pisho, something is wrong with mine xd *PMs you* ^^;

Quick Reply

Submit
Manage Your Items
Other Stuff
Get GCash
Offers
Get Items
More Items
Where Everyone Hangs Out
Other Community Areas
Virtual Spaces
Fun Stuff
Gaia's Games
Mini-Games
Play with GCash
Play with Platinum
//
//

Join Now

// //

Have an account? Login Now!

//
//