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
How to convert users id to username
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="SBste01" data-source="post: 426087" data-attributes="member: 40804"><p>Hey,</p><p>I've noticed that on a lot of retros, the Hot Rooms on the /community page has the owners username on it. When I put it into my community page, it comes up with the user's ID instead of the username. Is there a way you are able to convert it from their ID to their username? Attached below is a photo of it and the /community.php page.</p><p></p><p>Photo:</p><p>[SPOILER]</p><p>[ATTACH=full]6716[/ATTACH]</p><p>[/SPOILER]</p><p></p><p>community.php</p><p>[SPOILER]</p><p><?php</p><p>$eo = 'even';</p><p></p><p>function GenerateRoomOccupancy($usersNow, $usersMax)</p><p>{</p><p> $num = 1;</p><p> $percentage = intval(($usersNow / $usersMax) * 100);</p><p></p><p> if ($percentage <= 0)</p><p> {</p><p> $num = 1;</p><p> }</p><p> else if ($percentage < 35)</p><p> {</p><p> $num = 2;</p><p> }</p><p> else if ($percentage < 75)</p><p> {</p><p> $num = 3;</p><p> }</p><p> else if ($percentage < 100)</p><p> {</p><p> $num = 4;</p><p> }</p><p> else if ($percentage >= 100)</p><p> {</p><p> $num = 5;</p><p> }</p><p></p><p> return 'room-occupancy-' . $num;</p><p>}</p><p></p><p>?></p><p><div class="habblet-container "></p><p><div class="cbb clearfix settings "></p><p></p><p><h2 class="title">Hot Rooms</h2></p><p></p><p><style type="text/css"></p><p>.room-occupancy-1 { background-image: url('{url}/app/tpl/skins/Habbo/images/rooms/room_icon_1.gif') !important; }</p><p>.room-occupancy-2 { background-image: url('{url}/app/tpl/skins/Habbo/images/rooms/room_icon_2.gif') !important; }</p><p>.room-occupancy-3 { background-image: url('{url}/app/tpl/skins/Habbo/images/rooms/room_icon_3.gif') !important; }</p><p>.room-occupancy-4 { background-image: url('{url}/app/tpl/skins/Habbo/images/rooms/room_icon_4.gif') !important; }</p><p>.room-occupancy-5 { background-image: url('{url}/app/tpl/skins/Habbo/images/rooms/room_icon_5.gif') !important; }</p><p></style></p><p></p><p><div id="rooms-habblet-list-container-h124" class="recommendedrooms-lite-habblet-list-container"></p><p><ul class="habblet-list"></p><p></p><p><?php</p><p></p><p>$get = mysql_query("SELECT * FROM rooms WHERE roomtype = 'private' ORDER BY users_now DESC LIMIT 5")or die(mysql_error());</p><p></p><p>while ($room = mysql_fetch_assoc($get))</p><p>{</p><p> if ($eo == 'even')</p><p> {</p><p> $eo = 'odd';</p><p> }</p><p> else</p><p> {</p><p> $eo = 'even';</p><p> }</p><p></p><p> echo '<li class="' . $eo . '"></p><p> <span class="clearfix enter-room-link ' . GenerateRoomOccupancy($room['users_now'], $room['users_max']) . '" title="Go There" roomid="' . $room['id'] . '"></p><p> <span class="room-enter">Enter room</span></p><p> <span class="room-name">' . ($room['caption']) . '</span></p><p> <span class="room-description">' . ($room['description']) . '</span> </p><p> <span class="room-owner">Owner: <a href="/home/' . ($room['owner']) . '">' . ($room['owner']) . '</a></span></p><p> </span></p><p> </li>';</p><p>}</p><p></p><p>?></p><p></p><p><div id="room-more-data-h124" style="display: none"></p><p><ul class="habblet-list room-more-data"></p><p></p><p><?php</p><p></p><p>$get = mysql_query("SELECT * FROM rooms WHERE roomtype = 'private' ORDER BY users_now DESC LIMIT 6,10")or die(mysql_error());</p><p></p><p>while ($room = mysql_fetch_assoc($get))</p><p>{</p><p> if ($eo == 'even')</p><p> {</p><p> $eo = 'odd';</p><p> }</p><p> else</p><p> {</p><p> $eo = 'even';</p><p> }</p><p></p><p> echo '<li class="' . $eo . '"></p><p> <span class="clearfix enter-room-link ' . GenerateRoomOccupancy($room['users_now'], $room['users_max']) . '" title="Go There" roomid="' . $room['id'] . '"></p><p> <span class="room-enter">Enter room</span> <br></p><p> <span class="room-name">' . ($room['caption']) . '</span> <br></p><p> <span class="room-description">' . ($room['description']) . '</span> </p><p> <span class="room-owner">Owner: <a href="/home/' . ($room['owner']) . '">' . ($room['owner']) . '</a></span></p><p> </span></p><p> </li>';</p><p>}</p><p></p><p>?></p><p></p><p></ul></p><p></div></p><p></p><p><div class="clearfix"></p><p><a href="#" class="room-toggle-more-data" id="room-toggle-more-data-h124">More Rooms!</a></p><p></div></p><p></p><p></div></p><p></p><p><script type="text/javascript"></p><p>L10N.put("show.more", "Show more rooms");</p><p>L10N.put("show.less", "Show less rooms");</p><p>var roomListHabblet_h124 = new RoomListHabblet("rooms-habblet-list-container-h124", "room-toggle-more-data-h124", "room-more-data-h124");</p><p></script></p><p></p><p></div></p><p></div></p><p>[/SPOILER]</p><p></p><p>I'd really appreciate if you were able to help.</p><p>Contact me on our hotel Discord here: <a href="https://discordapp.com/invite/gGpZKwz" target="_blank">https://discordapp.com/invite/gGpZKwz</a> or comment below.</p></blockquote><p></p>
[QUOTE="SBste01, post: 426087, member: 40804"] Hey, I've noticed that on a lot of retros, the Hot Rooms on the /community page has the owners username on it. When I put it into my community page, it comes up with the user's ID instead of the username. Is there a way you are able to convert it from their ID to their username? Attached below is a photo of it and the /community.php page. Photo: [SPOILER] [ATTACH=full]6716[/ATTACH] [/SPOILER] community.php [SPOILER] <?php $eo = 'even'; function GenerateRoomOccupancy($usersNow, $usersMax) { $num = 1; $percentage = intval(($usersNow / $usersMax) * 100); if ($percentage <= 0) { $num = 1; } else if ($percentage < 35) { $num = 2; } else if ($percentage < 75) { $num = 3; } else if ($percentage < 100) { $num = 4; } else if ($percentage >= 100) { $num = 5; } return 'room-occupancy-' . $num; } ?> <div class="habblet-container "> <div class="cbb clearfix settings "> <h2 class="title">Hot Rooms</h2> <style type="text/css"> .room-occupancy-1 { background-image: url('{url}/app/tpl/skins/Habbo/images/rooms/room_icon_1.gif') !important; } .room-occupancy-2 { background-image: url('{url}/app/tpl/skins/Habbo/images/rooms/room_icon_2.gif') !important; } .room-occupancy-3 { background-image: url('{url}/app/tpl/skins/Habbo/images/rooms/room_icon_3.gif') !important; } .room-occupancy-4 { background-image: url('{url}/app/tpl/skins/Habbo/images/rooms/room_icon_4.gif') !important; } .room-occupancy-5 { background-image: url('{url}/app/tpl/skins/Habbo/images/rooms/room_icon_5.gif') !important; } </style> <div id="rooms-habblet-list-container-h124" class="recommendedrooms-lite-habblet-list-container"> <ul class="habblet-list"> <?php $get = mysql_query("SELECT * FROM rooms WHERE roomtype = 'private' ORDER BY users_now DESC LIMIT 5")or die(mysql_error()); while ($room = mysql_fetch_assoc($get)) { if ($eo == 'even') { $eo = 'odd'; } else { $eo = 'even'; } echo '<li class="' . $eo . '"> <span class="clearfix enter-room-link ' . GenerateRoomOccupancy($room['users_now'], $room['users_max']) . '" title="Go There" roomid="' . $room['id'] . '"> <span class="room-enter">Enter room</span> <span class="room-name">' . ($room['caption']) . '</span> <span class="room-description">' . ($room['description']) . '</span> <span class="room-owner">Owner: <a href="/home/' . ($room['owner']) . '">' . ($room['owner']) . '</a></span> </span> </li>'; } ?> <div id="room-more-data-h124" style="display: none"> <ul class="habblet-list room-more-data"> <?php $get = mysql_query("SELECT * FROM rooms WHERE roomtype = 'private' ORDER BY users_now DESC LIMIT 6,10")or die(mysql_error()); while ($room = mysql_fetch_assoc($get)) { if ($eo == 'even') { $eo = 'odd'; } else { $eo = 'even'; } echo '<li class="' . $eo . '"> <span class="clearfix enter-room-link ' . GenerateRoomOccupancy($room['users_now'], $room['users_max']) . '" title="Go There" roomid="' . $room['id'] . '"> <span class="room-enter">Enter room</span> <br> <span class="room-name">' . ($room['caption']) . '</span> <br> <span class="room-description">' . ($room['description']) . '</span> <span class="room-owner">Owner: <a href="/home/' . ($room['owner']) . '">' . ($room['owner']) . '</a></span> </span> </li>'; } ?> </ul> </div> <div class="clearfix"> <a href="#" class="room-toggle-more-data" id="room-toggle-more-data-h124">More Rooms!</a> </div> </div> <script type="text/javascript"> L10N.put("show.more", "Show more rooms"); L10N.put("show.less", "Show less rooms"); var roomListHabblet_h124 = new RoomListHabblet("rooms-habblet-list-container-h124", "room-toggle-more-data-h124", "room-more-data-h124"); </script> </div> </div> [/SPOILER] I'd really appreciate if you were able to help. Contact me on our hotel Discord here: [URL]https://discordapp.com/invite/gGpZKwz[/URL] or comment below. [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
Server Development
Habbo Retros
Habbo Q&A
How to convert users id to username
Top