Results 1 to 6 of 6
  1. #1
    Join Date
    Sep 2007
    Posts
    31
    Tokens
    0

    Default PHP source HabboClass function.

    Hey Guys, ive found a php code at the internet. That shows habbo's badge - Also not the Group badge but the orginal.
    <?
    echo getHabboBadge($habboHome);
    ?>

    That is the code im using to grab users badge, is it possible to do if the user dosent have a badge on the habbo. Then the picture will dosent show up.

    Thanks for your help !

  2. #2
    Join Date
    Mar 2006
    Posts
    121
    Tokens
    0

    Default

    Does that even work? :S

  3. #3
    Join Date
    Mar 2008
    Location
    Swindon, UK
    Posts
    1,274
    Tokens
    187
    Habbo
    :Ltd

    Latest Awards:

    Default

    Thats not a code thats a function you are calling. If you want help you've got to provide the code behind that.
    Hi, names James. I am a web developer.

  4. #4
    Join Date
    Mar 2006
    Posts
    121
    Tokens
    0

    Default

    Quote Originally Posted by DriftPanzy View Post
    Thats not a code thats a function you are calling. If you want help you've got to provide the code behind that.
    Yeah, that's what I thought..

  5. #5
    Join Date
    Sep 2007
    Posts
    31
    Tokens
    0

    Default

    PHP Code:
    <?php
     
     
     
     
     
     
     
     
     
     
     
    function setHome($Hotel$HabboName//Set a variable has data from the Habbo Home
     
     
     
    {
     
     
     
        if (!
    $Hotel or !$HabboName)
     
     
     
        {
     
     
     
            return 
    false;
     
     
     
        }
     
     
     
        else
     
     
     
        {
     
     
     
            
    $homeData file_get_contents("http://habbohotel." $Hotel "/home/" $HabboName);
     
     
     
            return 
    $homeData;
     
     
     
        }
     
     
     
    }
     
     
     
     
     
     
     
    function 
    isBanned($Home//Check if a habbo is banned
     
     
     
    {
     
     
     
        if (!
    $Home)
     
     
     
        {
     
     
     
            return 
    false;
     
     
     
        }
     
     
     
        else
     
     
     
        {
     
     
     
            if (
    eregi("This page is not available anymore"$Home))
     
     
     
            {
     
     
     
                return 
    true;
     
     
     
            }
     
     
     
            else
     
     
     
            {
     
     
     
                return 
    false;
     
     
     
            }
     
     
     
        }
     
     
     
    }
     
     
     
     
     
     
     
    function 
    isPrivate($Home//Check if a Habbo Home is private
     
     
     
    {
     
     
     
        if (!
    $Home)
     
     
     
        {
     
     
     
            return 
    false;
     
     
     
        }
     
     
     
        else
     
     
     
        {
     
     
     
            if (
    eregi("</span> marked this page as private."$Home))
     
     
     
            {
     
     
     
                return 
    true;
     
     
     
            }
     
     
     
            else
     
     
     
            {
     
     
     
                return 
    false;
     
     
     
            }
     
     
     
        }
     
     
     
    }
     
     
     
     
     
     
     
    function 
    habboExists($Home//See if a Habbo exists
     
     
     
    {
     
     
     
        if (!
    $Home)
     
     
     
        {
     
     
     
            return 
    false;
     
     
     
        }
     
     
     
        else
     
     
     
        {
     
     
     
            if (
    eregi('<div id="page-headline-text">Habbo Homes</div>'$Home))
     
     
     
            {
     
     
     
                return 
    false;
     
     
     
            }
     
     
     
            else
     
     
     
            {
     
     
     
                return 
    true;
     
     
     
            }
     
     
     
        }
     
     
     
     
     
     
     
    }
     
     
     
     
     
     
     
    function 
    isOnline($Home//See if a Habbo is online
     
     
     
    {
     
     
     
        if (!
    $Home)
     
     
     
        {
     
     
     
            return 
    false;
     
     
     
        }
     
     
     
        else
     
     
     
        {
     
     
     
            if (
    eregi("habbo_online_anim.gif"$Home))
     
     
     
            {
     
     
     
                return 
    true;
     
     
     
            }
     
     
     
            else
     
     
     
            {
     
     
     
                return 
    false;
     
     
     
            }
     
     
     
        }
     
     
     
    }
     
     
     
     
     
     
     
    function 
    getHabboMotto($Home//Grab the Habbos motto
     
     
     
    {
     
     
     
        if (!
    $Home)
     
     
     
        {
     
     
     
            return 
    false;
     
     
     
        }
     
     
     
        else
     
     
     
        {
     
     
     
            
    $mottoStart explode('<div class="profile-motto">'$Home);
     
     
     
            
    $mottoEnd explode('</div>'$mottoStart[1]);
     
     
     
            
    $mottoTrim trim($mottoEnd[0]);
     
     
     
            
    $motto str_replace('  <div class="clear">'''$mottoTrim);
     
     
     
            return 
    $motto;
     
     
     
        }
     
     
     
    }
     
     
     
     
     
     
     
    function 
    getHabboName($Home//Get the Habbos name in full casing
     
     
     
    {
     
     
     
        if (!
    $Home)
     
     
     
        {
     
     
     
            return 
    false;
     
     
     
        }
     
     
     
        else
     
     
     
        {
     
     
     
            if (
    eregi("This page is not available anymore"$Home))
     
     
     
            {
     
     
     
                
    $nameStart explode(
     
     
     
                    
    'This page is not available anymore, <span style="font-weight: bold;">'$Home);
     
     
     
                
    $nameEnd explode('</span> was banned<br />'$nameStart[1]);
     
     
     
                
    $name trim($nameEnd[0]);
     
     
     
                return 
    $name;
     
     
     
            }
     
     
     
            elseif (
    eregi("</span> marked this page as private."$Home))
     
     
     
            {
     
     
     
                
    $nameStart explode(
     
     
     
                    
    'src="http://images.habbohotel.co.uk/c_images/album1358/frank_stop_001.gif" / alt="">',
     
     
     
                    
    $Home);
     
     
     
                
    $nameEnd explode("</span> marked this page as private."$nameStart[1]);
     
     
     
                
    $name trim($nameEnd[0]);
     
     
     
                return 
    $name;
     
     
     
            }
     
     
     
            else
     
     
     
            {
     
     
     
                
    $nameStart explode("<title>Habbo ~ Habbo home: "$Home);
     
     
     
                
    $nameEnd explode("</title>"$nameStart[1]);
     
     
     
                
    $name trim($nameEnd[0]);
     
     
     
                return 
    $name;
     
     
     
            }
     
     
     
        }
     
     
     
    }
     
     
     
     
     
     
     
    function 
    getHabboBadge($Home//Grab the habbos badge
     
     
     
    {
     
     
     
        if (!
    $Home)
     
     
     
        {
     
     
     
            return 
    false;
     
     
     
        }
     
     
     
        else
     
     
     
        {
     
     
     
            if (
    eregi("c_images/album1584/"$Home))
     
     
     
            {
     
     
     
                
    $extensionStart explode("http://images.habbohotel."$Home);
     
     
     
                
    $extensionEnd explode("/"$extensionStart[1]);
     
     
     
                
    $extension trim($extensionEnd[0]);
     
     
     
                
    $badgeStart explode("http://images.habbohotel." $extension .
     
     
     
                    
    "/c_images/album1584/"$Home);
     
     
     
                
    $badgeEnd explode(".gif"$badgeStart[1]);
     
     
     
                
    $badgeTrim trim($badgeEnd[0]);
     
     
     
                
    $badge "http://images.habbohotel." $extension "/c_images/album1584/" $badgeTrim .
     
     
     
                    
    ".gif";
     
     
     
                return 
    $badge;
     
     
     
            }
     
     
     
            else
     
     
     
            {
     
     
     
                return 
    false;
     
     
     
            }
     
     
     
        }
     
     
     
    }
     
     
     
     
     
     
     
    function 
    getHabboFigure($Home//Get the Habbos Figure
     
     
     
    {
     
     
     
        if (!
    $Home)
     
     
     
        {
     
     
     
            return 
    false;
     
     
     
        }
     
     
     
        else
     
     
     
        {
     
     
     
            
    $figureStart explode('<div class="profile-figure">'$Home);
     
     
     
            
    $figureEnd explode('</div>'$figureStart[1]);
     
     
     
            
    $figureTrim trim($figureEnd[0]);
     
     
     
            
    $figure preg_replace('/<img alt=\"(.*?)\" src=\"(.*?)\" \/>/''$2'$figureTrim);
     
     
     
            
    $hotelStart explode('<div id="habbologo"><a href="'$Home);
     
     
     
            
    $hotelEnd explode('/"></a></div>'$hotelStart[1]);
     
     
     
            
    $hotel trim($hotelEnd[0]);
     
     
     
            
    $figure $hotel $figure;
     
     
     
            return 
    $figure;
     
     
     
        }
     
     
     
    }
     
     
     
     
     
     
     
    function 
    getHabboBirthdate($Home//Grab the date a Habbo was born
     
     
     
    {
     
     
     
        if (!
    $Home)
     
     
     
        {
     
     
     
            return 
    false;
     
     
     
        }
     
     
     
        else
     
     
     
        {
     
     
     
            
    $birthdateStart explode('<div class="birthday date">'$Home);
     
     
     
            
    $birthdateEnd explode('</div>'$birthdateStart[1]);
     
     
     
            
    $birthdate trim($birthdateEnd[0]);
     
     
     
            return 
    $birthdate;
     
     
     
        }
     
     
     
    }
     
     
     
     
     
     
     
    function 
    getHabbosOnline($Home//Get the amount of habbos online
     
     
     
    {
     
     
     
        if (!
    $Home)
     
     
     
        {
     
     
     
            return 
    false;
     
     
     
     
     
     
     
        }
     
     
     
        else
     
     
     
        {
     
     
     
            
    $onlineStart explode('<td id="topbar-count">'$Home);
     
     
     
            
    $onlineEnd explode(' Habbos online</td>'$onlineStart[1]);
     
     
     
            
    $onlineTrim trim($onlineEnd[0]);
     
     
     
            
    $online eregi_replace(","""$onlineTrim);
     
     
     
            return 
    $online;
     
     
     
        }
     
     
     
    }
     
     
     
    ?>

    That is the code behind it Hope you can help.

  6. #6
    Join Date
    Mar 2008
    Location
    Swindon, UK
    Posts
    1,274
    Tokens
    187
    Habbo
    :Ltd

    Latest Awards:

    Default

    Who EVER did that, is horrible.

    I took some of the whitespaces out of the few functions but I dont see why he over used functions

    PHP Code:
    function setHome($Hotel$HabboName) {
        if (!
    $Hotel or !$HabboName) {
            return 
    false;
            } else {
                
    $homeData file_get_contents("http://habbohotel." $Hotel "/home/" $HabboName);
                return 
    $homeData;
                }
        }

    function 
    isBanned($Home) {
        if (!
    $Home) {
            return 
    false;
            } else {
                if (
    eregi("This page is not available anymore"$Home)) {
                    return 
    true;
                    } else {
                        return 
    false;
                        }
                }
        }

    function 
    isPrivate($Home) {
        if (!
    $Home) {
            return 
    false;
            } else {
                if (
    eregi("</span> marked this page as private."$Home)) {
                    return 
    true;
                    } else {
                        return 
    false;
                        }
                }
        }

    function 
    habboExists($Home) {
        if (!
    $Home) {
            return 
    false;
            } else {
                if (
    eregi('<div id="page-headline-text">Habbo Homes</div>'$Home)) {
                    return 
    false;
                    } else {
                        return 
    true;
                        }
                }
        }

    function 
    isOnline($Home) {
        if (!
    $Home) {
            return 
    false;
            } else {
                if (
    eregi("habbo_online_anim.gif"$Home)) {
                    return 
    true;
                    } else {
                        return 
    false;
                        }
                }
        } 
    If you return the PHP with it nice and clean like above someone might help.
    Hi, names James. I am a web developer.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •