Temos pavadinimas: WordPress, Shopify ir PHPFusion programuotojų bendruomenė :: Lgsl serveriai

Parašė mantoja· 2009 Sau. 5 19:01:27
#7

Nu va as sukuriau direktorija pavadinta cs.php
Stai directorijos kodas!
<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.1//EN' 'http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd'>

<html xmlns='http://www.w3.org/1999/xhtml'>
   <head>
      <title>Cs Serveriu listas - SaWas.xz.lt</title>
      <meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1' />
      <meta http-equiv='content-style-type' content='text/css' />
      <link rel="stylesheet" href="lgsl_style.css" type="text/css" />
   </head>

   <body>
      <div style='height:30px'><br /></div>

<center><img src='/images/headeriss.jpg' align='center' border='0'></center><br>

<table class='list_table' cellpadding='3'>
<center><a target=_blank href='http://www.xat.com/chat/room/47478509/'>Ideti cs serveri</a></center> <br>




<?php

 /*_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
 \_|                                                                                                      |_/
 \_|                             LIVE GAME SERVER LIST [ STAND ALONE ]                                     |_/
 \_|                                                                                                      |_/
 \_|                          © Richard Perry from http://www.greycube.com                                 |_/
 \_|                                                                                                      |_/
 \_|                         Released under the terms and conditions of the                                |_/
 \_|                      GNU General Public License Version 2 (http://gnu.org)                            |_/
 \_|                                                                                                      |_/
 \_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_*/

//-----------------------------------------------------------------------------------------------------------+


  $lgsl_cache_time       = 1;     // REFRESH DELAY IN MINS - AS GUIDE ADD 1 AFTER EVERY 30 SERVERS ON THE LIST
  $lgsl_hostname_shorten = 1;     // OPTIONS ARE 0 = DISABLED or 1 = KEEP LEFT PART or 2 = KEEP RIGHT PART
  $lgsl_hostname_length  = 40;    // NUMBER OF CHARACTERS ALLOWED BEFORE SERVER NAME GETS SHORTENED
  $lgsl_hide_offline     = 0;     // CHANGE THIS TO 1 IF YOU DONT WANT TO SHOW OFFLINE SERVERS
  $lgsl_hostname_to_ip   = 0;     // CONVERT HOSTNAMES TO IP ADDRESS TO SAVE SPACE AND FOR ASE LINK TO WORK

  $lgsl_path             = "";    // RELATIVE PATH BETWEEN THIS FILE AND THE LGSL FOLDER FOR PAGE INTEGRATION


//-----------------------------------------------------------------------------------------------------------+

  require_once($lgsl_path."lgsl_protocol.php");

  if (!is_writable($lgsl_path."lgsl_cache.dat")) { echo "THE FILE LGSL_CACHE.DAT IS NOT WRITABLE"; exit; }

//-----------------------------------------------------------------------------------------------------------+

  $lines       = file($lgsl_path."lgsl_cache.dat");
  $last_line   = count($lines) - 1;
  $last_update = intval($lines[$last_line]);
  $time_check  = time() - ($lgsl_cache_time * 60);
 
  if ($time_check < $last_update)
  {
    // echo "DEBUG: This information was CACHED <br /><br />";
 
    unset($lines[$last_line]); // REMOVE TIMESTAMP
    unset($data_cache);

    foreach ($lines as $line_number=>$line)
    {
      $data_cache[$line_number] = unserialize($line);
    }
  }
  else
  {

//-----------------------------------------------------------------------------------------------------------+

    // echo "DEBUG: This information was LIVE <br /><br />";

    ignore_user_abort(true); // FINISH WRITING CACHE EVEN IF THE BROWSER IS CLOSED

    $lines = file($lgsl_path."lgsl_servers.txt");

    $data_counter = 0;
    unset($data_cache);

    foreach ($lines as $line)
    {
      if (!trim($line)) { continue; } // SKIP BLANK LINES

      $part        = explode(":", $line);
      $server_ip   = trim($part[0]);  // TRIM REMOVES
      $server_port = trim($part[1]);  // ACCIDENTAL SPACES
      $server_type = trim($part[2]);  // AND NEWLINE CHARACTERS

      if (!$server_ip || !$server_port) { continue; } // SKIP EMPTY FIELDS
   
      $data = lgsl_query($server_ip, $server_port, $server_type, "info");

      $data[gamemod] = preg_replace("/[^A-Za-z0-9 \_\-]/", "_", strtolower($data[gamemod]));  // AND FOLDER USAGE
      $data[mapname] = preg_replace("/[^A-Za-z0-9 \_\-]/", "_", strtolower($data[mapname]));  // CONVERT FOR FILE

      $data_counter += 1;
      $data_cache[$data_counter] = $data;
    }

    $fh = fopen($lgsl_path."lgsl_cache.dat","w");

    foreach($data_cache as $line)
    {
      $line = serialize($line)."\r\n";
      fwrite($fh,$line);
    }

    fwrite($fh, time());

    fclose($fh);
   
    ignore_user_abort(false);

  }

//-----------------------------------------------------------------------------------------------------------+

  echo "<table class='list_table' cellpadding='3'>";

  $lgsl_stats_servers    = 0;
  $lgsl_stats_players    = 0;
  $lgsl_stats_maxplayers = 0;

  foreach($data_cache as $data)
  {
    if (!$data[status] && $lgsl_hide_offline) { continue; }

    if (!$data[status])
    {
      $lgsl_image_status = $lgsl_path."images/status/server_offline.gif";
      $data[status]   = "OFFLINE";
      $data[hostname] = "Unknown";
      $data[mapname]  = "unknown";
    }
    else if (!$data[password])
    {
      $lgsl_image_status = $lgsl_path."images/status/server_online.gif";
      $data[status]   = "ONLINE";
    }
    else
    {
      $lgsl_image_status = $lgsl_path."images/status/server_online_password.gif";
      $data[status]   = "ONLINE WITH PASSWORD";
    }

//-----------------------------------------------------------------------------------------------------------+

    $lgsl_image_icon = $lgsl_path."images/icons/$data[gametype]/$data[gamemod].gif";  // USE MOD ICON

    if (!file_exists($lgsl_image_icon))
    {
      $lgsl_image_icon = $lgsl_path."images/icons/$data[gametype]/$data[gametype].gif"; // USE GAME ICON

      if (!file_exists($lgsl_image_icon))
      {
        $lgsl_image_icon = $lgsl_path."images/status/unknown.gif";  // USE UKNOWN ICON
      }
    }

//-----------------------------------------------------------------------------------------------------------+

    if (strlen($data[hostname]) > $lgsl_hostname_length)
    {
      if ($lgsl_hostname_shorten == 1)
      {
        $data[hostname] = substr($data[hostname], 0, $lgsl_hostname_length - 3) . "..."; // KEEP LEFT
      }
      else if ($lgsl_hostname_shorten == 2)
      {
        $data[hostname] = "..." . substr($data[hostname], - $lgsl_hostname_length); // KEEP RIGHT
      }
    }

    $data[hostname] = htmlentities($data[hostname], ENT_QUOTES); // CONVERT SYMBOLS TO ENTITIES

//-----------------------------------------------------------------------------------------------------------+

    if ($lgsl_hostname_to_ip) { $data[ip] = gethostbyname($data[ip]); } // CONVERT HOSTNAME TO IP
   
    $lgsl_launch = lgsl_get("launch", $data[ip], $data[port], $data[gametype]); // GET SOFTWARE LAUNCH LINK

//-----------------------------------------------------------------------------------------------------------+

    $lgsl_stats_servers++;                       // COUNT VISIBLE NUMBER OF SERVERS
    $lgsl_stats_players += $data[players];       // COUNT VISIBLE NUMBER OF PLAYERS
    $lgsl_stats_maxplayers += $data[maxplayers]; // COUNT VISIBLE NUMBER OF SLOTS

//-----------------------------------------------------------------------------------------------------------+

    echo "

      <tr>
      <td class='list_row'><img src='$lgsl_image_status' alt='' title='$data[status]' /></td>
      <td class='list_row'><img src='$lgsl_image_icon'   alt='' title='$data[gametype] - $data[gamemod]' /></td>
      <td class='list_row'><a style='text-decoration:none' href='$lgsl_launch' title='CLICK TO LAUNCH SOFTWARE'>$data[ip]:$data[port]</a></td>
      <td class='list_row'><a style='text-decoration:none' href='lgsl_settings.php?ip=$data[ip]&amp;port=$data[port]' title='CLICK TO VIEW SERVER SETTINGS'>$data[hostname]</a></td>
      <td class='list_row'>$data[mapname]</td>
      <td class='list_row' style='text-align:center'><a style='text-decoration:none' href='lgsl_players.php?ip=$data[ip]&amp;port=$data[port]' title='CLICK TO VIEW PLAYER INFO'>$data[players]/$data[maxplayers]</a></td>
      </tr>

    ";

//-----------------------------------------------------------------------------------------------------------+

  }
echo "<font color='black'></table>
<div style='height:30px'><br /></div>

<div style='text-align:center'>$lgsl_stats_servers Serveriu - $lgsl_stats_players Dabar zaidzia - $lgsl_stats_maxplayers Daugiausiai gali zaisti</div>

<div style='height:30px'><br /></div></font>";
echo "</table>


<br>

<center><a href='http://www.hey.lt/details.php?id=mantoja' target='_blank'><img width=88 height=31 border=0 src='//www.hey.lt/count.php?id=mantoja' alt='Hey.lt - Nemokamas lankytoju skaitliukas'></a></center>

<br>

<font color='black'><center>Sukurta © 2008-2009</center></font>

</div>"

?>




</body>
     </html>

<script type="text/javascript" src="http://www.sawas.xz.lt/reklama.js"></script>


Jame rodo cs o kaip padaryti kad jame rodystu ne cs 1.6 o pwz cs source?? :?:?:?:?

Redagavo mantoja· 2009 Sau. 5 20:01:35