Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

Dynamic Online users count PHP code?

Initiate Mage
Joined
Feb 9, 2013
Messages
9
Reaction score
2
I think we would need a little more information on what you are looking for. What kind of server are you running? And what CMS are you using?
 
Upvote 0
Initiate Mage
Joined
Feb 9, 2013
Messages
9
Reaction score
2
It wouldn't matter "Dynamic users online count"

Auto updates without refreshing page.
PHP alone wouldn't do this. And yes it does matter what kind of server you are running. Are you running an oldskool server, like debbo? or are you running a server that requires an emulator and uses .swfs and MySQL? If you are running a server that uses MySQL, then you can use Javascript to loop through and refresh the online count. But that would be a big load on the webhost.
 
Upvote 0
Initiate Mage
Joined
Jun 8, 2012
Messages
34
Reaction score
3
PHP alone wouldn't do this. And yes it does matter what kind of server you are running. Are you running an oldskool server, like debbo? or are you running a server that requires an emulator and uses .swfs and MySQL? If you are running a server that uses MySQL, then you can use Javascript to loop through and refresh the online count. But that would be a big load on the webhost.

Wrong php could do this if I remember.
 
Upvote 0
Initiate Mage
Joined
Feb 9, 2013
Messages
9
Reaction score
2
Wrong php could do this if I remember.
?? Not wrong. I develop websites for money. I am pretty advanced with PHP. PHP has never been able to update text on a website without a page reload. I would use jQuery (Javascript Library) to send an AJAX call to a PHP update script, and set the online count to that value via jQuery.
 
Upvote 0
Initiate Mage
Joined
Jun 8, 2012
Messages
34
Reaction score
3
?? Not wrong. I develop websites for money. I am pretty advanced with PHP. PHP has never been able to update text on a website without a page reload. I would use jQuery (Javascript Library) to send an AJAX call to a PHP update script, and set the online count to that value via jQuery.

Hmmmm alright.
 
Upvote 0
Joined
Jan 23, 2011
Messages
446
Reaction score
99
I coded this just for you :)
Like me if it works,
if not, ill re-code it


$onlineurl = file_get_contents('ONLINE LINK HERE'); // T.EX blablabla.com/online.php? lol$result = mysql_query("SELECT * FROM server_status");$online = "Users Online!";$row = mysql_fetch_array( $result ); $image = imagecreatefrompng('images/banner.png'); $font_color = imagecolorallocate($image, 255, 0, 0); imagefttext($image, 20, 0, 417, 30, $font_color, './arial.ttf', $row['users_online']); imagefttext($image, 8, 0, 398, 45, $font_color, './arial.ttf', $online); imagefttext($image, 20, 0, 394, 77, $font_color, './arial.ttf', $num_rows); header('Content-type: image/png'); imagepng($image); imagedestroy($image);
 
Upvote 0
Initiate Mage
Joined
Feb 9, 2013
Messages
9
Reaction score
2
That is all PHP, there is no way that is going to by dynamic and update every time someone logs into the hotel.
 
Upvote 0
Initiate Mage
Joined
Jun 8, 2012
Messages
34
Reaction score
3
I coded this just for you :)
Like me if it works,
if not, ill re-code it


$onlineurl = file_get_contents('ONLINE LINK HERE'); // T.EX blablabla.com/online.php? lol$result = mysql_query("SELECT * FROM server_status");$online = "Users Online!";$row = mysql_fetch_array( $result ); $image = imagecreatefrompng('images/banner.png'); $font_color = imagecolorallocate($image, 255, 0, 0); imagefttext($image, 20, 0, 417, 30, $font_color, './arial.ttf', $row['users_online']); imagefttext($image, 8, 0, 398, 45, $font_color, './arial.ttf', $online); imagefttext($image, 20, 0, 394, 77, $font_color, './arial.ttf', $num_rows); header('Content-type: image/png'); imagepng($image); imagedestroy($image);

That is PHP & you didnt code that you took that from a thread on here, that's a dynamic users online banner.
 
Upvote 0
Back
Top