[Mini-How-PHP]Online player print php

03/25/2013 17:37 TraxWall#1
Hi.

Mini howto release php

Online player print php
PHP Code:
<?php
$select 
"SELECT id,name,last_play FROM player.player WHERE DATE_SUB(NOW(), INTERVAL 70 MINUTE) < last_play;";
$query mysql_query($select);
while(
$fetch mysql_fetch_object($query)) {
?>


<p><b><font color="green">Online Player : </font></b><?php echo $fetch->name?> </p>
Sory bad english.
03/25/2013 17:43 .Xilent#2
Just as you said it's a mini release, so it belongs to [Only registered and activated users can see links. Click Here To Register...]
03/25/2013 17:54 .Nexus'#3
Please post your php code like this:
PHP Code:
CODE 
CODE 
[Only registered and activated users can see links. Click Here To Register...]
03/25/2013 21:42 FCPorto15#4
this is not good system INTERVAL 70 MINUTE) < last_play;

i search for one ther say how mutsh online now!
03/25/2013 21:43 TraxWall#5
Fully adjustable ...
03/25/2013 23:32 Baum'#6
Kommt zu kleine Releases ;)
03/25/2013 23:41 Stαgє6#7
Not bad but this is easy to make... and is in all homepages
03/25/2013 23:49 balika01#8
wtf is this?! xD
correct way:
get this form game (channel)
PHP Code:
<?
function GetUserCount($ip$port)
{
    
$socket socket_create(AF_INETSOCK_STREAMSOL_TCP);
    
$result socket_connect($socket$ip$port);
    
    
$query "@USER_COUNT\n";
    
    
$write_res socket_write($socket$querystrlen($query));
    
$recv_res socket_recv($socket$output50560);
    
socket_close($socket);
    
    
$output substr($output17);
    
    return array(
        
"shinsoo" => intval(substr($output0, -7)),
        
"chunjo" => intval(substr($output0, -5)),
        
"jinno" => intval(substr($output0, -3)),
        
"unknown" => intval(substr($output0, -1))
    );
}
$count GetUserCount("your.server.ip"13000);
echo 
"Shinsoo: " $count["shinsoo"] . "<br>";
echo 
"Chunjo: " $count["chunjo"] . "<br>";
echo 
"Jinno: " $count["jinno"] . "<br>";
echo 
"?: " $count["unknown"] . "<br>";
echo 
"All: " . ($count["shinsoo"] + $count["chunjo"] + $count["jinno"] + $count["unknown"]) . "<br>";
?>
03/26/2013 00:18 ricky92#9
Quote:
Originally Posted by balika01 View Post
PHP Code:
    return array(
        
"shinsoo" => intval(substr($output0, -7)),
        
"chunjo" => intval(substr($output0, -5)),
        
"jinno" => intval(substr($output0, -3)),
        
"unknown" => intval(substr($output0, -1))
    ); 
Wtf is that?! What if the user count for a reign is > 9? Just use [Only registered and activated users can see links. Click Here To Register...], that's what it's made for, dude...