PDA

View Full Version : [TUT] Status Sig - Autoupdate Motto Symbol Link



Unsuspected
27-02-2008, 09:46 AM
Ok, I know most people would probably consider Status Sigs to be an old "phase" maybe, but I figured this would be helpful for the people who still make them. So please hold your comments about it being old.

Many status sigs used are troubled with a big problem when it comes to mottos. symbols such as http://images.habbohotel.ca/habboweb/20_7c04546c82da9ce33b1eeeec08ad80c9/7/web-gallery/images/fonts/volter/165.gif or http://images.habbohotel.ca/habboweb/20_7c04546c82da9ce33b1eeeec08ad80c9/7/web-gallery/images/fonts/volter/170.gif turn into "<img src=..." in most status sigs.
Example:
http://wck.xplodehost.com/ehabbo/ca/uaq
This is because the habbo motto's displayed on habbo homes show symbols as GIF pictures, not writing.

The biggest problem about this is the creators must maintain the symbols showing instead of the HTML coding. the creators have to update it in the habboProfile PHP file. This gets fairly annoying when habbo changes the LINK to these images every couple of weeks. Which means the creators had to correct the link (for each symbol) in the habboProfile every couple of weeks.

I have just devised a way to make these links update THEMSELVES. That's right. You status sig makers and users no longer have to worry about those annoying HTML codes on the the mottos.

So how's it done? Let me explain.

First, you need to configure a FUNCTION for the update in your habboClass.PHP file. You can put it just about anywhere in the file, but for organization, I suggest putting it in after the motto function:


function motto()
{
$motto = explode('<div class="profile-motto">', $this->data);
$motto = explode('</div>', $motto[1]);
$motto = trim($motto[0]);
$motto = str_replace(' <div class="clear">', '', $motto);
return $motto;
}

When you find that line, add this in after it:


function mottosym()
{
$mottosym = explode('<img src="http://images.habbohotel.'.$this->hotel.'/habboweb/', $this->data);
$mottosym = explode('/web-gallery/', $mottosym[1]);
$mottosym = trim($mottosym[0]);
return $mottosym;
}

Let me explain how this works. Every habbo symbol link on a motto will look like this:


http://images.habbohotel.ca/habboweb/20_7c04546c82da9ce33b1eeeec08ad80c9/7/web-gallery/images/fonts/volter/170.gif

The part that habbo changes constantly is the "20_7c04546c82da9ce33b1eeeec08ad80c9/7" part.
This function will search the habbo home page's HTML for this:


http://images.habbohotel.{whatever hotel the sig is for}/habboweb/

After it finds that part of the link, it will start gathering the information, aka, the part of the link that always changes. However, you need it to stop gaining information after the changing part of the link, so this function code will make it stop gaining info when it finds "/web-gallery/". So there it is. Your function now perfectly captures the "20_7c04546c82da9ce33b1eeeec08ad80c9/7".

That's only the first part though, you now need to edit this function into your habboProfile(s). Just go into your habboProfile(s) now and look for this line:


$habboMotto = $habboHome->motto();

After you find that, add in this line:


$symbol = ($habboHome->mottosym());

This works by searching anything in your habboProfile that says "$symbol" and changing it into the information gained by the "mottosym" function you put in your habboClass file.

After that line, you need to add all of these lines:

$habboMotto = eregi_replace('<img src="http://images.habbohotel.[HOTEL]/habboweb/'.$symbol.'/web-gallery/images/fonts/volter/170.gif" class="vchar" />', 'ª', $habboMotto);
$habboMotto = eregi_replace('<img src="http://images.habbohotel.[HOTEL]/habboweb/'.$symbol.'/web-gallery/images/fonts/volter/247.gif" class="vchar" />', '÷', $habboMotto);
$habboMotto = eregi_replace('<img src="http://images.habbohotel.[HOTEL]/habboweb/'.$symbol.'/web-gallery/images/fonts/volter/165.gif" class="vchar" />', '¥', $habboMotto);
$habboMotto = eregi_replace('<img src="http://images.habbohotel.[HOTEL]/habboweb/'.$symbol.'/web-gallery/images/fonts/volter/186.gif" class="vchar" />', 'º', $habboMotto);
$habboMotto = eregi_replace('<img src="http://images.habbohotel.[HOTEL]/habboweb/'.$symbol.'/web-gallery/images/fonts/volter/187.gif" class="vchar" />', '»', $habboMotto);
$habboMotto = eregi_replace('<img src="http://images.habbohotel.[HOTEL]/habboweb/'.$symbol.'/web-gallery/images/fonts/volter/172.gif" class="vchar" />', '¬', $habboMotto);
$habboMotto = eregi_replace('<img src="http://images.habbohotel.[HOTEL]/habboweb/'.$symbol.'/web-gallery/images/fonts/volter/177.gif" class="vchar" />', '±', $habboMotto);
$habboMotto = eregi_replace('<img src="http://images.habbohotel.[HOTEL]/habboweb/'.$symbol.'/web-gallery/images/fonts/volter/182.gif" class="vchar" />', '¶', $habboMotto);
$habboMotto = eregi_replace('<img src="http://images.habbohotel.[HOTEL]/habboweb/'.$symbol.'/web-gallery/images/fonts/volter/181.gif" class="vchar" />', 'µ', $habboMotto);
$habboMotto = eregi_replace('<img src="http://images.habbohotel.[HOTEL]/habboweb/'.$symbol.'/web-gallery/images/fonts/volter/131.gif" class="vchar" />', 'ƒ', $habboMotto);
(Remember to change the [HOTEL] part to the hotel your habboProfile is for.)

This works by changing any habbo symbol HTML found in anyone's habbo motto into the actual habbo symbol it is meant to display. Best of all, because of the "$symbol" code, you will never need to update it when the link is changed.

Hope you understood and enjoyed this neat tidbit about status sigs! If you have any questions, I'd be happy to help as much as I can!

e5
27-02-2008, 09:59 AM
Nice TUT =]!

jesus
27-02-2008, 10:37 AM
Very nice guide, I'm sure it will help many people. +Rep for your effort. :)

Off-topic: I just made your rep power go from 0 to 2. :O!

Want to hide these adverts? Register an account for free!