[REL][UBER] Habbo Homes.

Page 1 of 2 12 LastLast
Results 1 to 15 of 19
  1. #1
    Account Upgraded | Title Enabled! Predict is offline
    MemberRank
    Aug 2008 Join Date
    760Posts

    [REL][UBER] Habbo Homes.

    Basically it's a customized/edited Habbo Homes to the one you see from Habbo, anyway.

    home.php

    Code:
    <?php
    require_once "global.php";
    require_once "templates/class.homes.php";
    
    if (!LOGGED_IN)
    {
    	header("Location: ".WWW);
    	exit;
    }
    
    $userId = 0;
    $userData = null;
    
    if (isset($_GET['username']))
    {
    	$userId = $users->name2id($_GET['username']);
    }
    else if (isset($_GET['userId']) && is_numeric($_GET['userId']))
    {
    	$userId = $_GET['userId'];
    }
    
    if ($userId <= 0 || !UberUsers::IdExists($userId))
    {
    	require_once "error.php";
    	exit;
    }
    
    if (!HomesManager::HomeExists($userId))
    {
    	HomesManager::CreateHome($userId);
    }
    
    if (!HomesManager::DisplayHome($userId))
    {
    	require_once "error.php";
    	exit;
    }
    
    $userData = HomesManager::GetUserDataRow($userId);
    $homeData = HomesManager::GetHome(HomesManager::GetHomeId($userId));
    
    $tpl->Init();
    
    $tpl->SetParam('pageTitle', $userData['username']);
    
    if ($userId == USER_ID)
    {
    	$tpl->SetParam('navi', '<li class="metab selected">
    				<strong>'.USER_NAME.'</strong>
    				<span></span>
    			</li>');
    	$tpl->SetParam('navi2', '<li class="selected">
    				My page
    			</li>');
    }
    else
    {
    	$tpl->SetParam('navi', '<li class="metab">
    				<a href="'.WWW.'/me">'.USER_NAME.'</a>
    				<span></span>
    			</li>');
    	$tpl->SetParam('navi2', '<li>
    				<a href="'.WWW.'/home/'.USER_NAME.'">My page</a>
    			</li>');
    }
    
    if(isset($_SESSION['EditHome']) && USER_ID == $userId)
    {
    	$tpl->SetParam('body_id', 'editmode');
    	$tpl->SetParam('editmode-1', '
    <script src="'.WWW.'/habboweb/63_1dc60c6d6ea6e089c6893ab4e0541ee0/879/web-gallery/static/js/homeedit.js" type="text/javascript"></script>
    <script language="JavaScript" type="text/javascript">
    	document.observe("dom:loaded", function()
    	{
    		initView('.$userId.', '.$userId.');
    	});
    	
    	function isElementLimitReached()
    	{
    		if (getElementCount() >= 200)
    		{
    			showHabboHomeMessageBox("Error", "You have already reached the maximum number of elements on the page. Remove a sticker, note or widget to be able to place this item.", "Close");
    			return true;
    		}
    		return false;
    	}
    	
    	function cancelEditing(expired)
    		{
    		location.replace("/myhabbo/cancel" + (expired ? "?expired=true" : ""));
    	}
    	
    	function getSaveEditingActionName()
    	{
    		return \'/myhabbo/save\';
    	}
    	
    	function showEditErrorDialog()
    	{
    		var closeEditErrorDialog = function(e) { if (e)
    		{
    			Event.stop(e); } Element.remove($("myhabbo-error")); Overlay.hide();
    		};
    		var dialog = Dialog.createDialog("myhabbo-error", "", false, false, false, closeEditErrorDialog);
    		Dialog.setDialogBody(dialog, \'<p>Error occurred! Please try again in couple of minutes.</p><p><a href="#" class="new-button" id="myhabbo-error-close"><b>Close</b><i></i></a></p><div class="clear"></div>\');
    		Event.observe($("myhabbo-error-close"), "click", closeEditErrorDialog);
    		Dialog.moveDialogToCenter(dialog);
    		Dialog.makeDialogDraggable(dialog);
    	}
    	
    	function showSaveOverlay()
    	{
    		var invalidPos = getElementsInInvalidPositions();
    		if (invalidPos.length > 0)
    		{
    			$A(invalidPos).each(function(el)
    			{
    				Element.scrollTo(el);
    				Effect.Pulsate(el);
    			});
    			showHabboHomeMessageBox("Whoops! You can\'t do that!", "Sorry, but you can\'t place your stickers, notes or widgets here. Close the window to continue editing your page.", "Close");
    			return false;
    		} else {
    			Overlay.show(null,\'Saving\');
    			return true;
    		}
    	}
    </script>');
    	$tpl->SetParam('editmode-2', '');
    	$tpl->SetParam('editmode-3', '<div id="top-toolbar" class="clearfix">
    				<a id="badge-button" class="new-button grey-button" href="/myhabbo/widget/add/badges" style="float:left;">
    					<b>
    						Add badges
    					</b>
    					<i></i>
    				</a>
    				<form action="#" method="get" style="width: 50%">
    					<a id="cancel-button" class="new-button red-button cancel-icon" href="#">
    						<b>
    							<span></span>
    							Cancel
    						</b>
    						<i></i>
    					</a>
    					<a id="save-button" class="new-button green-button save-icon" href="#">
    						<b>
    							<span></span>
    							Save
    						</b>
    						<i></i>
    					</a>
    				</form>
    			</div>');
    	$tpl->SetParam('editmode-4', '
    <script language="JavaScript" type="text/javascript">
    	initEditToolbar();
    	initMovableItems();
    	document.observe("dom:loaded", initDraggableDialogs);
    	Utils.setAllEmbededObjectsVisibility(\'hidden\');
    	Pinger.start();
    </script>
    <div id="edit-save" style="display:none;"></div>
    <script language="JavaScript" type="text/javascript">
    	Event.observe(window, "resize", function()
    	{
    		if (editMenuOpen) closeEditMenu();
    	}, false);
    	Event.observe(document, "click", function()
    	{
    		if (editMenuOpen) closeEditMenu();
    	}, false);
    	Event.observe("edit-menu", "click", Event.stop, false);
    	Event.observe("edit-menu-exit", "click", function()
    	{
    		closeEditMenu();
    	}, false);
    	Event.observe("edit-menu-remove-button", "click", handleEditRemove, false);
    	Event.observe("edit-menu-skins-select", "click", Event.stop, false);
    	Event.observe("edit-menu-skins-select", "change", handleEditSkinChange, false);');
    
    }
    else
    {
    	$tpl->SetParam('body_id', 'viewmode');
    	$tpl->SetParam('editmode-1', '');
    	
    	if (USER_ID == $userId)
    	{
    		$tpl->SetParam('editmode-2', '<a href="'.WWW.'/myhabbo/start" id="edit-button" class="new-button dark-button edit-icon" style="float:left"><b><span></span>Edit</b><i></i></a>');
    	}
    	else
    	{
    		$tpl->SetParam('editmode-2', '');
    	}
    	
    	$tpl->SetParam('editmode-3', '');
    	$tpl->SetParam('editmode-4', '<script type="text/javascript">');
    }
    $result = null;
    foreach ($homeData->GetItems() as $item)
    {
    	$result .= $item->GetHtml();
    }
    	
    $tpl->SetParam('playground', $result);
    $home = new Template('pages/home');
    $home->SetParam('home_title', $userData['username']);
    $home->SetParam('homeData', $homeData);
    $tpl->AddTemplate($home);
    $tpl->Output();
    ?>
    HOME.TPL

    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html lang="en">
    <head>
    <meta http-equiv="content-type" content="text/html; charset=utf-8" />
    <title>|siteName|: |PageTitle|</title>
    
    <script type="text/javascript">
    	var andSoItBegins = (new Date()).getTime();
    	var ad_keywords = "";
    	document.habboLoggedIn = |LoggedIn|;
    	var habboName = "|username|";
    	var habboReqPath = "|www|";
    	var habboStaticFilePath = "|www|/habboweb/63_1dc60c6d6ea6e089c6893ab4e0541ee0/879/web-gallery";
    	var habboImagerUrl = "http://www.habbo.com/habbo-imaging/";
    	var habboPartner = "";
    	var habboDefaultClientPopupUrl = "|www|/client";
    	window.name = "habboMain";
    	if (typeof HabboClient != "undefined")
    	{
    		HabboClient.windowName = "uberClientWnd";
    	}
    </script>
    
    <link rel="shortcut icon" href="|www|/habboweb/63_1dc60c6d6ea6e089c6893ab4e0541ee0/879/web-gallery/v2/favicon.ico" type="image/vnd.microsoft.icon" />
    <link rel="stylesheet" href="|www|/habboweb/63_1dc60c6d6ea6e089c6893ab4e0541ee0/879/web-gallery/static/styles/common.css" type="text/css"/>
    <script src="|www|/habboweb/63_1dc60c6d6ea6e089c6893ab4e0541ee0/879/web-gallery/static/js/libs2.js" type="text/javascript"></script>
    <script src="|www|/habboweb/63_1dc60c6d6ea6e089c6893ab4e0541ee0/879/web-gallery/static/js/visual.js" type="text/javascript"></script>
    <script src="|www|/habboweb/63_1dc60c6d6ea6e089c6893ab4e0541ee0/879/web-gallery/static/js/libs.js" type="text/javascript"></script>
    <script src="|www|/habboweb/63_1dc60c6d6ea6e089c6893ab4e0541ee0/879/web-gallery/static/js/common.js" type="text/javascript"></script>
    <script src="|www|/habboweb/63_1dc60c6d6ea6e089c6893ab4e0541ee0/879/web-gallery/static/js/fullcontent.js" type="text/javascript"></script>
    <link rel="stylesheet" href="|www|/habboweb/63_1dc60c6d6ea6e089c6893ab4e0541ee0/879/web-gallery/static/styles/home.css" type="text/css"/>
    <link href="http://www.habbo.com/myhabbo/styles/assets/backgrounds.css?v=b8e031bd792a2f39fd32776521aa9ad3" type="text/css" rel="stylesheet"/>
    <script src="|www|/habboweb/63_1dc60c6d6ea6e089c6893ab4e0541ee0/879/web-gallery/static/js/homeview.js" type="text/javascript"></script>
    <link rel="stylesheet" href="|www|/habboweb/63_1dc60c6d6ea6e089c6893ab4e0541ee0/879/web-gallery/static/styles/lightwindow.css" type="text/css"/>
    <script src="|www|/habboweb/63_1dc60c6d6ea6e089c6893ab4e0541ee0/879/web-gallery/static/js/homeauth.js" type="text/javascript"></script>
    
    <style type="text/css">
    	#playground, #playground-outer
    	{
    		height: 680px;
    	}
    </style>
    |editmode-1|
    <meta name="description" content="|siteName| is a virtual world where you can meet and make friends. Make friends, join the fun, get noticed!" /> 
    <meta name="keywords" content="habbo hotel , virtual, world, social network, free, community, avatar, chat, online, teen, roleplaying, join, social, groups, forums, safe, play, games, online, friends, teens, rares, rare furni, collecting, create, collect, connect, furni, furniture, pets , room design, sharing, expression, badges, hangout, music, celebrity, celebrity visits, celebrities, mmo, mmorpg, massively multiplayer" />
    </head>
    
    <body id="|body_id|">
    <div id="overlay"></div> 
    <div id="header-container">
    	<div id="header" class="clearfix">
    		<h1>
    			<a href="|www|/me"></a>
    		</h1>
    		<div id="subnavi">
    			<div id="subnavi-search-upper"></div>
    			<div id="to-hotel">
    				<a href="|www|/client" class="new-button green-button" target="uberClientWnd" onclick="HabboClient.openOrFocus(this); return false;">
    					<b>Enter |siteName| Hotel</b>
    					<i></i>
    				</a>
    			</div>
    		</div>
    		<script type="text/javascript">
    			document.observe("dom:loaded", function()
    			{
    				$("signout").observe("click", function()
    				{
    					HabboClient.close();
    				});
    			});
    		</script>
    		<ul id="navi">
    			|navi|
    			<li>
    				<a href="|www|/community">
    					Community
    				</a>
    				<span></span>
    			</li>
    			<li id="tab-register-now" class="tab-register-now">
    				<a href="|www|/account/logout">
    					Logout
    				</a>
    				<span></span>
    			</li>
    		</ul>
    		<div id="habbos-online">
    			<div class="rounded">
    				<span>|hotelStatus| members online</span>
    			</div>
    		</div>
    	</div>
    </div>
    
    <div id="content-container">
    <div id="navi2-container" class="pngbg">
    	<div id="navi2" class="pngbg clearfix">
    		<ul>
    			<li>
    				<a href="|www|/me">
    					Home
    				</a>
    			</li>
    			|navi2|
    			<li class="last">
    				<a href="|www|/profile?tab=1">
    					Account settings
    				</a>
    			</li>
    		</ul>
    	</div>
    </div>
    <div id="container">
    <div id="content" style="position:relative" class="clearfix">
    	<div id="mypage-wrapper" class="cbb blue">
    		<div class="box-tabs-container box-tabs-left clearfix"> 
    |editmode-2|
    			<div class="myhabbo-view-tools"></div>
    			<h2 class="page-owner">|home_title|</h2>
    			<ul class="box-tabs"></ul>
    		</div>
    		<div id="mypage-content"> 
    			|editmode-3|
    			<div id="mypage-bg" style="background:#191919 url(http://img1.cdn1.habbo.com/c_images/backgrounds2/bg_colour_01.gif) repeat;">
    				<div id="playground">
    				|playground|
    		</div>
    	</div>
    </div>
    </div>
    <script type="text/javascript">
    	Event.observe(window, "load", observeAnim);
    	document.observe("dom:loaded", function()
    	{
    		initDraggableDialogs();
    		repositionInvalidItems();
    	});
    </script>
    </div>
    
    <div id="edit-menu" class="menu" style="top: 222px; left: -1500px;">
    	<div class="menu-header">
    		<div class="menu-exit" id="edit-menu-exit">
    			<img src="|www|/habboweb/63_1dc60c6d6ea6e089c6893ab4e0541ee0/879/web-gallery/images/dialogs/menu-exit.gif" alt=""/>
    		</div>
    		<h3>Edit</h3>
    	</div>
    	<div class="menu-body">
    		<div class="menu-content">
    			<form action="#" onsubmit="return false;">
    				<div id="edit-menu-skins" style="display:block;">
    					<select id="edit-menu-skins-select">
    						<option value="1" id="edit-menu-skins-select-defaultskin">Default</option>
    						<option value="2" id="edit-menu-skins-select-speechbubbleskin">Speech Bubble</option>
    						<option value="3" id="edit-menu-skins-select-metalskin">Metal</option>
    						<option value="4" id="edit-menu-skins-select-noteitskin">Stickie Note</option>
    						<option value="5" id="edit-menu-skins-select-notepadskin">Notepad</option>
    						<option value="6" id="edit-menu-skins-select-goldenskin">Golden</option>
    						<option value="7" id="edit-menu-skins-select-hc_machineskin">HC Scientific</option>
    						<option value="8" id="edit-menu-skins-select-hc_pillowskin">HC Pillow</option>
    					</select>
    				</div>
    				
    				<div id="edit-menu-stickie" style="display:none;"></div>
    				<div id="rating-edit-menu" style="display:none;"></div>
    				<div id="edit-menu-remove-group-warning" style="display:none;"></div>
    				<div id="edit-menu-gb-availability" style="display:none;"></div>
    				<div id="edit-menu-trax-select" style="display:none;"></div>
    				<div id="edit-menu-remove" style="display: block;">
    					<input type="button" id="edit-menu-remove-button" value="Remove">
    				</div>
    			</form>
    			<div class="clear"></div>
    		</div>
    	</div>
    	<div class="menu-bottom"></div>
    </div>
    |editmode-4|
    	HabboView.run();
    </script>
    <div id="footer" class="new_and_improved">
    	<p class="footer-links"></p>
    	<p class="copyright">uberHotel, Copyright &copy; 2009 - 2010 Meth0d dot org. All rights reserved to their respective owner(s).</p>
    </div>
    </body>
    </html>
    MYHABBO.PHP

    Code:
    <?php
    require_once "global.php";
    require_once "templates/class.homes.php";
    
    if (!LOGGED_IN)
    {
    	include("error.php");
    	exit;
    }
    else
    {
    	if (isset($_GET['cmd']))
    	{
    		$cmd = $_GET['cmd'];
    	}
    	else
    	{
    		include("error.php");
    		exit;
    	}
    	
    	switch (strtolower($cmd))
    	{
    		case 'start':
    		
    		if(!isset($_SESSION['EditHome']))
    		{
    			$query = mysql_query("SELECT id FROM users WHERE id = '".USER_ID."'");
    			
    			if (mysql_num_rows($query) == 1)
    			{
    				$_SESSION['EditHome'] = USER_ID;
    				header('Location: '.WWW.'/home/'.$_SESSION['UBER_USER_N']);
    			}
    		}
    		
    		break;
    		
    		case 'save':
    		
    		if(isset($_POST["widgets"]))
    		{
    			$widgets = explode('/', $_POST['widgets']);
    			
    			foreach($widgets as $query)
    			{
    				if(empty($query))
    				{
    					unset($_SESSION['EditHome']);
    					break;
    				}
    				else
    				{
    					$row = explode(':', $query);
    					$result = explode(',', $row[1]);
    				
    					mysql_query("UPDATE homes_items SET x = '".mysql_real_escape_string($result[0])."', y = '".mysql_real_escape_string($result[1])."', z = '".mysql_real_escape_string($result[2])."' WHERE id = '".mysql_real_escape_string($row[0])."' AND home_id = '".USER_ID."' LIMIT 1");
    				}
    			}
    		}
    		
    		unset($_SESSION['EditHome']);
    		echo '<script language="JavaScript" type="text/javascript">
    	waitAndGo(\''.WWW.'/home/'.$_SESSION['UBER_USER_N'].'\');
    </script>';
    		
    		break;
    		
    		case 'cancel':
    		
    		if(isset($_SESSION['EditHome']))
    		{
    			unset($_SESSION['EditHome']);
    			header('Location: /home/'.$_SESSION['UBER_USER_N']);
    			
    		}
    		
    		break;
    		
    		case 'widget/add/badges':
    		
    		if(isset($_SESSION['EditHome']))
    		{
    			if (!HomesManager::BadgesExist(USER_ID))
    			{
    				mysql_query("INSERT INTO homes_items (id, home_id, x, y, z, data, skin) VALUES (NULL, '".USER_ID."', '15', '25', '12', 'badges', 'w_skin_defaultskin');");
    			}
    			
    			header('Location: /home/'.$_SESSION['UBER_USER_N']);
    		}
    		
    		break;
    
    		case 'widget/edit':
    		
    		if(isset($_POST['skinId']) && isset($_POST['widgetId']))
    		{
    			switch($_POST['skinId'])
    			{
    				case 1:
    					$skin = 'defaultskin';
    					break;
    				case 2:
    					$skin = 'speechbubbleskin';
    					break;
    				case 3:
    					$skin = 'metalskin';
    					break;
    				case 4:
    					$skin = 'noteitskin';
    					break;
    				case 5:
    					$skin = 'notepadskin';
    					break;
    				case 6:
    					$skin = 'goldenskin';
    					break;
    				case 7:
    					$skin = 'hc_machineskin';
    					break;
    				case 8:
    					$skin = 'hc_pillowskin';
    					break;
    				default:
    					$skin = 'defaultskin';
    					break;
    			}
    			
    			$query = mysql_query("SELECT home_id from homes_items where id = '".mysql_real_escape_string($_POST['widgetId'])."' LIMIT 1");
    			$row = mysql_fetch_array($query);
    			
    			if ($row['home_id'] == USER_ID)
    			{
    				header('X-JSON: {"id":"'.$_POST['widgetId'].'","cssClass":"w_skin_'.$skin.'","type":"widget"}');
    				echo HomeItem::UpdateItem('w_skin_'.$skin, $_POST['widgetId']);
    			}
    		}
    		
    		break;
    		
    		case 'widget/delete':
    		
    		if(isset($_POST['widgetId']))
    		{
    			$query = mysql_query("SELECT id, home_id FROM homes_items WHERE id = '".mysql_real_escape_string($_POST['widgetId'])."' AND home_id = '".USER_ID."'");
    			$row = mysql_fetch_array($query);
    			
    			if($row['home_id'] == USER_ID)
    			{			
    				mysql_query("DELETE from homes_items WHERE id = '".mysql_real_escape_string($_POST['widgetId'])."' LIMIT 1");
    			}
    		}
    		
    		break;
    		
    	}
    }
    ?>
    CLASS.HOMES.PHP
    Code:
    <?php
    class HomesManager
    {
    	public static function HomeExists($linkId)
    	{
    		return ((mysql_num_rows(mysql_query("SELECT null FROM homes WHERE link_id = '".mysql_real_escape_string($linkId)."' LIMIT 1")) > 0) ? true : false);
    	}
    	
    	public static function GetHomeId($linkId)
    	{
    		if (!HomesManager::HomeExists($linkId))
    		{
    			return 0;
    		}
    		else
    		{
    			return mysql_result(mysql_query("SELECT home_id FROM homes WHERE link_id = '".mysql_real_escape_string($linkId)."' LIMIT 1"), 0);
    		}
    	}
    	
    	public static function CreateHome($linkId)
    	{
    		mysql_query("INSERT INTO homes (home_id,link_id,allow_display) VALUES ($linkId,'".mysql_real_escape_string($linkId)."','1')");
    		
    		$homeId = HomesManager::GetHomeId($linkId);
    		$home = HomesManager::GetHome($homeId);
    		
    		$home->AddItem(463, 39, 1, 'profile', 'w_skin_defaultskin', $linkId);
    		
    		return $homeId;
    	}
    	
    	public static function GetHomeDataRow($id)
    	{
    		return mysql_fetch_assoc(mysql_query("SELECT * FROM homes WHERE home_id = '".mysql_real_escape_string($id)."' LIMIT 1"));
    	}
    	
    	public static function GetHome($id)
    	{
    		$data = HomesManager::GetHomeDataRow($id);
    		
    		if ($data == null)
    		{
    			return null;
    		}
    		else
    		{
    			return new Home($data['home_id'], $data['link_id']);
    		}
    	}
    	
    	public static function DisplayHome($id)
    	{
    		return mysql_fetch_assoc(mysql_query("SELECT allow_display FROM homes WHERE home_id = '".mysql_real_escape_string($id)."' AND allow_display = '1' LIMIT 1"));
    	}
    	
    	public static function GetUserDataRow($id)
    	{
    		return mysql_fetch_assoc(mysql_query("SELECT username FROM users WHERE id = '".mysql_real_escape_string($id)."' LIMIT 1"));
    	}
    	
    	public static function BadgesExist($id)
    	{
    		return  mysql_num_rows(mysql_query("SELECT id FROM homes_items WHERE data = 'badges' AND home_id = '".mysql_real_escape_string($id)."' LIMIT 1"));
    	}
    }
    
    class Home
    {
    	public $id = 0;
    	public $linkId = 0;
    	
    	public function Home($id, $linkId)
    	{
    		$this->id = $id;
    		$this->linkId = $linkId;
    	}
    	
    	public function AddItem($x, $y, $z, $data, $skin)
    	{
    		mysql_query("INSERT INTO homes_items (home_id,x,y,z,data,skin) VALUES ('".mysql_real_escape_string($this->id)."','".mysql_real_escape_string($x)."','".($y)."','".mysql_real_escape_string($z)."','".mysql_real_escape_string($data)."','".mysql_real_escape_string($skin)."')");
    	}
    	
    	public function GetItems($id = false)
    	{
    		if($id == false)
    		{
    			$list = Array();
    			$get = mysql_query("SELECT * FROM homes_items WHERE home_id = '".mysql_real_escape_string($this->linkId)."' ORDER BY x ASC");
    	
    			while ($item = mysql_fetch_assoc($get))
    			{
    				$list[] = new HomeItem($item['id'], $item['home_id'], $item['data'], $item['skin'], $item['x'], $item['y'], $item['z']);
    			}
    		}
    		else
    		{
    			$item = mysql_fetch_assoc(mysql_query("SELECT * FROM homes_items WHERE id = '".mysql_real_escape_string($id)."' LIMIT 1"));
    			$list = new HomeItem($item['id'], $item['home_id'], $item['data'], $item['skin'], $item['x'], $item['y'], $item['z']);
    		}
    		
    		return $list;
    	}
    }
    
    class HomeItem
    {
    	public $id = 0;
    	public $homeId = 0;
    	
    	public $data = '';
    	public $skin = '';
    	
    	public $x = 0;
    	public $y = 0;
    	public $z = 0;
    	
    	public function HomeItem($id, $homeId, $data, $skin, $x, $y, $z)
    	{
    		$this->id = $id;
    		$this->homeId = $homeId;
    		$this->data = $data;
    		$this->skin = $skin;
    		$this->x = $x;
    		$this->y = $y;
    		$this->z = $z;
    	}
    	
    	public function GetHome()
    	{
    		return HomesManager::GetHome($this->homeId);
    	}
    	
    	public function UpdateItem($skinId, $stickieId)
    	{
    		switch($skinId)
    		{
    			case 1:
    				$skin = 'defaultskin';
    				break;
    			case 2:
    				$skin = 'speechbubbleskin';
    				break;
    			case 3:
    				$skin = 'metalskin';
    				break;
    			case 4:
    				$skin = 'noteitskin';
    				break;
    			case 5:
    				$skin = 'notepadskin';
    				break;
    			case 6:
    				$skin = 'goldenskin';
    				break;
    			case 7:
    				$skin = 'hc_machineskin';
    				break;
    			case 8:
    				$skin = 'hc_pillowskin';
    				break;
    			default:
    				$skin = 'defaultskin';
    				break;
    		}
    		
    		mysql_query("UPDATE homes_items SET skin = '".mysql_real_escape_string($skinId)."' WHERE id = '".mysql_real_escape_string($stickieId)."'");
    		
    		$item = mysql_fetch_assoc(mysql_query("SELECT * from homes_items WHERE id = '".$stickieId."'"));
    		$list = new HomeItem($item['id'], $item['home_id'], $item['data'], $item['skin'], $item['x'], $item['y'], $item['z']);	
    		
    		return $list->GetHtml();
    	}
    	
    	public function GetHtml()
    	{
    		switch (strtolower($this->data))
    		{
    			case 'profile':
    			$widget = new Template('widgets/profile');
    			
    			$row = mysql_fetch_assoc(mysql_query("SELECT username, look, account_created, online FROM users WHERE id = '".mysql_real_escape_string($this->GetHome()->linkId)."' LIMIT 1"));
    			
    			if ($row['online'] == 1)
    			{
    				$status = 'online';
    			}
    			else
    			{
    				$status = 'offline';
    			}
    			
    			$widget->SetParam('profile', '<span class="name-text">'.$row['username'].'</span>
    										</div>
    										<br class="clear" />
    										<img src="'.WWW.'/habboweb/63_1dc60c6d6ea6e089c6893ab4e0541ee0/879/web-gallery/images/myhabbo/profile/habbo_'.$status.'.gif" alt="'.$status.'" />
    										<div class="birthday text">
    											Created on:
    										</div>
    										<div class="birthday date">
    											'.$row['account_created'].'
    
    										</div>
    									<div>
    								</div>
    							</div>
    							<div class="profile-figure">
    								<img src="http://www.habbo.com/habbo-imaging/avatarimage?figure='.$row['look'].'&direction=4" alt="'.$row['username'].'" />');
    			break;
    			
    			case 'badges':
    			$widget = new Template('widgets/badges');
    			
    			$query = mysql_query("SELECT badge_id FROM user_badges WHERE user_id = '".mysql_real_escape_string($this->GetHome()->linkId)."'");
    			if (mysql_num_rows($query) > 0)
    			{
    				while($row = mysql_fetch_assoc($query))
    				{
    					$widget->SetParam('badges', '<li style="background-image: url(http://habbo.hs.llnwd.net/c_images/album1584/'.$row['badge_id'].'.gif)"></li>');
    				}
    			}
    			else
    			{
    				$widget->SetParam('badges', 'You do not own any badges.');
    			}
    			break;
    		}
    		
    		$widget->SetParam('id', $this->id);
    		$widget->SetParam('pos-x', $this->x);
    		$widget->SetParam('pos-y', $this->y);
    		$widget->SetParam('pos-z', $this->z);
    		$widget->SetParam('skin', $this->skin);
    		
    		if (isset($_SESSION['EditHome']))
    		{
    			if ($_SESSION['EditHome'] == $this->GetHome()->linkId)
    			{
    				$widget->SetParam('edit-home', '<h3>
    										<img src="'.WWW.'/habboweb/63_1dc60c6d6ea6e089c6893ab4e0541ee0/879/web-gallery/images/myhabbo/icon_edit.gif" width="19" height="18" class="edit-button" id="widget-'.$this->id.'-edit" />
    										<script type="text/javascript">
    											var editButtonCallback = function(e)
    											{
    												openEditMenu(e, '.$this->id.', "widget", "widget-'.$this->id.'-edit");
    											};
    											Event.observe("widget-'.$this->id.'-edit", "click", editButtonCallback);
    											Event.observe("widget-'.$this->id.'-edit", "editButton:click", editButtonCallback);
    										</script>');
    			}
    		}
    		else
    		{
    			$widget->SetParam('edit-home', '<h3>');
    		}
    		
    		return $widget->GetHtml();
    	}
    }
    ?>
    .HTACCESS
    Code:
    RewriteRule ^habblet/ajax/([^/]+)(|/)$ /habblet.php?cmd=$1
    SQL
    Code:
    -- --------------------------------------------------------
    
    --
    -- Table structure for table `homes`
    --
    
    CREATE TABLE IF NOT EXISTS `homes` (
      `home_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
      `allow_display` enum('0','1') NOT NULL DEFAULT '1',
      `link_id` int(11) NOT NULL,
      PRIMARY KEY (`home_id`)
    ) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
    
    
    -- --------------------------------------------------------
    
    --
    -- Table structure for table `homes_items`
    --
    
    CREATE TABLE IF NOT EXISTS `homes_items` (
      `id` int(11) NOT NULL AUTO_INCREMENT,
      `home_id` int(10) unsigned NOT NULL,
      `x` int(11) NOT NULL DEFAULT '0',
      `y` int(11) NOT NULL DEFAULT '0',
      `z` int(11) NOT NULL DEFAULT '0',
      `data` varchar(500) NOT NULL,
      `skin` text NOT NULL,
      PRIMARY KEY (`id`),
      KEY `home_id` (`home_id`),
      KEY `data` (`data`)
    ) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
    
    
    -- --------------------------------------------------------
    PRINT



    More than likely you're going to have to edit the parameters for this, but other than that, it'll work like a charm. :)


  2. #2
    Alpha Member Moogly is offline
    MemberRank
    Feb 2008 Join Date
    Pool LidoLocation
    2,322Posts

    Re: [REL][UBER] Habbo Homes.

    Thanks for the contribution, it's been a while since anyone's posted something I actually like (homes make me think of r13).
    Last edited by Moogly; 06-06-12 at 06:32 AM.

  3. #3
    Eye Eye Capt'n Spheral is offline
    MemberRank
    May 2010 Join Date
    TumptonshireLocation
    2,488Posts

    Re: [REL][UBER] Habbo Homes.

    i already have something like this, modern homes, i think it was called, but this seems handy.

  4. #4
    Run, but I'll find you. Ddos Attack is offline
    MemberRank
    Jan 2011 Join Date
    AustraliaLocation
    908Posts

    Re: [REL][UBER] Habbo Homes.

    Quote Originally Posted by JohnHearfield View Post
    i already have something like this, modern homes, i think it was called, but this seems handy.
    Modern Homes is just like any other page on UberCMS whereas this is like the actual Homes system, only just with not as much features. I've tried it out, it allows you to move the objects around, show your badges and change the style of those containers. Doesn't have the inventory or any of that.
    Otherwise, this is a nice release.

  5. #5
    Ex-Supervisor Sean is offline
    LegendRank
    Jun 2007 Join Date
    JerseyLocation
    4,097Posts

    Re: [REL][UBER] Habbo Homes.

    Decent release, thanks for this +rep. Glad people are contributing to this section ;-)

  6. #6
    Account Upgraded | Title Enabled! sidney023 is offline
    MemberRank
    Feb 2012 Join Date
    NetherlandsLocation
    251Posts

    Re: [REL][UBER] Habbo Homes.

    Realy nice,
    can you make this for revcms habbo style to ;x?

    Sidney,

    (Like + repped)!

  7. #7
    Member xforlife is offline
    MemberRank
    Jan 2012 Join Date
    NetherlandsLocation
    94Posts

    Re: [REL][UBER] Habbo Homes.

    i need the files for the homes

    Title: Could not load template: widgets/profile
    Text: Could not load template: widgets/profile

    please upload it..

  8. #8
    Account Upgraded | Title Enabled! Predict is offline
    MemberRank
    Aug 2008 Join Date
    760Posts

    Re: [REL][UBER] Habbo Homes.

    Widgets badges

    Code:
    	<div class="movable widget BadgesWidget" id="widget-|id|" style="top:|pos-y|px;left:|pos-x|px;z-index:|pos-z|;">
    						<div class="|skin|" style="width:100%;">
    							<div class="widget-corner" id="widget-|id|-handle">
    								<div class="widget-headline">
    									|edit-home|
    
    										<span class="header-left">&nbsp;</span>
    										<span class="header-middle">Badges & Achievements</span>
    										<span class="header-right">&nbsp;</span>
    									</h3>
    								</div>
    							</div>
    							<div class="widget-body">
    								<div class="widget-content" style="width:417px;">
    									<div id="badgelist-content">
    										<ul class="clearfix">
    											|badges|
    										</ul>
    										<div id="badge-list-paging">
    
    										</div>
    									</div>
    									<div class="clear"></div>
    								</div>
    							</div>
    						</div>
    					</div>
    Widgets profile
    Code:
    	<div class="movable widget ProfileWidget" id="widget-|id|" style=" left: |pos-x|px; top: |pos-y|px; z-index: |pos-z|;"> 
    						<div class="|skin|">
    							<div class="widget-corner" id="widget-|id|-handle">
    								<div class="widget-headline">
    									|edit-home|
    
    										<span class="header-left">&nbsp;</span>
    										<span class="header-middle">MY HABBO</span>
    										<span class="header-right">&nbsp;</span>
    									</h3>
    								</div>
    							</div>
    							<div class="widget-body">
    								<div class="widget-content">
    									<div class="profile-info">
    										<div class="name" style="float: left">
    											|profile|
    							</div>
    							<br clear="all" style="display: block; height: 1px"/>
    							<div class="clear"></div>
    						</div>
    					</div>
    				</div>
    			</div>
    Create them as .TPL files.

  9. #9
    Member xforlife is offline
    MemberRank
    Jan 2012 Join Date
    NetherlandsLocation
    94Posts

    Re: [REL][UBER] Habbo Homes.

    how call's the tpl names?

  10. #10
    hoi Nilenz is offline
    MemberRank
    May 2011 Join Date
    The NetherlandsLocation
    380Posts

    Re: [REL][UBER] Habbo Homes.

    Thanks i will be used it!
    But is this Exploit free?

  11. #11
    Zephyr Studios PRIZM is offline
    MemberRank
    Feb 2012 Join Date
    DenmarkLocation
    2,291Posts

    Re: [REL][UBER] Habbo Homes.

    I am not going to use this, because i hate UberCMS. But thanks for release and well done

  12. #12
    Account Upgraded | Title Enabled! Predict is offline
    MemberRank
    Aug 2008 Join Date
    760Posts

    Re: [REL][UBER] Habbo Homes.

    Quote Originally Posted by xforlife View Post
    how call's the tpl names?
    class.tpl.php already calls them for you, but as I said, you're going to need to edit the parameters. ;p

    Quote Originally Posted by Nilenz View Post
    Thanks i will be used it!
    But is this Exploit free?
    It's a secure build.

    Quote Originally Posted by SuckLake View Post
    I am not going to use this, because i hate UberCMS. But thanks for release and well done
    Thanks, I released this as I wanted to create my own homes which I can work on. ;p

    Probably not the last revision ^

  13. #13
    topkek amirite?? Leon is offline
    MemberRank
    May 2009 Join Date
    919Posts

    Re: [REL][UBER] Habbo Homes.

    Quote Originally Posted by Predict View Post
    class.tpl.php already calls them for you, but as I said, you're going to need to edit the parameters. ;p



    It's a secure build.



    Thanks, I released this as I wanted to create my own homes which I can work on. ;p

    Probably not the last revision ^
    Looks great, Predict!

  14. #14
    Infraction Banned xXlimabeanX is offline
    MemberRank
    May 2012 Join Date
    1Posts

    Re: [REL][UBER] Habbo Homes.

    This should really be made for RevCMS, it would move alot of people away from uber since a main feature of uber is homes and groups :)

  15. #15
    Proficient Member </Meap> is offline
    MemberRank
    Jul 2010 Join Date
    159Posts

    Re: [REL][UBER] Habbo Homes.

    when will you be relasing this? (image below)



Page 1 of 2 12 LastLast

Advertisement