Temos pavadinimas: WordPress, Shopify ir PHPFusion programuotojų bendruomenė :: Eilutei Tik 6 Skaitmenis.

Parašė essens· 2010 Sau. 28 09:01:51
#1

Kaip Padaryti Kad Serverio Pavadinime Eilutei Rodytu 6 Skaitmenis?

<?php
/*---------------------------------------------------+
| PHP-Fusion 6 Content Management System
+----------------------------------------------------+
| Copyright © 2002 - 2005 Nick Jones
| http://www.php-fusion.co.uk/
+----------------------------------------------------+
| Released under the terms & conditions of v2 of the
| GNU General Public License. For details refer to
| the included gpl.txt file or visit http://gnu.org
+----------------------------------------------------*/
require_once "../../maincore.php";
require_once BASEDIR."subheader.php";
require_once BASEDIR."side_left.php";

// Check if locale file is available matching the current site locale setting.
if (file_exists(INFUSIONS."cssl/locale/".$settings['locale'].".php")) {
   // Load the locale file matching the current site locale setting.
   include INFUSIONS."cssl/locale/".$settings['locale'].".php";
} else {
   // Load the infusion's default locale file.
   include INFUSIONS."cssl/locale/English.php";
}

include("csslmore/counterstrike.php");

if($_GET['server']) {
  $get_data = mysql_query(" SELECT * FROM ".$db_prefix."cssl WHERE id = '".$_GET['server']."' ORDER BY id ASC") or die($locale['cssl113'].": ".mysql_error());
  $row = @mysql_fetch_array($get_data);

    echo "<script language='JavaScript'>
    <!--
    function swap_content(divs) {
    displayType=(document.getElementById(divs).style.display=='none') ? 'block':'none';
    document.getElementById(divs).style.display=displayType;
    }
    //-->
    </script>";
      
        $serverip = $row['ip'];
      $serverport = $row['port'];
        $csinfo=new CounterStrike;
        $status=$csinfo->getServerInfo($serverip,$serverport,1000);
        
     //HL2
    if($csinfo->m_servervars["gamename"] == "&#240;") {
      $servers["servername"] = htmlentities($csinfo->m_servervars["serveraddress"]);
      $servers["gamename"] = $csinfo->m_servervars["game"];
      $servers["game"] = $csinfo->m_servervars["mapname"];
      $servers["mapname"] = $csinfo->m_servervars["servername"];
      $servers["currentplayers"] = $csinfo->m_servervars["currentplayers"];
      $servers["maxplayers"] = $csinfo->m_servervars["maxplayers"];
      $servers["type"] = "HL2";
    }
    //HL1
    else {
      $servers["servername"] = htmlentities($csinfo->m_servervars["servername"]);
      $servers["gamename"] = $csinfo->m_servervars["gamename"];
      $servers["game"] = $csinfo->m_servervars["game"];
      $servers["mapname"] = $csinfo->m_servervars["mapname"];
      $servers["currentplayers"] = $csinfo->m_servervars["currentplayers"];
      $servers["maxplayers"] = $csinfo->m_servervars["maxplayers"];
      $servers["type"] = "HL1";
    }

      if(!is_array($csinfo->m_servervars)) {
         for($i = 0; $i <= count($servers); $i++) {
            if($servers[$i] == $_GET['ip']) {
               echo"
                  <div>Server #".($i + 1)."</div>
               ";
            }
         }
      }
    else
    {
         opentable($servers["servername"]);
      }
      echo"
    ".$locale['cssl114']."
    <table border=0 width='100%'>
      <tr>
        <td valign=\"top\" width='30%'>".$locale['cssl115'].":</td>
        <td valign=\"top\">".joinip($serverip, $serverport, $servers["game"], $servers["type"])."</td>
        <td width=\"160\" height=\"120\" colspan=\"2\" rowspan=\"4\">".getMapImage($servers["game"]."/".$servers["mapname"])."</td>
      </tr>
      ";
      if(is_array($csinfo->m_servervars)) {
        echo"
        <tr>
          <td valign=\"top\">".$locale['cssl116'].":</td>
          <td valign=\"top\">".$servers["currentplayers"]." / ".$servers["maxplayers"]."</td>
        </tr>
        <tr>
          <td valign=\"top\">".$locale['cssl117'].":</td>
          <td valign=\"top\">".$servers["mapname"]."</td>
        </tr>

        ";
      }
      echo"
    </table>
    <br />
    <a href=\"#\" onclick=\"swap_content('players'); return false;\">".$locale['cssl118']."</a>
    <div id=\"players\" style=\"display: none\">
    <table width='100%'>
      ";
      if(is_array($csinfo->m_playerinfo)) {
        while(list(,$player) = each ($csinfo->m_playerinfo)) {
          echo"
          <tr>
            <td width='300'>".$player['name']."</td>
            <td width='50' align='right'>".$player['frags']."</td>
            <td align='right'>".str_replace(" ", "0", $player['time'])."</td>
          </tr>
          ";
        }
      }
      else
      {
      echo"
        <tr>
          <td align='center'>".$locale['cssl119']."</td>
        </tr>
        ";
      }
      echo"
    </table>
    </div>
    ";
     
    echo '<br /><p align="center"><a href="?servers">'.$locale['cssl107'].'</a></p>';
    closetable();
   />";
}
else {
  $get_data = mysql_query(" SELECT * FROM ".$db_prefix."cssl ORDER BY sort ASC") or die("Der er sket en fejl: ".mysql_error());
 
  opentable($locale['cssl100']);
  echo '
  <table width="100%">
    <tr>
      <td>
       <b>'.$locale['cssl120'].'</b>
      </td>
      <td>
      <b>'.$locale['cssl115'].'</b>
      </td>
      <td>
      <td>
      <b>'.$locale['cssl117'].'</b>
      </td>
      <td>
      <td>
      <b>'.$locale['cssl116'].'</b>
      </td>
    </tr>
  ';
  while($row = @mysql_fetch_array($get_data)) {
 
    $serverip = $row['ip'];
    $serverport = $row['port'];
    $csinfo=new CounterStrike;
    $status=$csinfo->getServerInfo($serverip,$serverport,1000);
   
     //HL2
    if($csinfo->m_servervars["gamename"] == "&#240;") {
      $server["servername"] = htmlentities($csinfo->m_servervars["serveraddress"]);
      $server["game"] = $csinfo->m_servervars["mapname"];
      $server["mapname"] = $csinfo->m_servervars["servername"];
      $server["currentplayers"] = $csinfo->m_servervars["currentplayers"];
      $server["maxplayers"] = $csinfo->m_servervars["maxplayers"];
      $server["type"] = "HL2";
    }
    //HL1
    else {
      $server["servername"] = htmlentities($csinfo->m_servervars["servername"]);
      $server["game"] = $csinfo->m_servervars["game"];
      $server["mapname"] = $csinfo->m_servervars["mapname"];
      $server["currentplayers"] = $csinfo->m_servervars["currentplayers"];
      $server["maxplayers"] = $csinfo->m_servervars["maxplayers"];
      $server["type"] = "HL1";
    }
 
    if(is_array($csinfo->m_servervars)) {
      echo '
      <tr>
        <td>
        <a href="?page=servers&server='.$row['id'].'">'. $server["servername"] . '</a>
        </td>
       <td>
        '.joinip($serverip, $serverport, $server["game"], $server["type"]).'
       </td>
       <td>
       <td>
        '. $server["mapname"] . '
        </td>
        <td>
        '. $server["gamename"] . '
        </td>
        <td>
        '. $server["currentplayers"] . '/' . $server["maxplayers"] . '
        </td>
      </tr>
      ';
   
    }
    else {
    echo " <tr>
      <td>";
        echo "[<i>".$locale['cssl123']."</i>]";
      echo "</td>
      <td colspan=\"3\">
        ".$serverip.":".$serverport."
      </td>
    </tr>";
    }
  }
  echo "</table>";
  closetable();
}

require_once BASEDIR."side_right.php";
require_once BASEDIR."footer.php";
?>



Redagavo essens· 2010 Sau. 28 09:01:45

Parašė fLap· 2010 Sau. 28 09:01:32
#2

Paaišink kas čia per failas nes nieko apsoliučiai nekertu. BEJE.
Copyright 2010 &copy; EsSeN
Nuiimk. :)

Parašė essens· 2010 Sau. 28 09:01:09
#3

fLap parašė:
Paaišink kas čia per failas nes nieko apsoliučiai nekertu. BEJE.
Copyright 2010 &copy; EsSeN
Nuiimk. :)


čia serverio lentele, pridedi serveri ir rodo liste... mapa, kiek playeriu,pavadinima serverio... o vat pasmane labai ilgas serverio pavadinimas ir uzsitese labai ilgai, tai man reikia kad po 6 skaitmenu i kita eilute eitu

Parašė tevas· 2010 Sau. 28 17:01:51
#4

Geriau pasidaryk pagal ilgi ir ploti. Tada skaitmenys tiepatys bus tiesiog į kitą eilute nusikels.