Customizing Your Cool Guestmap 2

Someone recently asked me how I changed my cool guestmap 2 so that it now has a “special” icon for my location and how I made it stand out by being on top of the rest (never covered up). Instead of sending a private email to him, I figured I would post it for all to see.

First, find an icon for yourself that will stand out from the crowd. Keep it to right about the size of the other icons (the one I used is 25×23). I wanted a red pulsing X (X marks the spot) but I couldn’t find one. I opted instead for this colorful animated star gif.Animated Star

Put your icon in the same directory as the other icons, but rename it to 255.gif. Now, place an icon on your map to represent where YOU are located – choose ANY icon (your new one won’t be an option). Now, you have ot go into your database and make a change.

Here are the steps I had to take – yours may vary slightly:
login to mysql console
use coolmap;
Since yours is the first entry, yours should be id #1, so now change your icon to 255:
update guestmap2 set icon=255 where id=1;
Now your icon should be your new one. Go check. I’ll wait.

The icons are ordered by date, so newer ones will be on top of older ones. Since yours is the first, it will be the oldest and therefore at the bottom of the pile. What we want to do is order by date so that yours is the LAST to be shown (and therefore on top). Now, to make your icon stay on top, you need to edit the icons.php file. You’ll see a line like this:

if(MAX_ICONS > 0) {
$extra = " ORDER BY date DESC LIMIT 0,".MAX_ICONS;
}

change it to:

if(MAX_ICONS > 0) {
$extra = " ORDER BY date LIMIT 0,".MAX_ICONS;
}

that will make your icon stay on top.

Now, one more thing….by default, the guestmap fades the icons as they get older. Since my icon will always be the oldest, I don’t want it to fade, so I needed to make a change so none would fade. Look again in icons.php and change MAX_ICONS (at the top) to a large number (I used 1000) and change MIN_OPACITY from 25 to 99.

That’s it! Let me know if this works for you or if you have any questions. Much thanks goes to the author of CGM2. for writing it in the first place and then for helping me out with these changes. He also made an RSS script for me to keep an eye on the new people in the map – if anyone wants that I can share – just let me know if there is an interest.

Technorati: ,

2 thoughts on “Customizing Your Cool Guestmap 2

  1. MyGalleries

    Hi,

    Thank you for your useful tip on how to keep my icon on top for Cool Guestmap 2. It works great!!

    Can you send me the RSS script to keep an eye on new people added to the Guestmap? Thank you.

    Regards,

    – MyGalleries

    RESPONSE: Yes. Email me directly and I’ll get it to you. –Brian

    Reply
  2. Ian

    Hello,
    Thanks for the tips for Cool guestmap 2.
    Withe regards to Cool guestmap2
    Please can you help my ISP requers that all PHP scrip is seperated from the pic’s and the HTMl code.
    I have maniged to get most of this done but can’t get the icons to aperar in the form as ther are no icons to chose from then I cant input to the table.
    Any segestions.
    I have not been coding PHP for long and it think I have hit my current limit.
    Thanks
    Ian

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *