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
[PHP] What is wrong with this script?
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="frash23" data-source="post: 115205" data-attributes="member: 17636"><p>I recently got this script to make homes work, but this line is seeming to give an error:</p><p> </p><p>[CODE]<img src="'deltahotel.co/web-gallery/images/myhabbo/profile/habbo_'.$status.'.gif" alt="'.$status.'" />[/CODE]</p><p> </p><p>This is the error:</p><p> </p><p><strong><span style="font-size: 15px"><span style="font-family: 'Times New Roman'"><span style="color: #000000">Parse error</span></span></span></strong><span style="font-size: 15px"><span style="font-family: 'Times New Roman'"><span style="color: #000000">: syntax error, unexpected T_STRING in </span></span></span><strong><span style="font-size: 15px"><span style="font-family: 'Times New Roman'"><span style="color: #000000">/home/a6639703/public_html/includes/class.homes.php</span></span></span></strong><span style="font-size: 15px"><span style="font-family: 'Times New Roman'"><span style="color: #000000"> on line </span></span></span><strong><span style="font-size: 15px"><span style="font-family: 'Times New Roman'"><span style="color: #000000">196</span></span></span></strong></p><p> </p><p>This is the full page:</p><p>[CODE]<?php</p><p>class HomesManager</p><p>{</p><p> public static function HomeExists($linkId)</p><p> {</p><p> return ((mysql_num_rows(mysql_query("SELECT null FROM homes WHERE link_id = '".mysql_real_escape_string($linkId)."' LIMIT 1")) > 0) ? true : false);</p><p> }</p><p> </p><p> public static function GetHomeId($linkId)</p><p> {</p><p> if (!HomesManager::HomeExists($linkId))</p><p> {</p><p> return 0;</p><p> }</p><p> else</p><p> {</p><p> return mysql_result(mysql_query("SELECT home_id FROM homes WHERE link_id = '".mysql_real_escape_string($linkId)."' LIMIT 1"), 0);</p><p> }</p><p> }</p><p> </p><p> public static function CreateHome($linkId)</p><p> {</p><p> mysql_query("INSERT INTO homes (home_id,link_id,allow_display) VALUES ($linkId,'".mysql_real_escape_string($linkId)."','1')");</p><p> </p><p> $homeId = HomesManager::GetHomeId($linkId);</p><p> $home = HomesManager::GetHome($homeId);</p><p> </p><p> $home->AddItem(463, 39, 1, 'profile', 'w_skin_defaultskin', $linkId);</p><p> </p><p> return $homeId;</p><p> }</p><p> </p><p> public static function GetHomeDataRow($id)</p><p> {</p><p> return mysql_fetch_assoc(mysql_query("SELECT * FROM homes WHERE home_id = '".mysql_real_escape_string($id)."' LIMIT 1"));</p><p> }</p><p> </p><p> public static function GetHome($id)</p><p> {</p><p> $data = HomesManager::GetHomeDataRow($id);</p><p> </p><p> if ($data == null)</p><p> {</p><p> return null;</p><p> }</p><p> else</p><p> {</p><p> return new Home($data['home_id'], $data['link_id']);</p><p> }</p><p> }</p><p> </p><p> public static function DisplayHome($id)</p><p> {</p><p> 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"));</p><p> }</p><p> </p><p> public static function GetUserDataRow($id)</p><p> {</p><p> return mysql_fetch_assoc(mysql_query("SELECT username FROM users WHERE id = '".mysql_real_escape_string($id)."' LIMIT 1"));</p><p> }</p><p> </p><p> public static function BadgesExist($id)</p><p> {</p><p> return mysql_num_rows(mysql_query("SELECT id FROM homes_items WHERE data = 'badges' AND home_id = '".mysql_real_escape_string($id)."' LIMIT 1"));</p><p> }</p><p>}</p><p> </p><p>class Home</p><p>{</p><p> public $id = 0;</p><p> public $linkId = 0;</p><p> </p><p> public function Home($id, $linkId)</p><p> {</p><p> $this->id = $id;</p><p> $this->linkId = $linkId;</p><p> }</p><p> </p><p> public function AddItem($x, $y, $z, $data, $skin)</p><p> {</p><p> 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)."')");</p><p> }</p><p> </p><p> public function GetItems($id = false)</p><p> {</p><p> if($id == false)</p><p> {</p><p> $list = Array();</p><p> $get = mysql_query("SELECT * FROM homes_items WHERE home_id = '".mysql_real_escape_string($this->linkId)."' ORDER BY x ASC");</p><p> </p><p> while ($item = mysql_fetch_assoc($get))</p><p> {</p><p> $list[] = new HomeItem($item['id'], $item['home_id'], $item['data'], $item['skin'], $item['x'], $item['y'], $item['z']);</p><p> }</p><p> }</p><p> else</p><p> {</p><p> $item = mysql_fetch_assoc(mysql_query("SELECT * FROM homes_items WHERE id = '".mysql_real_escape_string($id)."' LIMIT 1"));</p><p> $list = new HomeItem($item['id'], $item['home_id'], $item['data'], $item['skin'], $item['x'], $item['y'], $item['z']);</p><p> }</p><p> </p><p> return $list;</p><p> }</p><p>}</p><p> </p><p>class HomeItem</p><p>{</p><p> public $id = 0;</p><p> public $homeId = 0;</p><p> </p><p> public $data = '';</p><p> public $skin = '';</p><p> </p><p> public $x = 0;</p><p> public $y = 0;</p><p> public $z = 0;</p><p> </p><p> public function HomeItem($id, $homeId, $data, $skin, $x, $y, $z)</p><p> {</p><p> $this->id = $id;</p><p> $this->homeId = $homeId;</p><p> $this->data = $data;</p><p> $this->skin = $skin;</p><p> $this->x = $x;</p><p> $this->y = $y;</p><p> $this->z = $z;</p><p> }</p><p> </p><p> public function GetHome()</p><p> {</p><p> return HomesManager::GetHome($this->homeId);</p><p> }</p><p> </p><p> public function UpdateItem($skinId, $stickieId)</p><p> {</p><p> switch($skinId)</p><p> {</p><p> case 1:</p><p> $skin = 'defaultskin';</p><p> break;</p><p> case 2:</p><p> $skin = 'speechbubbleskin';</p><p> break;</p><p> case 3:</p><p> $skin = 'metalskin';</p><p> break;</p><p> case 4:</p><p> $skin = 'noteitskin';</p><p> break;</p><p> case 5:</p><p> $skin = 'notepadskin';</p><p> break;</p><p> case 6:</p><p> $skin = 'goldenskin';</p><p> break;</p><p> case 7:</p><p> $skin = 'hc_machineskin';</p><p> break;</p><p> case 8:</p><p> $skin = 'hc_pillowskin';</p><p> break;</p><p> default:</p><p> $skin = 'defaultskin';</p><p> break;</p><p> }</p><p> </p><p> mysql_query("UPDATE homes_items SET skin = '".mysql_real_escape_string($skinId)."' WHERE id = '".mysql_real_escape_string($stickieId)."'");</p><p> </p><p> $item = mysql_fetch_assoc(mysql_query("SELECT * from homes_items WHERE id = '".$stickieId."'"));</p><p> $list = new HomeItem($item['id'], $item['home_id'], $item['data'], $item['skin'], $item['x'], $item['y'], $item['z']); </p><p> </p><p> return $list->GetHtml();</p><p> }</p><p> </p><p> public function GetHtml()</p><p> {</p><p> switch (strtolower($this->data))</p><p> {</p><p> case 'profile':</p><p> $widget = new Template('widgets/profile');</p><p> </p><p> $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"));</p><p> </p><p> if ($row['online'] == 1)</p><p> {</p><p> $status = 'online';</p><p> }</p><p> else</p><p> {</p><p> $status = 'offline';</p><p> }</p><p> </p><p> $widget->SetParam('profile', '<span class="name-text">'.$row['username'].'</span></p><p> </div></p><p> <br class="clear" /></p><p> <img src="'deltahotel.co/web-gallery/images/myhabbo/profile/habbo_'.$status.'.gif" alt="'.$status.'" /></p><p> <div class="birthday text"></p><p> Created on:</p><p> </div></p><p> <div class="birthday date"></p><p> '.$row['account_created'].'</p><p> </p><p> </div></p><p> <div></p><p> </div></p><p> </div></p><p> <div class="profile-figure"></p><p> <img src="http://www.habbo.com/habbo-imaging/avatarimage?figure='.$row['look'].'&direction=4" alt="'.$row['username'].'" />');</p><p> break;</p><p> </p><p> case 'badges':</p><p> $widget = new Template('widgets/badges');</p><p> </p><p> $query = mysql_query("SELECT badge_id FROM user_badges WHERE user_id = '".mysql_real_escape_string($this->GetHome()->linkId)."'");</p><p> if (mysql_num_rows($query) > 0)</p><p> {</p><p> while($row = mysql_fetch_assoc($query))</p><p> {</p><p> $widget->SetParam('badges', '<li style="background-image: url(http://habbo.hs.llnwd.net/c_images/album1584/'.$row['badge_id'].'.gif)"></li>');</p><p> }</p><p> }</p><p> else</p><p> {</p><p> $widget->SetParam('badges', 'You do not own any badges.');</p><p> }</p><p> break;</p><p> }</p><p> </p><p> $widget->SetParam('id', $this->id);</p><p> $widget->SetParam('pos-x', $this->x);</p><p> $widget->SetParam('pos-y', $this->y);</p><p> $widget->SetParam('pos-z', $this->z);</p><p> $widget->SetParam('skin', $this->skin);</p><p> </p><p> if (isset($_SESSION['EditHome']))</p><p> {</p><p> if ($_SESSION['EditHome'] == $this->GetHome()->linkId)</p><p> {</p><p> $widget->SetParam('edit-home', '<h3></p><p> <img src="'deltahotel.co/web-gallery/images/myhabbo/icon_edit.gif" width="19" height="18" class="edit-button" id="widget-'.$this->id.'-edit" /></p><p> <script type="text/javascript"></p><p> var editButtonCallback = function(e)</p><p> {</p><p> openEditMenu(e, '.$this->id.', "widget", "widget-'.$this->id.'-edit");</p><p> };</p><p> Event.observe("widget-'.$this->id.'-edit", "click", editButtonCallback);</p><p> Event.observe("widget-'.$this->id.'-edit", "editButton:click", editButtonCallback);</p><p> </script>');</p><p> }</p><p> }</p><p> else</p><p> {</p><p> $widget->SetParam('edit-home', '<h3>');</p><p> }</p><p> </p><p> return $widget->GetHtml();</p><p> }</p><p>}</p><p>?>[/CODE]</p><p>Can anybody help??</p></blockquote><p></p>
[QUOTE="frash23, post: 115205, member: 17636"] I recently got this script to make homes work, but this line is seeming to give an error: [CODE]<img src="'deltahotel.co/web-gallery/images/myhabbo/profile/habbo_'.$status.'.gif" alt="'.$status.'" />[/CODE] This is the error: [B][SIZE=4][FONT=Times New Roman][COLOR=#000000]Parse error[/COLOR][/FONT][/SIZE][/B][SIZE=4][FONT=Times New Roman][COLOR=#000000]: syntax error, unexpected T_STRING in [/COLOR][/FONT][/SIZE][B][SIZE=4][FONT=Times New Roman][COLOR=#000000]/home/a6639703/public_html/includes/class.homes.php[/COLOR][/FONT][/SIZE][/B][SIZE=4][FONT=Times New Roman][COLOR=#000000] on line [/COLOR][/FONT][/SIZE][B][SIZE=4][FONT=Times New Roman][COLOR=#000000]196[/COLOR][/FONT][/SIZE][/B] This is the full page: [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="'deltahotel.co/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="'deltahotel.co/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(); } } ?>[/CODE] Can anybody help?? [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
Server Development
Habbo Retros
Habbo Q&A
[PHP] What is wrong with this script?
Top