Discover Habbo's history
Treat yourself with a Secret Santa gift.... of a random Wiki page for you to start exploring Habbo's history!
Happy holidays!
Celebrate with us at Habbox on the hotel, on our Forum and right here!
Join Habbox!
One of us! One of us! Click here to see the roles you could take as part of the Habbox community!


Page 1 of 3 123 LastLast
Results 1 to 10 of 23
  1. #1
    Join Date
    Mar 2008
    Location
    Swindon, UK
    Posts
    1,274
    Tokens
    187
    Habbo
    :Ltd

    Latest Awards:

    Default Random habbos.... lalala.

    http://www.driftpanzy.co.uk/habbo/index.php


    Got bored, im tired so prob some mistakes or some critics want to be clever and prove something that ive done wrong to make them loook bigg but OH WELL!

    PHP Code:
    <style>
    .online {
    border-bottom-style:dashed;
    border-top-style:dashed;
    border-left-style:dashed;
    border-right-style:dashed;
    border-top-width:thin;
    border-bottom-width:thin;
    border-left-width:thin;
    border-right-width:thin;
    border-bottom-color:#666666;
    border-top-color:#666666;
    border-left-color:#666666;
    border-right-color:#666666;
    font-family:Tahoma;
    font-size:12px;
    font-style:normal;
    background: #EFEFEF;
    }
    .offline {
    border-bottom-style:dashed;
    border-top-style:dashed;
    border-left-style:dashed;
    border-right-style:dashed;
    border-top-width:thin;
    border-bottom-width:thin;
    border-left-width:thin;
    border-right-width:thin;
    border-bottom-color:#333333;
    border-top-color:#333333;
    border-left-color:#333333;
    border-right-color:#333333;
    font-family:Tahoma;
    font-size:12px;
    font-style:normal;
    }
    </style>
    <?php
    // lalala. random habbos..
    $ch curl_init();
    curl_setopt($chCURLOPT_URL"http://www.habbo.co.uk/habblet/xml/promo_habbos");
    curl_setopt($chCURLOPT_RETURNTRANSFER1);
    $file curl_exec($ch);
    $filename "habbos.xml";
    if (
    is_writable($filename)) {
        if (!
    $handle fopen($filename'w')) {
            exit; }
        if (
    fwrite($handle$file) === FALSE) {
            exit; }
        
    fclose($handle);
        
    curl_close($ch);
    }
    if(
    file_exists("habbos.xml")) {
        
    $loadit simplexml_load_file("habbos.xml");
        
    $rows 0;
        
    $cols 0;
        echo(
    '<table width="400" border="0"><tr>');
        foreach (
    $loadit->children() as $fetch) {
            
    $name $fetch["name"];
            
    $url $fetch["url"];
            
    $status $fetch["status"];
            
    $group $fetch["groupBadge"];
            
    $badge $fetch["badge"];
            
    $image 'http://www.habbo.co.uk/habbo-imaging/avatarimage?user='.$name.'&action=&direction=3&head_direction=3&gesture=sml&size=l';
            if(
    $status == "1") {
                
    $status "habbo_online_anim.gif";
                
    $class "online";
            } else {
                
    $status "habbo_offline.gif";
                
    $class "offline"; }
            if(
    $badge == "") { $ihc "dot_clear.gif";
            } else { 
    $ihc $badge; }
            if(
    $group == "") { $badge "dot_clear.gif";
            } else { 
    $badge "http://www.habbo.co.uk".$group; }
            if(
    $rows 2) {
            if(
    $cols 4) {
                echo(
    '<td><table width="150" class="'.$class.'" border="0"><tr><td><center><img src="'.$ihc.'"></center></td><td><center><img src="'.$image.'"></center></td><td><center><img src="'.$badge.'"></center></td></tr><tr><td colspan="3"><center>'.$name.'</center></td></tr><tr><td colspan="3"><center><img src="'.$status.'"></center></td></tr></table></td>');
                
    $cols++;
            } else {
                if(
    $rows 1) {
                echo(
    '</tr><tr><td><table width="150" class="'.$class.'" border="0"><tr><td><center><img src="'.$ihc.'"></center></td><td><center><img src="'.$image.'"></center></td><td><center><img src="'.$badge.'"></center></td></tr><tr><td colspan="3"><center>'.$name.'</center></td></tr><tr><td colspan="3"><center><img src="'.$status.'"></center></td></tr></table></td>');
                
    $rows++;
                
    $cols 1; } }
            } else {
                echo(
    '</td></table>'); }
        }
    } else { exit(
    "Failed to load."); }
    ?>
    have habbos.xml created in the DIRECTORY and get the images that you need off of my live example...

    http://www.driftpanzy.co.uk/habbo/index.php


    WORD UP! im boooooooooooored what should i doooooooooooooooo
    Last edited by Protege; 13-04-2008 at 12:26 AM.
    Hi, names James. I am a web developer.

  2. #2
    Join Date
    Oct 2006
    Location
    BUXTON
    Posts
    2,191
    Tokens
    0

    Latest Awards:

    Default

    Thats Pritty cool... +rep

  3. #3
    Join Date
    Aug 2006
    Location
    Manchester, UK
    Posts
    2,016
    Tokens
    141
    Habbo
    florx

    Latest Awards:

    Default

    Good stuff but why did you "download" the data off the habbo server then use that new file to get the data?

    It would be quicker just to get the data off the habbo server live?

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

    Latest Awards:

    Default

    cuz it wasn't working and this was likely cause I was using WAMP on my PC when making it, if it works direct from Habbo, do it that way and it will be faster.
    Hi, names James. I am a web developer.

  5. #5
    Join Date
    Dec 2006
    Location
    Swindon
    Posts
    3,299
    Tokens
    215
    Habbo
    dunko

    Latest Awards:

    Default

    No online habbo's come up for me

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

    Latest Awards:

    Default

    Its pulling them out at random, theres more offline than online people. When someones online you will get a different background on the box and "online", I can probably code it to grab until it gets online, but that be a lot of bandwidth usage most likely.

    I'm working on the flash version of it too which is fun. ;]
    Hi, names James. I am a web developer.

  7. #7
    Join Date
    Mar 2008
    Posts
    5,108
    Tokens
    3,780

    Latest Awards:

    Default

    Why don't you just use file_get_contents?

    PHP Code:
    <?php
    $xml_file 
    file_get_contents"http://www.habbo.co.uk/habblet/xml/promo_habbos" ); // Grabs XML file.

    $simplexml = new SimpleXMLElement$xml_file );

    ?>

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

    Latest Awards:

    Default

    I use methods that suit me, I program in my own style not yours - do your method if you must amend my code.
    Hi, names James. I am a web developer.

  9. #9
    Join Date
    Mar 2008
    Posts
    5,108
    Tokens
    3,780

    Latest Awards:

    Default

    I'm not downsizing your methods, I am just saying.. if you wanted an easier way to do it.. that would be an easier way.

    No use to bring CURL in for something that small of a task.

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

    Latest Awards:

    Default

    It seemed logical at the time, seeing as I was extremely tired I think it was an alright decision.
    Hi, names James. I am a web developer.

Page 1 of 3 123 LastLast

Posting Permissions

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