record online php script

Results 1 to 4 of 4
  1. #1
    Account Upgraded | Title Enabled! medotarek is offline
    MemberRank
    Apr 2012 Join Date
    Egypt/RageZoneLocation
    615Posts

    record online php script

    hello , the title is saying everything (please i need record online php script)


  2. #2
    Novice Jose Barrios is offline
    MemberRank
    Nov 2013 Join Date
    1Posts

    Re: record online php script

    code:

    index.php -> <?=$_SESSION['ONLINE']?>

    Crea un archivo php llamado "Online" y pon:

    <?php
    $text = "<font size='-1' color='#555555'>";


    $hora = time();
    $fin = $hora-600;
    if(empty($_SESSION['AID']))
    {
    $ip = clean($_SERVER['REMOTE_ADDR']);
    $q = mssql_query("SELECT * From Online WHERE IP='".$ip."'");
    }else{
    $user = clean($_SESSION['USERID']);
    $q = mssql_query("SELECT * From Online WHERE UserID='".$user."'");
    }




    if(!mssql_num_rows($q))
    {
    if(!empty($user))
    {
    mssql_query("INSERT INTO Online (UserID, IP, Time) VALUES ('".$user."', '', '".$hora."')");
    }else{
    mssql_query("INSERT INTO Online (UserID, IP, Time) VALUES ('', '$ip', '$hora')");
    }
    }else{
    if(!empty($user))
    {
    mssql_query("UPDATE Online SET Time='".$hora."' WHERE UserID='".$user."'");
    }else{
    mssql_query("UPDATE Online SET Time='".$hora."' WHERE IP='".$ip."'");
    }
    }


    mssql_query("DELETE From Online WHERE Time < ".$fin);
    $countU = mssql_num_rows(mssql_query("SELECT * FROM Online WHERE IP = ''"));
    $countI = mssql_num_rows(mssql_query("SELECT * FROM Online WHERE UserID = ''"));
    $count0 = mssql_num_rows(mssql_query("SELECT * FROM Online"));


    $text = $text."<br>Quien esta en linea: ".$count0." ( ".$countU." Usuarios activo(s) ".$countI." estan invitado)<br><br>";


    $q = mssql_query("SELECT TOP 18 * From Online WHERE UserID != '' Order by ID DESC");
    if(mssql_num_rows($q))
    {
    $i = 1;
    while($r = mssql_fetch_object($q))
    {

    $text = $text."".checarname("",$r->UserID).",";

    if($i == 13)
    {
    $text = $text."<br>";
    $i = 0;
    }
    $i++;
    }
    }

    $text = $text."<br /> <br />
    <font color='#FF0000'>ADM</font> | <font color='#00FF00'>GM</font> | <font color='00FFFF'>User Donator</font> | <font color='#000000'>User</font> | <font color='#666666'>Banned</font><br />
    </font>";
    $_SESSION['ONLINE'] = $text;
    ?>

    Demo: http://gunz.astralgamers.net/

  3. #3
    Pee Aitch Pee Dave is offline
    MemberRank
    Mar 2011 Join Date
    The NetherlandsLocation
    722Posts

    Re: record online php script

    PHP Code:
    SELECT TOP(1PlayerCountTime FROM ServerLog ORDER BY PlayerCount DESC 

  4. #4
    Account Upgraded | Title Enabled! medotarek is offline
    MemberRank
    Apr 2012 Join Date
    Egypt/RageZoneLocation
    615Posts

    Re: record online php script

    Quote Originally Posted by Dave View Post
    PHP Code:
    SELECT TOP(1PlayerCountTime FROM ServerLog ORDER BY PlayerCount DESC 
    thanks dave you are the best!



Advertisement