Menu
Forums
All threads
Latest threads
New posts
Trending threads
New posts
Search forums
Trending
What's new
New posts
New profile posts
Latest activity
Members
Current visitors
New profile posts
Search profile posts
Upgrades
Log in
Register
What's new
Search
Search
Search titles only
By:
All threads
Latest threads
New posts
Trending threads
New posts
Search forums
Menu
Log in
Register
Navigation
Install the app
Install
More options
Contact us
Close Menu
Forums
Server Development
Habbo Retros
Habbo Q&A
One last problem
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="Diddy" data-source="post: 193677" data-attributes="member: 5596"><p>Sorry</p><p> </p><p>[CODE]<?php</p><p>/*=======================================================================</p><p>| UberCMS - Advanced Website and Content Management System for uberEmu</p><p>| #######################################################################</p><p>| Copyright (c) 2010, Roy 'Meth0d'</p><p>| http://www.meth0d.org</p><p>| #######################################################################</p><p>| This program is free software: you can redistribute it and/or modify</p><p>| it under the terms of the GNU General Public License as published by</p><p>| the Free Software Foundation, either version 3 of the License, or</p><p>| (at your option) any later version.</p><p>| #######################################################################</p><p>| This program is distributed in the hope that it will be useful,</p><p>| but WITHOUT ANY WARRANTY; without even the implied warranty of</p><p>| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the</p><p>| GNU General Public License for more details.</p><p>\======================================================================*/</p><p> </p><p>class uberUsers</p><p>{</p><p> /**************************************************************************************************/</p><p> </p><p> private $userCache = Array();</p><p> </p><p> /**************************************************************************************************/</p><p> </p><p> private $blockedNames = Array('roy', 'meth0d', 'method', 'graph1x', 'graphix', 'admin', 'administrator',</p><p> 'mod', 'moderator', 'guest', 'undefined');</p><p> private $blockedNameParts = Array('moderate', 'staff', 'manage', 'system', 'admin', 'uber');</p><p> </p><p> /**************************************************************************************************/</p><p> </p><p> public function IsValidEmail($email = '')</p><p> {</p><p> return preg_match("/^[a-z0-9_\.-]+@([a-z0-9]+([\-]+[a-z0-9]+)*\.)+[a-z]{2,7}$/i", $email);</p><p> }</p><p> </p><p> public function IsValidName($nm = '')</p><p> {</p><p> if (preg_match('/^[a-z0-9]+$/i', $nm) && strlen($nm) >= 1 && strlen($nm) <= 32)</p><p> {</p><p> return true;</p><p> }</p><p> </p><p> return false;</p><p> }</p><p> </p><p> public function IsNameTaken($nm = '')</p><p> {</p><p> return ((mysql_num_rows(dbquery("SELECT null FROM users WHERE username = '" . $nm . "' LIMIT 1")) > 0) ? true : false);</p><p> }</p><p> </p><p> public function IdExists($id = 0)</p><p> {</p><p> return ((mysql_num_rows(dbquery("SELECT null FROM users WHERE id = '" . $id . "' LIMIT 1")) > 0) ? true : false);</p><p> }</p><p> </p><p> public function IsNameBlocked($nm = '')</p><p> { </p><p> foreach ($this->blockedNames as $bl)</p><p> {</p><p> if (strtolower($nm) == strtolower($bl))</p><p> {</p><p> return true;</p><p> }</p><p> }</p><p> </p><p> foreach ($this->blockedNameParts as $bl)</p><p> {</p><p> if (strpos(strtolower($nm), strtolower($bl)) !== false)</p><p> {</p><p> return true;</p><p> }</p><p> }</p><p> </p><p> return false;</p><p> } </p><p> </p><p> /**************************************************************************************************/</p><p> </p><p> function Add($username = '', $passwordHash = '', $email = 'default@localhost', $rank = '2', $figure = '', $sex = 'M')</p><p> {</p><p> @mysql_query("INSERT INTO users (username,password,mail,auth_ticket,rank,look,gender,motto,credits,activity_points,last_online,account_created,ip_last,ip_reg,expert) VALUES ('" . $username . "','" . $passwordHash . "','" . $email . "','','" . $rank . "','" . $figure . "','" . $sex . "','','25000','2000','". time() ."','" . date('d-M-Y') . "', '".$_SERVER['REMOTE_ADDR']."', '".$_SERVER['REMOTE_ADDR']."', '0')"); </p><p> $id = intval(mysql_free_result(dbquery("SELECT id FROM users WHERE username = '" . $username . "' LIMIT 1")));</p><p> dbquery("INSERT INTO user_info (user_id,bans,cautions,reg_timestamp,login_timestamp,cfhs,cfhs_abusive) VALUES ('" . $id . "','0','0','" . time(). "','" . time() . "','0','0')");</p><p> return $id;</p><p> }</p><p> </p><p> function Delete($id)</p><p> {</p><p> dbquery("DELETE FROM messenger_friendships WHERE user_one_id = '" . $id . "' OR user_two_id = '" . $id . "'");</p><p> dbquery("DELETE FROM messenger_requests WHERE to_id = '" . $id . "' OR from_id = '" . $id . "'");</p><p> dbquery("DELETE FROM users WHERE id = '" . $id . "' LIMIT 1");</p><p> dbquery("DELETE FROM user_subscriptions WHERE user_id = '" . $id . "'");</p><p> dbquery("DELETE FROM user_info WHERE user_id = '" . $id . "' LIMIT 1");</p><p> dbquery("DELETE FROM user_items WHERE user_id = '" . $id . "'");</p><p> }</p><p> </p><p> /**************************************************************************************************/</p><p> </p><p> function ValidateUser($username, $password)</p><p> {</p><p> return mysql_num_rows(dbquery("SELECT null FROM users WHERE username = '" . $username . "' AND password = '" . $password. "' LIMIT 1"));</p><p> }</p><p> </p><p> /**************************************************************************************************/</p><p> </p><p> function Name2id($username = '')</p><p> {</p><p> return @intval(mysql_result(dbquery("SELECT id FROM users WHERE username = '" . $username . "' LIMIT 1"), 0));</p><p> }</p><p> </p><p> function Id2name($id = -1)</p><p> {</p><p> if (isset($this->userCache[$id]['username']))</p><p> {</p><p> return $this->userCache[$id]['username'];</p><p> } </p><p> </p><p> $name = mysql_result(dbquery("SELECT username FROM users WHERE id = '" . $id . "' LIMIT 1"), 0);</p><p> $this->userCache[$id]['username'] = $name;</p><p> return $name;</p><p> } </p><p> </p><p> /**************************************************************************************************/</p><p> </p><p> function CacheUser($id)</p><p> {</p><p> $data = mysql_fetch_assoc(dbquery("SELECT * FROM users WHERE id = '" . $id . "' LIMIT 1"));</p><p> </p><p> foreach ($data as $key => $value)</p><p> {</p><p> $this->userCache[$id][$key] = $value;</p><p> }</p><p> }</p><p> </p><p> function GetUserVar($id, $var, $allowCache = true)</p><p> {</p><p> if ($allowCache && isset($this->userCache[$id][$var]))</p><p> {</p><p> if ($var == "last_online")</p><p> {</p><p> return "<i>Never</i>";</p><p> }</p><p> else</p><p> {</p><p> return $this->userCache[$id][$var];</p><p> }</p><p> }</p><p> </p><p> $val = @mysql_result(dbquery("SELECT " . $var . " FROM users WHERE id = '" . $id . "' LIMIT 1"), 0);</p><p> $this->userCache[$id][$var] = $val;</p><p> return $val;</p><p> }</p><p> </p><p> // do not remove - still used in hk</p><p> function formatUsername($id, $link = true, $styles = true)</p><p> {</p><p> $datas = dbquery("SELECT id,rank,username FROM users WHERE id = '" . $id . "' LIMIT 1");</p><p> </p><p> if (mysql_num_rows($datas) == 0)</p><p> {</p><p> return '<s>Unknown User</s>';</p><p> }</p><p> </p><p> $data = mysql_fetch_assoc($datas);</p><p> </p><p> $prefix = '';</p><p> $name = $data['username'];</p><p> $suffix = '';</p><p> </p><p> if ($link)</p><p> {</p><p> $prefix .= '<a href="/user/' . clean($data['username']) . '">';</p><p> $suffix .= '</a>';</p><p> }</p><p> </p><p> if ($styles)</p><p> {</p><p> $rank = $this->getRank($id);</p><p> </p><p> }</p><p> </p><p> return clean($prefix . $name . $suffix, true);</p><p> }</p><p> // do not remove - still used in hk</p><p> </p><p> /**************************************************************************************************/</p><p> </p><p> function getRank($id)</p><p> {</p><p> if (isset($this->userCache[$id]['rank']))</p><p> {</p><p> return $this->userCache[$id]['rank'];</p><p> }</p><p> </p><p> $rankId = @intval(mysql_result(dbquery("SELECT rank FROM users WHERE id = '" . intval($id) . "' LIMIT 1"), 0));</p><p> $this->userCache[$id]['rank'] = $rankId;</p><p> return $rankId;</p><p> }</p><p> </p><p> function getRankVar($rankId, $var)</p><p> {</p><p> return mysql_result(dbquery("SELECT " . $var . " FROM ranks WHERE id = '" . intval($rankId) . "' LIMIT 1"), 0);</p><p> }</p><p> </p><p> function getRankName($rankId)</p><p> {</p><p> return $this->getRankVar($rankId, 'name');</p><p> }</p><p> </p><p> function hasFuse($id, $fuse)</p><p> { </p><p> if (mysql_num_rows(dbquery("SELECT null FROM fuserights WHERE rank <= '" . $this->getRank($id) . "' AND fuse = '" . $fuse . "' LIMIT 1")) == 1)</p><p> {</p><p> return true;</p><p> }</p><p> </p><p> return false;</p><p> }</p><p> </p><p> /**************************************************************************************************/</p><p> </p><p> function GetFriendCount($id, $onlineOnly = false)</p><p> {</p><p> $i = 0;</p><p> $q = dbquery("SELECT user_two FROM friendships WHERE user_one = '" . $id . "'");</p><p> </p><p> while ($friend = mysql_fetch_assoc($q))</p><p> {</p><p> if (!$onlineOnly)</p><p> {</p><p> $i++;</p><p> }</p><p> else</p><p> {</p><p> $isOnline = mysql_result(dbquery("SELECT online FROM users WHERE id = '" . $friend['user_two'] . "' LIMIT 1"), 0);</p><p> </p><p> if ($isOnline == "1")</p><p> {</p><p> $i++;</p><p> }</p><p> }</p><p> }</p><p> </p><p> return $i;</p><p> }</p><p> </p><p> /**************************************************************************************************/</p><p> </p><p> function CheckSSO($id)</p><p> {</p><p> global $core;</p><p> </p><p> if (strlen($this->getUserVar($id, 'auth_ticket')) <= 3)</p><p> {</p><p> dbquery("UPDATE users SET auth_ticket = '" . $core->generateTicket($this->getUserVar($id, 'username')) . "' WHERE id = '" . $id . "' LIMIT 1");</p><p> }</p><p> }</p><p> </p><p> /**************************************************************************************************/</p><p> </p><p> function getCredits($id)</p><p> {</p><p> return $this->getUserVar($id, 'credits');</p><p> }</p><p> </p><p> function setCredits($id, $newAmount)</p><p> {</p><p> global $core;</p><p> </p><p> dbquery("UPDATE users SET credits = '" . $newAmount. "' WHERE id = '" . $id . "' LIMIT 1");</p><p> $core->Mus('updateCredits:' . $id);</p><p> }</p><p> </p><p> function giveCredits($id, $amount)</p><p> {</p><p> global $core;</p><p> </p><p> return $this->setCredits($id, ($this->getCredits($id) + $amount));</p><p> $core->Mus('updateCredits:' . $id);</p><p> }</p><p> </p><p> function takeCredits($id, $amount)</p><p> {</p><p> global $core;</p><p> </p><p> return $this->setCredits($id, ($this->getCredits($id) - $amount));</p><p> $core->Mus('updateCredits:' . $id);</p><p> } </p><p> </p><p> function renderHabboImage($id, $size = 'b', $dir = 2, $head_dir = 3, $action = 'wlk', $gesture = 'sml')</p><p> {</p><p> $look = $this->getUserVar($id, 'look');</p><p> </p><p> return 'http://www.habbo.co.uk/habbo-imaging/avatarimage?figure=' . $look . '&size=' . $size . '&action=' . $action . ',&gesture=' . $gesture . '&direction=' . $dir . '&head_direction=' . $head_dir;</p><p> }</p><p> </p><p> function getClubDays($id)</p><p> {</p><p> $sql = dbquery("SELECT timestamp_activated, timestamp_expire FROM user_subscriptions WHERE subscription_id = 'habbo_club' AND user_id = '" . $id . "' LIMIT 1");</p><p> </p><p> if (mysql_num_rows($sql) == 0)</p><p> {</p><p> return 0;</p><p> }</p><p> </p><p> $data = mysql_fetch_assoc($sql);</p><p> $diff = $data['timestamp_expire'] - time();</p><p> </p><p> if ($diff <= 0)</p><p> {</p><p> return 0;</p><p> }</p><p> </p><p> return ceil($diff / 86400);</p><p> }</p><p> </p><p> function hasClub($id)</p><p> {</p><p> return ($this->getClubDays($id) > 0) ? true : false;</p><p> }</p><p> </p><p> /**************************************************************************************************/</p><p> </p><p> public static function IsUserBanned($name)</p><p> {</p><p> if (uberUsers::GetBan('user', $name, true) != null)</p><p> {</p><p> return true;</p><p> }</p><p> </p><p> return false;</p><p> }</p><p> </p><p> public static function IsIpBanned($ip)</p><p> {</p><p> if (uberUsers::GetBan('ip', $ip, true) != null)</p><p> {</p><p> return true;</p><p> }</p><p> </p><p> return false;</p><p> }</p><p> </p><p> public static function GetBan($type, $value, $mustNotBeExpired = false)</p><p> {</p><p> $q = "SELECT * FROM bans WHERE bantype = '" . $type . "' AND value = '" . $value . "' ";</p><p> </p><p> if ($mustNotBeExpired)</p><p> {</p><p> $q .= "AND expire > " . time() . " ";</p><p> }</p><p> </p><p> $q .= "LIMIT 1";</p><p> </p><p> $get = dbquery($q);</p><p> </p><p> if (mysql_num_rows($get) > 0)</p><p> {</p><p> return mysql_fetch_assoc($get);</p><p> }</p><p> </p><p> return null;</p><p> } </p><p> </p><p> /**************************************************************************************************/</p><p> </p><p> public static function GetUserTags($userId)</p><p> {</p><p> $tagsArray = Array();</p><p> $data = dbquery("SELECT id,tag FROM user_tags WHERE user_id = '" . $userId . "'");</p><p> </p><p> while ($tag = mysql_fetch_assoc($data))</p><p> {</p><p> $tagsArray[$tag['id']] = $tag['tag'];</p><p> }</p><p> </p><p> return $tagsArray;</p><p> }</p><p> </p><p> /***************************************************************************/</p><p> // HOMES</p><p> </p><p> public function EatCredits($id, $credits, $restar = true)</p><p> {</p><p> if($restar)</p><p> {</p><p> dbquery("UPDATE users SET credits = credits - ".$credits." WHERE id = '".$id."' LIMIT 1"); </p><p> }</p><p> else</p><p> {</p><p> dbquery("UPDATE users SET credits = ".$credits." WHERE id = '".$id."' LIMIT 1");</p><p> }</p><p> return true; </p><p> }</p><p> </p><p> public static function haveWidget($Id, $var)</p><p> {</p><p> $check = mysql_num_rows(dbquery("SELECT id FROM homes_items WHERE data = '" . $var . "' AND owner_id = '" . $Id . "' LIMIT 1"));</p><p> </p><p> if($check > 0)</p><p> {</p><p> return true;</p><p> }</p><p> else</p><p> {</p><p> return false;</p><p> }</p><p> }</p><p> </p><p> public function IsUserOnline($id = USER_ID, $numbers = false)</p><p> {</p><p> $CheckOnline = mysql_result(dbquery("SELECT online FROM users WHERE id = '".$id."' LIMIT 1"), 0);</p><p> if($CheckOnline == '1') {</p><p> return true;</p><p> } else {</p><p> return false;</p><p> }</p><p> }</p><p>}</p><p> </p><p> </p><p>?>[/CODE]</p></blockquote><p></p>
[QUOTE="Diddy, post: 193677, member: 5596"] Sorry [CODE]<?php /*======================================================================= | UberCMS - Advanced Website and Content Management System for uberEmu | ####################################################################### | Copyright (c) 2010, Roy 'Meth0d' | http://www.meth0d.org | ####################################################################### | This program is free software: you can redistribute it and/or modify | it under the terms of the GNU General Public License as published by | the Free Software Foundation, either version 3 of the License, or | (at your option) any later version. | ####################################################################### | This program is distributed in the hope that it will be useful, | but WITHOUT ANY WARRANTY; without even the implied warranty of | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | GNU General Public License for more details. \======================================================================*/ class uberUsers { /**************************************************************************************************/ private $userCache = Array(); /**************************************************************************************************/ private $blockedNames = Array('roy', 'meth0d', 'method', 'graph1x', 'graphix', 'admin', 'administrator', 'mod', 'moderator', 'guest', 'undefined'); private $blockedNameParts = Array('moderate', 'staff', 'manage', 'system', 'admin', 'uber'); /**************************************************************************************************/ public function IsValidEmail($email = '') { return preg_match("/^[a-z0-9_\.-]+@([a-z0-9]+([\-]+[a-z0-9]+)*\.)+[a-z]{2,7}$/i", $email); } public function IsValidName($nm = '') { if (preg_match('/^[a-z0-9]+$/i', $nm) && strlen($nm) >= 1 && strlen($nm) <= 32) { return true; } return false; } public function IsNameTaken($nm = '') { return ((mysql_num_rows(dbquery("SELECT null FROM users WHERE username = '" . $nm . "' LIMIT 1")) > 0) ? true : false); } public function IdExists($id = 0) { return ((mysql_num_rows(dbquery("SELECT null FROM users WHERE id = '" . $id . "' LIMIT 1")) > 0) ? true : false); } public function IsNameBlocked($nm = '') { foreach ($this->blockedNames as $bl) { if (strtolower($nm) == strtolower($bl)) { return true; } } foreach ($this->blockedNameParts as $bl) { if (strpos(strtolower($nm), strtolower($bl)) !== false) { return true; } } return false; } /**************************************************************************************************/ function Add($username = '', $passwordHash = '', $email = 'default@localhost', $rank = '2', $figure = '', $sex = 'M') { @mysql_query("INSERT INTO users (username,password,mail,auth_ticket,rank,look,gender,motto,credits,activity_points,last_online,account_created,ip_last,ip_reg,expert) VALUES ('" . $username . "','" . $passwordHash . "','" . $email . "','','" . $rank . "','" . $figure . "','" . $sex . "','','25000','2000','". time() ."','" . date('d-M-Y') . "', '".$_SERVER['REMOTE_ADDR']."', '".$_SERVER['REMOTE_ADDR']."', '0')"); $id = intval(mysql_free_result(dbquery("SELECT id FROM users WHERE username = '" . $username . "' LIMIT 1"))); dbquery("INSERT INTO user_info (user_id,bans,cautions,reg_timestamp,login_timestamp,cfhs,cfhs_abusive) VALUES ('" . $id . "','0','0','" . time(). "','" . time() . "','0','0')"); return $id; } function Delete($id) { dbquery("DELETE FROM messenger_friendships WHERE user_one_id = '" . $id . "' OR user_two_id = '" . $id . "'"); dbquery("DELETE FROM messenger_requests WHERE to_id = '" . $id . "' OR from_id = '" . $id . "'"); dbquery("DELETE FROM users WHERE id = '" . $id . "' LIMIT 1"); dbquery("DELETE FROM user_subscriptions WHERE user_id = '" . $id . "'"); dbquery("DELETE FROM user_info WHERE user_id = '" . $id . "' LIMIT 1"); dbquery("DELETE FROM user_items WHERE user_id = '" . $id . "'"); } /**************************************************************************************************/ function ValidateUser($username, $password) { return mysql_num_rows(dbquery("SELECT null FROM users WHERE username = '" . $username . "' AND password = '" . $password. "' LIMIT 1")); } /**************************************************************************************************/ function Name2id($username = '') { return @intval(mysql_result(dbquery("SELECT id FROM users WHERE username = '" . $username . "' LIMIT 1"), 0)); } function Id2name($id = -1) { if (isset($this->userCache[$id]['username'])) { return $this->userCache[$id]['username']; } $name = mysql_result(dbquery("SELECT username FROM users WHERE id = '" . $id . "' LIMIT 1"), 0); $this->userCache[$id]['username'] = $name; return $name; } /**************************************************************************************************/ function CacheUser($id) { $data = mysql_fetch_assoc(dbquery("SELECT * FROM users WHERE id = '" . $id . "' LIMIT 1")); foreach ($data as $key => $value) { $this->userCache[$id][$key] = $value; } } function GetUserVar($id, $var, $allowCache = true) { if ($allowCache && isset($this->userCache[$id][$var])) { if ($var == "last_online") { return "<i>Never</i>"; } else { return $this->userCache[$id][$var]; } } $val = @mysql_result(dbquery("SELECT " . $var . " FROM users WHERE id = '" . $id . "' LIMIT 1"), 0); $this->userCache[$id][$var] = $val; return $val; } // do not remove - still used in hk function formatUsername($id, $link = true, $styles = true) { $datas = dbquery("SELECT id,rank,username FROM users WHERE id = '" . $id . "' LIMIT 1"); if (mysql_num_rows($datas) == 0) { return '<s>Unknown User</s>'; } $data = mysql_fetch_assoc($datas); $prefix = ''; $name = $data['username']; $suffix = ''; if ($link) { $prefix .= '<a href="/user/' . clean($data['username']) . '">'; $suffix .= '</a>'; } if ($styles) { $rank = $this->getRank($id); } return clean($prefix . $name . $suffix, true); } // do not remove - still used in hk /**************************************************************************************************/ function getRank($id) { if (isset($this->userCache[$id]['rank'])) { return $this->userCache[$id]['rank']; } $rankId = @intval(mysql_result(dbquery("SELECT rank FROM users WHERE id = '" . intval($id) . "' LIMIT 1"), 0)); $this->userCache[$id]['rank'] = $rankId; return $rankId; } function getRankVar($rankId, $var) { return mysql_result(dbquery("SELECT " . $var . " FROM ranks WHERE id = '" . intval($rankId) . "' LIMIT 1"), 0); } function getRankName($rankId) { return $this->getRankVar($rankId, 'name'); } function hasFuse($id, $fuse) { if (mysql_num_rows(dbquery("SELECT null FROM fuserights WHERE rank <= '" . $this->getRank($id) . "' AND fuse = '" . $fuse . "' LIMIT 1")) == 1) { return true; } return false; } /**************************************************************************************************/ function GetFriendCount($id, $onlineOnly = false) { $i = 0; $q = dbquery("SELECT user_two FROM friendships WHERE user_one = '" . $id . "'"); while ($friend = mysql_fetch_assoc($q)) { if (!$onlineOnly) { $i++; } else { $isOnline = mysql_result(dbquery("SELECT online FROM users WHERE id = '" . $friend['user_two'] . "' LIMIT 1"), 0); if ($isOnline == "1") { $i++; } } } return $i; } /**************************************************************************************************/ function CheckSSO($id) { global $core; if (strlen($this->getUserVar($id, 'auth_ticket')) <= 3) { dbquery("UPDATE users SET auth_ticket = '" . $core->generateTicket($this->getUserVar($id, 'username')) . "' WHERE id = '" . $id . "' LIMIT 1"); } } /**************************************************************************************************/ function getCredits($id) { return $this->getUserVar($id, 'credits'); } function setCredits($id, $newAmount) { global $core; dbquery("UPDATE users SET credits = '" . $newAmount. "' WHERE id = '" . $id . "' LIMIT 1"); $core->Mus('updateCredits:' . $id); } function giveCredits($id, $amount) { global $core; return $this->setCredits($id, ($this->getCredits($id) + $amount)); $core->Mus('updateCredits:' . $id); } function takeCredits($id, $amount) { global $core; return $this->setCredits($id, ($this->getCredits($id) - $amount)); $core->Mus('updateCredits:' . $id); } function renderHabboImage($id, $size = 'b', $dir = 2, $head_dir = 3, $action = 'wlk', $gesture = 'sml') { $look = $this->getUserVar($id, 'look'); return 'http://www.habbo.co.uk/habbo-imaging/avatarimage?figure=' . $look . '&size=' . $size . '&action=' . $action . ',&gesture=' . $gesture . '&direction=' . $dir . '&head_direction=' . $head_dir; } function getClubDays($id) { $sql = dbquery("SELECT timestamp_activated, timestamp_expire FROM user_subscriptions WHERE subscription_id = 'habbo_club' AND user_id = '" . $id . "' LIMIT 1"); if (mysql_num_rows($sql) == 0) { return 0; } $data = mysql_fetch_assoc($sql); $diff = $data['timestamp_expire'] - time(); if ($diff <= 0) { return 0; } return ceil($diff / 86400); } function hasClub($id) { return ($this->getClubDays($id) > 0) ? true : false; } /**************************************************************************************************/ public static function IsUserBanned($name) { if (uberUsers::GetBan('user', $name, true) != null) { return true; } return false; } public static function IsIpBanned($ip) { if (uberUsers::GetBan('ip', $ip, true) != null) { return true; } return false; } public static function GetBan($type, $value, $mustNotBeExpired = false) { $q = "SELECT * FROM bans WHERE bantype = '" . $type . "' AND value = '" . $value . "' "; if ($mustNotBeExpired) { $q .= "AND expire > " . time() . " "; } $q .= "LIMIT 1"; $get = dbquery($q); if (mysql_num_rows($get) > 0) { return mysql_fetch_assoc($get); } return null; } /**************************************************************************************************/ public static function GetUserTags($userId) { $tagsArray = Array(); $data = dbquery("SELECT id,tag FROM user_tags WHERE user_id = '" . $userId . "'"); while ($tag = mysql_fetch_assoc($data)) { $tagsArray[$tag['id']] = $tag['tag']; } return $tagsArray; } /***************************************************************************/ // HOMES public function EatCredits($id, $credits, $restar = true) { if($restar) { dbquery("UPDATE users SET credits = credits - ".$credits." WHERE id = '".$id."' LIMIT 1"); } else { dbquery("UPDATE users SET credits = ".$credits." WHERE id = '".$id."' LIMIT 1"); } return true; } public static function haveWidget($Id, $var) { $check = mysql_num_rows(dbquery("SELECT id FROM homes_items WHERE data = '" . $var . "' AND owner_id = '" . $Id . "' LIMIT 1")); if($check > 0) { return true; } else { return false; } } public function IsUserOnline($id = USER_ID, $numbers = false) { $CheckOnline = mysql_result(dbquery("SELECT online FROM users WHERE id = '".$id."' LIMIT 1"), 0); if($CheckOnline == '1') { return true; } else { return false; } } } ?>[/CODE] [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
Server Development
Habbo Retros
Habbo Q&A
One last problem
Top