User count wont update on client

Jamescool12

Member
Jan 17, 2014
139
13
Hello i have a problem


2. this wont update in client its suppose to reload every 5 seconds
-NQJH6tJTlOHgrnVEJuQMA.png
 
Last edited:

Berk

berkibap#4233
Developer
Oct 17, 2015
863
190
for 1,open up database, users table,edit rable and change the default value of rank_vip.
for 2,you need to update it by javascript every x seconds
 

Queso

echo 'Web Developer';
Nov 29, 2016
232
72
#1, you shouldn't steal my code which is displayed on a hotel I used to work at. @Zachariah
ON-TOPIC: The reason why it isn't working because you more than likely do not have the correct JavaScript function which is used to refresh it.
I'll be generous and give you the actual code used.
Code:
<div id="topbar">
<div class="right">
<div id="RefreshBar">
<div id="TheStats">
<div id="ActualStats">
<div class="playerbox" style="z-index:99999999;position:fixed;left: 5px;top: -2px;width: 105px; height: 215px; background-repeat: no-repeat; background-position: right 40px center;
            <div id=" radioPlayer">
<div id="playerdiv">
<div id="refreshradio">
Welcome (back) <b><?php echo  $_SESSION['user']['username'] ?></b></br> There are {online} Gubboer(s) active!<br><strong>LATEST USER</strong><?php
$latestUser = mysql_query("SELECT username,motto,look,online FROM users ORDER BY ID DESC LIMIT 1");

while($rowing = mysql_fetch_assoc($latestUser)){
$username = $rowing['username'];
$motto = $rowing['motto'];
$look = $rowing['look'];echo '<div style="padding: 5px;">
<img src="https://avatar-retro.com/habbo-imaging/avatarimage?figure='.$look.'.&size=m&direction=2&head_direction=3&gesture=sml&headonly=1"/>
</div>
<strong>'.$username.'</strong>


';

}
?><center><a href="/rules" target="_blank">Hotel Rules</a></center></div>
</div>
</a>
</div>
</div>
</div>
</div>
</div>
Create a new file and call it 'on.php' and paste that into it then save it in your style folder.
Code:
<script>
    var refreshId = setInterval(function()
    {
         $('#refreshradio').fadeOut("slow").load('/index.php?url=on').fadeIn("slow");
    }, 10000);
    </script>
    <div id="topbar">
<div class="right">
<div id="RefreshBar">
<div id="TheStats">
<div id="ActualStats">
<div class="playerbox" style="z-index:99999999;position:fixed;left: 5px;top: -2px;width: 105px; height: 215px; background-repeat: no-repeat; background-position: right 40px center;
            <div id=" radioPlayer">
<div id="playerdiv">
<div id="refreshradio">
Welcome (back) <b><?php echo  $_SESSION['user']['username'] ?></b></br> There are {online} Gubboer(s) active!<br><strong>LATEST USER</strong><?php
$latestUser = mysql_query("SELECT username,motto,look,online FROM users ORDER BY ID DESC LIMIT 1");

while($rowing = mysql_fetch_assoc($latestUser)){
$username = $rowing['username'];
$motto = $rowing['motto'];
$look = $rowing['look'];echo '<div style="padding: 5px;">
<img src="https://avatar-retro.com/habbo-imaging/avatarimage?figure='.$look.'.&size=m&direction=2&head_direction=3&gesture=sml&headonly=1"/>
</div>
<strong>'.$username.'</strong>


';

}
?><center><a href="/rules" target="_blank">Hotel Rules</a></center></div>
</div>
</a>
</div>
</div>
</div>
</div>
</div>
Lastly, replace your client code which you more than likely got from the hotel through view source, with this.
 

Zachariah

Active Member
Aug 26, 2017
177
78
I had fixed this for him, his cms is just so garbage and whenever it reloads the disconnected page shows up on half the screen but he's still in the client :| so no idea what's even happening.
 

Mikee

Active Member
Jul 8, 2017
162
102
Decent solution. I would recommend making a websocket in the emulator and have the javascript client listen to the socket. Each time a new user loads up it sends a byte[1024] to the to the javascript client that updates the counter of users, and then the client updates its counter by 1.

This solution is fine tho.
 

Jamescool12

Member
Jan 17, 2014
139
13
#1, you shouldn't steal my code which is displayed on a hotel I used to work at. @Zachariah
ON-TOPIC: The reason why it isn't working because you more than likely do not have the correct JavaScript function which is used to refresh it.
I'll be generous and give you the actual code used.
Code:
<div id="topbar">
<div class="right">
<div id="RefreshBar">
<div id="TheStats">
<div id="ActualStats">
<div class="playerbox" style="z-index:99999999;position:fixed;left: 5px;top: -2px;width: 105px; height: 215px; background-repeat: no-repeat; background-position: right 40px center;
            <div id=" radioPlayer">
<div id="playerdiv">
<div id="refreshradio">
Welcome (back) <b><?php echo  $_SESSION['user']['username'] ?></b></br> There are {online} Gubboer(s) active!<br><strong>LATEST USER</strong><?php
$latestUser = mysql_query("SELECT username,motto,look,online FROM users ORDER BY ID DESC LIMIT 1");

while($rowing = mysql_fetch_assoc($latestUser)){
$username = $rowing['username'];
$motto = $rowing['motto'];
$look = $rowing['look'];echo '<div style="padding: 5px;">
<img src="https://avatar-retro.com/habbo-imaging/avatarimage?figure='.$look.'.&size=m&direction=2&head_direction=3&gesture=sml&headonly=1"/>
</div>
<strong>'.$username.'</strong>


';

}
?><center><a href="/rules" target="_blank">Hotel Rules</a></center></div>
</div>
</a>
</div>
</div>
</div>
</div>
</div>
Create a new file and call it 'on.php' and paste that into it then save it in your style folder.
Code:
<script>
    var refreshId = setInterval(function()
    {
         $('#refreshradio').fadeOut("slow").load('/index.php?url=on').fadeIn("slow");
    }, 10000);
    </script>
    <div id="topbar">
<div class="right">
<div id="RefreshBar">
<div id="TheStats">
<div id="ActualStats">
<div class="playerbox" style="z-index:99999999;position:fixed;left: 5px;top: -2px;width: 105px; height: 215px; background-repeat: no-repeat; background-position: right 40px center;
            <div id=" radioPlayer">
<div id="playerdiv">
<div id="refreshradio">
Welcome (back) <b><?php echo  $_SESSION['user']['username'] ?></b></br> There are {online} Gubboer(s) active!<br><strong>LATEST USER</strong><?php
$latestUser = mysql_query("SELECT username,motto,look,online FROM users ORDER BY ID DESC LIMIT 1");

while($rowing = mysql_fetch_assoc($latestUser)){
$username = $rowing['username'];
$motto = $rowing['motto'];
$look = $rowing['look'];echo '<div style="padding: 5px;">
<img src="https://avatar-retro.com/habbo-imaging/avatarimage?figure='.$look.'.&size=m&direction=2&head_direction=3&gesture=sml&headonly=1"/>
</div>
<strong>'.$username.'</strong>


';

}
?><center><a href="/rules" target="_blank">Hotel Rules</a></center></div>
</div>
</a>
</div>
</div>
</div>
</div>
</div>
Lastly, replace your client code which you more than likely got from the hotel through view source, with this.
Sorry I didn't know it was stolen I just asked for it and I got it :/ may you come on my teamviewer and help me out i got it to refresh but now it refreshs fast and it gets faster
 
and then my client freezes
 

Users who are viewing this thread

Top