moufle 83
| Posté : 27-11-2008 18:44
s'est un dossier avec plusieurs fichier php je te met le fichier qui dit qu'il y a une erreur
<?php
/*
Copyright (C) 2004 Niklas Håkansson <niklas.hk@telia.com>
Mod by Timo Meyer-Franke <www.forum.meyer-franke.de.vu>
This script is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public.
If you want to change the HTML layout then only alter in functions
getTSInfo() and setTSUsers(). No other functions need to altered.
*/
!include! "common.php";
/*****************************************************
* Telnet Connection
*****************************************************/
function TSConn($ip,$port,$tPort)
{
$result = "";
$err = array();
if(strlen($ip)>4 and strlen($tPort)>2 and strlen($port)>2) {
$fp = fsockopen($ip , $tPort, $errno, $errstr, 30);
if($fp) {
fputs ($fp, "sel ".$port."\n");
fputs ($fp, "si\n");
fputs ($fp, "quit\n");
while (!feof($fp)) {
  ; $out .= fgets($fp, 1024);
}
$out& nbsp; = str_replace("[TS]", "", $out);
$out& nbsp; = str_replace("\n", "", $out);
$data = explode("\t", $out);
$err& nbsp; = explode(",", $data[0]);
}
}
if(strlen($err[0])>6) $result = "true";
return $result;
}
/*****************************************************
* User information
*****************************************************/
function getTSChannelUsers($ip,$port,$tPort)
{
$uArray = array();
$innerArray = array();
$out = "";
$j &nb sp; = 0;
$k &nb sp; = 0;
$fp = fsockopen($ip, $tPort, $err no, $errstr, 30);
if($fp) {
fputs($fp, "pl ".$port."\n");
fputs($fp, "quit\n");
while(!feof($fp)) {
$out& nbsp;.= fgets($fp, 1024);
}
$out = str_replace("[TS]", "", $out);
$out = str_replace("loginname", "loginname\t", $out);
$data = explode("\t", $out);
$num & nbsp;= count($data);
for($i=0;$i<count($data);$ i++) {
$inne rArray[$j] = $data[$i];
if($j >=15)
{
  ; $uArray[$k]=$innerArray;
  ; $j = 0;
  ; $k = $k+1;
} else {
  ; $j++;
}
}
fclose($fp);
}
return $uArray;
}
/*****************************************************
* Get all channels
*****************************************************/
function getChannels($ip,$port,$tPort)
{
$cArray = array();
$out = "";
$j &nb sp; = 0;
$k &nb sp; = 0;
$fp = fsockopen($ip, $tPort, $err no, $errstr, 30);
if($fp) {
fputs($fp, "cl ".$port."\n");
fputs($fp, "quit\n");
while(!feof($fp)) {
$out& nbsp;.= fgets($fp, 1024);
}
$out = str_replace("[TS]", "", $out);
$out = str_replace("\n", "\t", $out);
$data = explode("\t", $out);
$num & nbsp;= count($data);
for($i=0;$i<count($data);$ i++) {
if($i >=10) {
  ; $innerArray[$j] = $data[$i];
  ; if($j>=8)
  ; {
  ; $cArray[$k]=$innerArray;
  ; $j = 0;
  ; $k = $k+1;
  ; } else {
  ; $j++;
  ; }
}
}
fclose($fp);
}
return $cArray;
}
/*****************************************************
* Set used ID:s
*****************************************************/
function usedID($usedArray,$id)
{
$ok = true;
for($i=0;$i<count($usedArray);$i++)
{
if($usedArray[$i]==$id) {
$ok&n bsp;= false;
}
}
return $ok;
}
/*****************************************************
* Get channel name
*****************************************************/
function getChannelName($id,$ip,$port,$tPort)
{
$name = "Uknown";
$cArray = getChannels($ip,$port,$tPort);
for($i=0;$i<count($cArray);$i++)
{
$innerArray=$cArray[$i];
if($innerArray[0]==$id)
$name = removeChar($innerArray[5]);
}
return $name;
}
/*****************************************************
* Channel sorting by name
*****************************************************/
function newSort($cArray)
{
$tmpArray = array();
$newArray = array();
for($i=0;$i<count($cArray);$i++)
{
$innerArray = $cArr ay[$i];
$tmpArray[count($tmpArray)] = $innerArray[5];
}
sort($tmpArray);
for($i=0;$i<count($tmpArray);$i++)
{
for($j=0;$j<count($cArray) ;$j++)
{
$inne rArray = $cArray[$j];
if($t mpArray[$i] == $innerArray[5])
{
  ; $thisArray[0] = $innerArray[0];
  ; $thisArray[1] = $innerArray[5];
  ; $thisArray[2] = $innerArray[2];
  ; $thisArray[3] = $innerArray[3];
  ; $newArray[count($newArray)] = $thisArray;
}
}
}
return $newArray;
}
/*****************************************************
* Channel and user info
*****************************************************/
function getTSChannelInfo($ip,$port,$tPort)
{
$uArray = getTSChan nelUsers($ip,$port,$tPort);
$pcArray = array();
$ccArray = array();
$thisArray = array();
$listArray = array();
$usedArray = array();
$cArray &nbs p;= getChannels($ip,$port,$tPort);
$z &nb sp; = 0;
$x &nb sp; = 0;
for($i=0;$i<count($cArray);$i++)
{
$innerArray=$cArray[$i];
$listArray[$i]=$innerArray[3];
}
sort($listArray);
$cArray = newSort($cArray);
for($i=0;$i<count($listArray);$i++)
{
for($j=0;$j<count($cArray) ;$j++)
{
$innA rray=$cArray[$j];
if($i nnArray[3]==$listArray[$i] and usedID($usedArray,$innArray[0]))
{
  ; if($innArray[2]==-1)
  ; {
  ; $thisArray[0] = $innArray[0];
  ; $thisArray[1] = $innArray[1];
  ; $thisArray[2] = $innArray[2];
  ; $pcArray[$z] = $thisArray;
  ; $usedArray[count($usedArray)] = $innArray[0];
  ; $z++;
  ; }
  ; else
  ; {
  ; $thisArray[0] = $innArray[0];
  ; $thisArray[1] = $innArray[1];
  ; $thisArray[2] = $innArray[2];
  ; $ccArray[$x] = $thisArray;
  ; $usedArray[count($usedArray)] = $innArray[0];
  ; $x++;
  ; }
}
}
}
for($i=0;$i<count($pcArray);$i++) {
$innerArray=$pcArray[$i];
echo "<tr>\n";
echo " <td><img src=\"tsicons/channel.gif\" width=\"14\" height=\"15\" border=\"0\"></td>\n";
echo " <td class=\"bread\"><a href=\"!javascript!:LoginFenster('login.php?cName=".removeChar($innerArray[1])."')\" class=\"wrapCell\" !onclick!=\"vMenu(this,1,1)\" !onblur!=\"vMenu(this,0,1)\" !onmouse!over=\"!javascript!:window.status=''; return true;\"> ".removeChar($innerArray[1])."<font> ".getFlags($innerArray[0],$ip,$port,$tPort)."</font></a></td>\n";
echo "</tr>\n";
for($j=0;$j<count($ccArray);$j++) {
$innerCCArray=$ccArray [$j];
if($innerArray[0]==$innerCCArray[2]) {
echo "<tr>\n";
echo " <td></td>\n";
echo " <td class=\"bread\">\n";
echo " <table cellpadding=\"1\" cellspacing=\"0\">\n";
echo " <tr>\n";
echo " <td><i mg src=\"tsicons/channel.gif\" width=\"14\" height=\"15\" border=\"0\"></td>\n";
echo " <td cla ss=\"bread\"><a href=\"!javascript!:LoginFenster('login.php?cName=".removeChar($innerCCArray[1])."')\" class=\"wrapCell\" !onclick!=\"vMenu(this,1,1)\" !onblur!=\"vMenu(this,0,1)\" !onmouse!over=\"!javascript!:window.status=''; return true;\"><font> ".removeChar($innerCCArray[1])." </font></a></td>\n";
echo " </tr>\n";
for($p=1;$p<count($uArray) ;$p++) {
$inne rUArray=$uArray[$p];
if($i nnerCCArray[0]==$innerUArray[1])
{
  ; echo " <tr>\n";
  ; echo " <td></ td>\n";
  ; echo " <td>\n";
  ; echo " <table cellpadding=\"1\" cellspacing=\"0\">\n";
  ; echo " <tr>\n";
  ; echo " &nb sp; <td>".setUserStatus($innerUArray[12])."</td>\n";
  ; echo " &nb sp; <td class=\"bread\"> ".removeChar($innerUArray[14])."<font> (".setPPriv($innerUArray[11])."".setCPriv($innerUArray[10]).") </font></td>\n";
  ; echo " </tr>\n";
  ; echo " </table>< /font>\n";
  ; echo " </td>\n";
  ; echo " </tr>\n";
}
}
echo " </table>\n";
echo "</tr>\n";
}
}
for($k=1;$k<count($uArray);$k++) {
$innerUArray=$uArray[$k];
if($innerArray[0]==$innerUArray[1]) {
echo "<tr>\n";
echo " <td></td>\n";
echo " <td class=\"bread\">\n";
echo " <table cellpadding=\"1\" cellspacing=\"0\">\n";
echo " <tr>\n";
echo " <td>".setUserStatus($innerUArray[12])."</td>\n";
echo " <td cla ss=\"bread\"> ".removeChar($innerUArray[14])."</b><font> (".setPPriv($innerUArray[11])."".setCPriv($innerUArray[10]).") </font></td>\n";
echo " </tr>\n";
echo " </table>\n";
echo "</tr>\n";
}
}
}
}
/*****************************************************
* Channel flags
*****************************************************/
function getFlags($cid,$ip,$port,$tPort)
{
$out = "";
$flag = "U";
$cArray = array();
$j = 0;
$k = 0;
$fp = fsockopen($ip, $tPort, $err no, $errstr, 30);
if($fp) {
fputs($fp, "cl ".$port."\n");
fputs($fp, "si\n");
fputs($fp, "quit\n");
while(!feof($fp)) {
$out& nbsp;.= fgets($fp, 1024);
}
fclose($fp);
$out = str_replace("[TS]", "", $out);
$out = str_replace("\n", "\t", $out);
$data = explode("\t", $out);
$num & nbsp;= count($data);
for($i=0;$i<count($data);$ i++) {
if($i >=10) {
  ; $innerArray[$j] = $data[$i];
  ; if($j>=8)
  ; {
  ; $cArray[$k]=$innerArray;
  ; $j = 0;
  ; $k = $k+1;
  ; } else {
  ; $j++;
  ; }
}
}
for($i=0;$i<count($cArray) ;$i++) {
$innA rray = $cArray[$i];
if($c id==$innArray[0])
{
  ; $cid = setChannelFlags($innArray[6]);
}
}
}
return $cid;
}
/*****************************************************
* Channel default info
*****************************************************/
function defaultInfo($ip,$tPort,$port)
{
$out = "";
$html = "";
$fp = fsockopen($ip, $tPort, $err no, $errstr, 30);
if($fp) {
fputs($fp, "sel ".$port."\n");
fputs($fp, "si\n");
fputs($fp, "quit\n");
while(!feof($fp)) {
$out& nbsp;.= fgets($fp, 1024);
}
$out & nbsp; = str_replace("[TS]", "", $out);
$out & nbsp; = str_replace("OK", "", $out);
$out & nbsp;= trim($out);
$name=substr($out,indexOf($ou t,"server_name="),strlen($out));
$name=substr($name,0,indexOf( $name,"server_platform=")-strlen("server_platform="));
$os=substr($out,indexOf($out, "server_platform="),strlen($out));
$os=substr($os,0,indexOf($os, "server_welcomemessage=")-strlen("server_welcomemessage="));
$tsType=substr($out,indexOf($ out,"server_clan_server="),strlen($out));
$tsType=substr($tsType,0,inde xOf($tsType,"server_udpport=")-strlen("
|