Ok, so I need a PHP script to show a habbo user's motto, and did find a script but it doesn't actually seem to work.
But if you have a better script than this/working one, please pass it to me. I would be also appreciated if you made that one working.
My errors:
PHP:
<?php
class generator
{
var $data;
var $habboname;
var $hotel;
var $url;
function generator( $habboname, $hotel )
{
$this->habboname = $habboname;
$this->hotel = $hotel;
$this->url = "http://habbo." . $hotel . "/home/" . $habboname;
$this->data = @file_get_contents( $this->url );
}
function offline() {
if( eregi( "User personal habbo page is hidden", $this->data ) or !$this->name() ) {
return true;
}
else {
return false;
}
}
function online()
{
if ( eregi( "habbo_online_anim.gif", $this->data ) )
{
return true;
}
else
{
return false;
}
}
function motto()
{
$motto = explode( "<div class=\"profile-motto\">", $this->data );
$motto = explode( "<div", $motto[1] );
$motto = trim($motto[0]);
return $motto;
}
function badge()
{
if( eregi( "c_images/album1584/", $this->data ) )
{
$badge = explode( "/c_images/album1584/", $this->data );
$badge = explode( ".gif", $badge[1] );
$badge = trim( $badge[0] );
$badge = "http://images.habbo.com/c_images/album1584/" . $badge . ".gif";
return $badge;
}
else
{
return false;
}
}
function figure()
{
$figure = "http://www.habbo." . $this->hotel . "/habbo-imaging/avatarimage?user=" . $this->habboname . "&action=&direction=2&head_direction=3&gesture=sml&size=l&img_format=gif";
return $figure;
}
function birthDate()
{
$birthdate = explode( "<div class=\"birthday date\">", $this->data );
$birthdate = explode( "</div>", $birthdate[1] );
$birthdate = trim( $birthdate[0] );
return $birthdate;
}
function name()
{
$name = explode( "<span class=\"name-text\">", $this->data );
$name = explode( "</span>", $name[1] );
$name = trim( $name[0] );
return $name;
}
function groupBadge()
{
if( eregi( "/habbo-imaging/badge/", $this->data ) )
{
$badge = explode( "/habbo-imaging/badge/", $this->data );
$badge = explode( ".gif", $badge[1] );
$badge = trim( $badge[0] );
$badge = "http://www.habbo." . $this->hotel . "/habbo-imaging/badge/" . $badge . ".gif";
return $badge;
}
else
{
return false;
}
}
}
$habbo = $_GET['name'];
switch( $_GET['hotel'] ) {
case 'au':
$hotel = "com.au";
break;
case 'sg':
$hotel = "com.sg";
break;
case 'us':
$hotel = "com";
break;
case 'ca':
$hotel = "ca";
break;
default:
$hotel = "co.uk";
break;
}
?>
<?php
if( $motto = $data->name() ){
echo $motto;
}
?>
But if you have a better script than this/working one, please pass it to me. I would be also appreciated if you made that one working.
My errors:
PHP:
Notice: Undefined index: name in C:\Xampp\htdocs\Files\index.php on line 146
Notice: Undefined index: hotel in C:\Xampp\htdocs\Files\index.php on line 148
Notice: Undefined variable: data in C:\Xampp\htdocs\Files\index.php on line 173
Fatal error: Call to a member function name() on a non-object in C:\Xampp\htdocs\Files\index.php on line 173