Page 1 of 2 12 LastLast
Results 1 to 10 of 18
  1. #1
    Join Date
    Apr 2006
    Location
    England
    Posts
    1,159
    Tokens
    0

    Latest Awards:

    Post [PHP] Displying the amount of Habbos online

    Aye,

    Welcome to a short tutorial which will teach you how to display the amount of Habbos Online the hotel.

    Firstly, you need to create a .php document.

    Inside your .php file, insert/add this code:
    PHP Code:
    <?php
    $page 
    file_get_contents("http://www.habbo.co.uk"); // Change the URL to the hotel you would like
    $start explode('<span class="stats-fig">'$page2);
    $end explode('</span>'$start[1], 2);
    $amount trim($end[0]);
    echo 
    "There are $amount Habbos online!"// Set the message you want to be displayed (Leave in the $amount)
    ?>
    If there was 10001 Habbos Online http://habbohotel.co.uk then the output of this code would be as follows:
    There are currently 10001 Habbos on the UK Hotel!

    The code is very easy to alter.
    If there are any problems, let me know! PM me or send them as a reply.

    Edited by --ss-- (Forum Super Moderator): The code has been updated to work with the current version .
    Last edited by --ss--; 01-02-2008 at 07:23 PM.
    REMOVED

    Edited by jesus (Forum Super Moderator): Please do not have text in your signature which is over size 4.

  2. #2
    Join Date
    Dec 2005
    Posts
    724
    Tokens
    0

    Default

    This has been posted befor, try searching next time.Good tut though
    Starting webdesign again.

  3. #3
    Join Date
    Sep 2006
    Location
    Coventry
    Posts
    1,235
    Tokens
    0

    Latest Awards:


  4. #4
    Join Date
    Sep 2006
    Location
    Wakefield, West Yorkshire
    Posts
    162
    Tokens
    0

    Default

    Try this code HA33OX

    PHP Code:
    <?php
    $page 
    file_get_contents("http://www.habbo.co.uk");
    $start explode('<td id="topbar-count">'$page2);
    $end explode(' Habbos online</td>'$start[1], 2);
    $amount trim($end[0]);
    echo 
    "There are $amount Habbos online!";
    ?>
    Left. Or have I?

  5. #5
    Join Date
    Apr 2006
    Location
    Australia
    Posts
    307
    Tokens
    0

    Default

    Anyone got the updated version of this since habbo Home?

  6. #6
    Join Date
    Jul 2004
    Location
    Sunshine Coast, Queensland, AU
    Posts
    1,830
    Tokens
    467

    Latest Awards:

    Default

    could u do something like instead of habbo yoursite.com?

  7. #7
    Join Date
    Aug 2006
    Location
    London
    Posts
    1,907
    Tokens
    0

    Latest Awards:

    Default

    Quote Originally Posted by Rix View Post
    could u do something like instead of habbo yoursite.com?
    Just what I was thinking

  8. #8
    Join Date
    Jan 2007
    Posts
    825
    Tokens
    0

    Default

    Lol'd at senior thing!

    Also Quite good PHP
    That post was really sensible!

  9. #9
    Join Date
    Feb 2007
    Posts
    286
    Tokens
    0

    Default

    Mmmm
    I could have got that
    but thanks.
    - AppleMod.com
    - Visit & Join

  10. #10
    Join Date
    Oct 2005
    Location
    Melbourne, Australia
    Posts
    7,554
    Tokens
    0

    Latest Awards:

    Default

    if you need the new code it is
    PHP Code:
    <?php
    $page 
    file_get_contents("http://www.habbo.co.uk");
    $start explode('<td id="topbar-count">'$page2);
    $end explode(' members online</td>'$start[1], 2);
    $amount trim($end[0]);
    echo 
    "There are $amount Habbos online!";
    ?>
    edit: i used-1. 's code and changed it to show the new one

Page 1 of 2 12 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
  •