Jump to content

Recommended Posts

Posted (edited)

 // chat.php

echo "<div id='content'><h2>LOg CHAT</h2>";





        $DATA_FILE = @file_get_contents('ftps://user:pass@servername.com/home/server/gameserver/log/chat.log'); //change to your server
        $nuskk = file($DATA_FILE);
        $nuskk = @file($DATA_FILE);
        $viso_tm = count($DATA_FILE);

$convert = explode("\n", $DATA_FILE); //create array separate by new line

        $viso_tm = count($convert); //total msg
echo"$viso_tm<br/>";
        $puslapiu_skaicius = 50; // total pages

        if ($viso_tm == 0)
        {
            echo " <p align=\"center\"><small>
        Tema tuscia...<br/></small></p>";
        } else
        {
            $page=$_GET['page'];
            
            if ($page == "")
            {
                $page = 1;
            }
            $next = $page + 1;
            $back = $page - 1;
            if ($page == 1)
            {
                $nuo = 0;
                $iki = $puslapiu_skaicius;
            } else
            {
                $nuo = $page * $puslapiu_skaicius - $puslapiu_skaicius;
                $iki = $page * $puslapiu_skaicius;
            }

            if ($viso_tm <= $page * $puslapiu_skaicius)
            {
                $iki = $viso_tm;
            }
            $masyvo_apvertimas = array_reverse($convert);
            for ($c = $nuo; $c < $iki; $c++)
            {


///////

    echo $masyvo_apvertimas[$c]."<br/>";
               echo "<br/>";
            }

            $viso_puslapiu = $viso_tm / $puslapiu_skaicius;

            $viso_puslapiai = 0;
            $starto_skaicius = 1;
            while ($viso_puslapiai < $viso_puslapiu)
            {
                if ($page == $starto_skaicius)
                {
                    echo "[$starto_skaicius]";
                } else
                {

                    echo "<a href=\"index.php?id=chat&page=$starto_skaicius\">($starto_skaicius)</a>";
                }
                $viso_puslapiai++;
                $starto_skaicius++;

            }
        }


        echo "<br/><br/></small>
<a href=\"index.php?id=\">HOME</a></div>";

 

// all credits to dievas

Edited by dievas

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...