示例#1
0
 public function __construct($datatable)
 {
     if (!$datatable || !is_array($datatable)) {
         $this->Success = false;
         return;
     }
     $this->id = $datatable["id"];
     $this->Article = new ArticleItemObject($datatable);
     $this->Comments = new ArticleCommentManager($datatable["id"]);
     $this->Success = true;
     $this->Vote = new ArticleLikesManager($this->id);
     $this->Author = UserManager::GetHabboById($datatable["author"]);
 }
 public function ToArray()
 {
     $users = [];
     foreach ($this->Likes as $like) {
         $user = Habbo::GetHabboById($like->user_id);
         if (!$user) {
             continue;
         }
         $users[] = ["username" => $user->username, "look" => $user->look];
     }
     $arr = ["count" => $this->Count(), "users" => $users];
     return $arr;
 }
示例#3
0
 public function GetHabbo()
 {
     return Habbo::GetHabboById($this->userbase_id == $this->user_one_id ? $this->user_two_id : $this->user_one_id);
 }
示例#4
0
 public function GetHabbo()
 {
     return Habbo::GetHabboById($this->user_id);
 }
示例#5
0
    $habbo = Habbo::GetHabboByName($username);
} else {
    $habbo = Habbo::GetHabboById($userid);
}
if (!$habbo) {
    do_error("USER_NOT_FOUND");
}
$jsondata = [];
$userdata = ["username" => $habbo->username, "motto" => $habbo->motto, "look" => $habbo->look, "last_online" => $habbo->last_online, "account_created" => $habbo->account_created, "seasonal_currency" => $habbo->seasonal_currency, "credits" => $habbo->credits, "activity_points" => $habbo->activity_points];
$relations = [];
$badges = [];
$rooms = Rooms::GetRoomsByOwnerName($habbo->username)->ParseToPublicArray();
### Get RelatioShips
$query = DB::RunFastQuery("SELECT * FROM users_relationships WHERE user_id = '{$habbo->id}'");
foreach ($query->Rows as $row) {
    $ruser = Habbo::GetHabboById($row["target"]);
    if (!$ruser) {
        continue;
    }
    $relations[$row["type"]][] = ["username" => $ruser->username, "look" => $ruser->look, "motto" => $ruser->motto];
}
### Get Badges
$query = DB::RunFastQuery("SELECT * FROM users_badges WHERE user_id = '{$habbo->id}'");
foreach ($query->Rows as $bad) {
    $badges[] = $bad["badge_id"];
}
##Get Rooms
/*$query = DB::RunFastQuery("SELECT * FROM rooms_data WHERE owner = '$habbo->username'");
foreach($query->Rows as $row)
{
	$rooms[] =