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
BrainCMS | How do I fix the Fatal error for Currently in the room
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="Wieiscool" data-source="post: 469496" data-attributes="member: 27468"><p>Currently in the room could be fixed with this:</p><p></p><p>Replace "roomcount.php" in "templates/brain" with the following code:</p><p></p><p>[CODE=php]<?php</p><p> $sql = $dbh->prepare("SELECT id,users,name,owner_id,owner_name FROM rooms WHERE users > 0 ORDER BY users DESC LIMIT 5");</p><p> $sql->execute();</p><p> If($sql->RowCount() > 0)</p><p> {</p><p> while ($on = $sql->fetch())</p><p> {</p><p> echo'</p><p> <a style="text-decoration: none;color: #000;"></p><p> <img src="/templates/brain/style/images/icons/habbo_online_anim.gif" align="right"></p><p> ';</p><p> if ($on['users'] == 0)</p><p> {</p><p> $onlineUsers = '<img style="padding-right: 10px;" src="/templates/brain/style/images/icons/room_icon_1.gif" align="left">';</p><p> }</p><p> else if ($on['users'] > 29)</p><p> {</p><p> $onlineUsers = '<img style="padding-right: 10px;" src="/templates/brain/style/images/icons/room_icon_5.gif" align="left">';</p><p> }</p><p> else if ($on['users'] > 19)</p><p> {</p><p> $onlineUsers = '<img style="padding-right: 10px;" src="/templates/brain/style/images/icons/room_icon_4.gif" align="left">';</p><p> }</p><p> else if ($on['users'] > 9)</p><p> {</p><p> $onlineUsers = '<img style="padding-right: 10px;" src="/templates/brain/style/images/icons/room_icon_3.gif" align="left">';</p><p> }</p><p> else if ($on['users'] > 0)</p><p> {</p><p> $onlineUsers = '<img style="padding-right: 10px;" src="/templates/brain/style/images/icons/room_icon_2.gif" align="left">';</p><p> }</p><p> echo $onlineUsers;</p><p> echo'</p><p> <div class="users_now"></p><p> </div></p><p> <div class="caption"></p><p> <b>'.filter($on['name']).'.</b> </div></p><p> <div class="owner"></p><p> Currently <b>'.filter($on['users']).'</b> user(s) in the room.<br></p><p> Room owner: <a href="/home/'.filter($on['owner_name']) .'"><b>'.filter($on['owner_name']).'</a></b></p><p> </div></p><p> <hr></p><p> </a></p><p> ';</p><p> }</p><p> }</p><p> else</p><p> {</p><p> echo '</p><p> <img style="padding-right: 10px;" src="/templates/brain/style/images/icons/room_icon_1.gif" align="left"></p><p> <div class="users_now"></p><p> </div></p><p> <div class="caption"></p><p> <b><br>there are no users in a room.</b></div></p><p> <div class="owner"></p><p> </div></p><p> ';</p><p> }</p><p>?> [/CODE]</p><p></p><p>Buy vip should be fixed with:</p><p></p><p>Go to "system/app/plugins" and replace the code in "buyvip.php" with this code:</p><p></p><p></p><p>[CODE=php]<?php</p><p> if(!defined('BRAIN_CMS'))</p><p> {</p><p> die('Sorry but you cannot access this file!');</p><p> }</p><p> function buyvip()</p><p> {</p><p> global $dbh,$config,$lang;</p><p> if (isset($_POST['getvip']))</p><p> {</p><p> if (User::userData('vip_points') >= $config['vipCost'])</p><p> {</p><p> if (User::userData('online') == 1)</p><p> {</p><p> return Html::error($lang["Vonline"]);</p><p> }</p><p> else</p><p> {</p><p> if (User::userData('rank') == $config['vipRankToGet'])</p><p> {</p><p> return Html::error($lang["Valreadyvip"]);</p><p> }</p><p> else</p><p> {</p><p> $removeDiamonds = $dbh->prepare("</p><p> UPDATE users_currency SET</p><p> amount=amount - :cost</p><p> WHERE</p><p> user_id=:id</p><p> AND</p><p> type=5</p><p> ");</p><p> $removeDiamonds->bindParam(':id', $_SESSION['id']);</p><p> $removeDiamonds->bindParam(':cost', $config['vipCost']);</p><p> $removeDiamonds->execute();</p><p> $giveVipRank = $dbh->prepare("</p><p> UPDATE users SET</p><p> rank = :viprank</p><p> WHERE</p><p> id=:id</p><p> ");</p><p> $giveVipRank->bindParam(':id', $_SESSION['id']);</p><p> $giveVipRank->bindParam(':viprank', $config['vipRankToGet']);</p><p> $giveVipRank->execute();</p><p> $giveVipBadge = $dbh->prepare("</p><p> INSERT INTO</p><p> users_badges</p><p> (user_id, slot_id, badge_code)</p><p> VALUES</p><p> (</p><p> :id,</p><p> 0,</p><p> :badgeid</p><p> )");</p><p> $giveVipBadge->bindParam(':id', $_SESSION['id']);</p><p> $giveVipBadge->bindParam(':badgeid', $config['vipBadge']);</p><p> $giveVipBadge->execute();</p><p> return Html::errorSucces($lang["VbuySucces"]);</p><p> }</p><p> }</p><p> }</p><p> else</p><p> {</p><p> return Html::error($lang["VnoDimonds"]);</p><p> }</p><p> }</p><p> }[/CODE]</p><p></p><p></p><p>If any more errors occur, let us know <img src="/styles/default/xenforo/smilies/emojione/smile.png" class="smilie" loading="lazy" alt=":)" title="Smile :)" data-shortname=":)" /></p></blockquote><p></p>
[QUOTE="Wieiscool, post: 469496, member: 27468"] Currently in the room could be fixed with this: Replace "roomcount.php" in "templates/brain" with the following code: [CODE=php]<?php $sql = $dbh->prepare("SELECT id,users,name,owner_id,owner_name FROM rooms WHERE users > 0 ORDER BY users DESC LIMIT 5"); $sql->execute(); If($sql->RowCount() > 0) { while ($on = $sql->fetch()) { echo' <a style="text-decoration: none;color: #000;"> <img src="/templates/brain/style/images/icons/habbo_online_anim.gif" align="right"> '; if ($on['users'] == 0) { $onlineUsers = '<img style="padding-right: 10px;" src="/templates/brain/style/images/icons/room_icon_1.gif" align="left">'; } else if ($on['users'] > 29) { $onlineUsers = '<img style="padding-right: 10px;" src="/templates/brain/style/images/icons/room_icon_5.gif" align="left">'; } else if ($on['users'] > 19) { $onlineUsers = '<img style="padding-right: 10px;" src="/templates/brain/style/images/icons/room_icon_4.gif" align="left">'; } else if ($on['users'] > 9) { $onlineUsers = '<img style="padding-right: 10px;" src="/templates/brain/style/images/icons/room_icon_3.gif" align="left">'; } else if ($on['users'] > 0) { $onlineUsers = '<img style="padding-right: 10px;" src="/templates/brain/style/images/icons/room_icon_2.gif" align="left">'; } echo $onlineUsers; echo' <div class="users_now"> </div> <div class="caption"> <b>'.filter($on['name']).'.</b> </div> <div class="owner"> Currently <b>'.filter($on['users']).'</b> user(s) in the room.<br> Room owner: <a href="/home/'.filter($on['owner_name']) .'"><b>'.filter($on['owner_name']).'</a></b> </div> <hr> </a> '; } } else { echo ' <img style="padding-right: 10px;" src="/templates/brain/style/images/icons/room_icon_1.gif" align="left"> <div class="users_now"> </div> <div class="caption"> <b><br>there are no users in a room.</b></div> <div class="owner"> </div> '; } ?> [/CODE] Buy vip should be fixed with: Go to "system/app/plugins" and replace the code in "buyvip.php" with this code: [CODE=php]<?php if(!defined('BRAIN_CMS')) { die('Sorry but you cannot access this file!'); } function buyvip() { global $dbh,$config,$lang; if (isset($_POST['getvip'])) { if (User::userData('vip_points') >= $config['vipCost']) { if (User::userData('online') == 1) { return Html::error($lang["Vonline"]); } else { if (User::userData('rank') == $config['vipRankToGet']) { return Html::error($lang["Valreadyvip"]); } else { $removeDiamonds = $dbh->prepare(" UPDATE users_currency SET amount=amount - :cost WHERE user_id=:id AND type=5 "); $removeDiamonds->bindParam(':id', $_SESSION['id']); $removeDiamonds->bindParam(':cost', $config['vipCost']); $removeDiamonds->execute(); $giveVipRank = $dbh->prepare(" UPDATE users SET rank = :viprank WHERE id=:id "); $giveVipRank->bindParam(':id', $_SESSION['id']); $giveVipRank->bindParam(':viprank', $config['vipRankToGet']); $giveVipRank->execute(); $giveVipBadge = $dbh->prepare(" INSERT INTO users_badges (user_id, slot_id, badge_code) VALUES ( :id, 0, :badgeid )"); $giveVipBadge->bindParam(':id', $_SESSION['id']); $giveVipBadge->bindParam(':badgeid', $config['vipBadge']); $giveVipBadge->execute(); return Html::errorSucces($lang["VbuySucces"]); } } } else { return Html::error($lang["VnoDimonds"]); } } }[/CODE] If any more errors occur, let us know :) [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
Server Development
Habbo Retros
Habbo Q&A
BrainCMS | How do I fix the Fatal error for Currently in the room
Top