modified by CodeKing for DZCP 11-29-2006 (mm-dd-yyyy) */ function setUserStatus($img) { global $g_options; switch ($img) { case '1' : $img = ''; break; case '3' : $img = ''; break; case '5' : $img = ''; break; case '7' : $img = ''; break; case '8' : $img = ''; break; case '9' : $img = ''; break; case '10' : $img = ''; break; case '11' : $img = ''; break; case '12' : $img = ''; break; case '13' : $img = ''; break; case '14' : $img = ''; break; case '15' : $img = ''; break; case '16' : $img = ''; break; case '17' : $img = ''; break; case '18' : $img = ''; break; case '19' : $img = ''; break; case '20' : $img = ''; break; case '21' : $img = ''; break; case '22' : $img = ''; break; case '23' : $img = ''; break; case '24' : $img = ''; break; case '25' : $img = ''; break; case '26' : $img = ''; break; case '27' : $img = ''; break; case '28' : $img = ''; break; case '29' : $img = ''; break; case '30' : $img = ''; break; case '31' : $img = ''; break; case '32' : $img = ''; break; case '33' : $img = ''; break; case '34' : $img = ''; break; case '35' : $img = ''; break; case '36' : $img = ''; break; case '37' : $img = ''; break; case '38' : $img = ''; break; case '39' : $img = ''; break; case '40' : $img = ''; break; case '41' : $img = ''; break; case '42' : $img = ''; break; case '43' : $img = ''; break; case '44' : $img = ''; break; case '45' : $img = ''; break; case '46' : $img = ''; break; case '47' : $img = ''; break; case '48' : $img = ''; break; case '49' : $img = ''; break; case '50' : $img = ''; break; case '51' : $img = ''; break; case '52' : $img = ''; break; case '53' : $img = ''; break; case '54' : $img = ''; break; case '55' : $img = ''; break; case '56' : $img = ''; break; case '57' : $img = ''; break; case '58' : $img = ''; break; case '59' : $img = ''; break; case '60' : $img = ''; break; case '61' : $img = ''; break; default : $img = ''; break; } return $img; } function setCPriv($str) { switch ($str) { case '1' : //Channel Admin $str = ' CA'; break; case '2' : //Channel Ops $str = ' O'; break; case '3' : //Channel Admin & Ops $str = ' CA O'; break; case '4' : //Voice $str = ' V'; break; case '5' : //Channel Admin & Voice $str = ' CA V'; break; case '6' : //Ops & Voice $str = ' O V'; break; case '7' : //Channel Admin & Ops & Voiced $str = ' CA O V'; break; case '8' : //Auto Ops $str = ' AO'; break; case '9' : //Channel Admin & Auto Ops $str = ' CA AO'; break; case '10' : //Channel Admin & Auto Ops $str = ' AO O'; break; case '11' : //Channel Admin & Auto Ops & Ops $str = ' CA AO O'; break; case '12' : //Auto Ops & Voiced $str = ' AO V'; break; case '13' : //Channel Admin & Auto Ops & Voiced $str = ' CA AO V'; break; case '14' : //Auto Ops & Ops & Voiced $str = ' AO O V'; break; case '15' : //Channel Admin & Auto Ops & Ops & Voiced $str = ' CA AO O V'; break; case '16' : //Auto Voice $str = ' AV'; break; case '17' : //Channel Admin & Auto Voice $str = ' CA AV'; break; case '18' : //Auto Voice & Ops $str = ' AV O'; break; case '19' : //Channel Admin & Auto Voice & Ops $str = ' CA AV O'; break; case '20' : //Auto Voice & Voice $str = ' AV V'; break; case '21' : //Channel Admin & Auto Voice & Voice $str = ' CA AV V'; break; case '22' : //Auto Voice & Ops & Voice $str = ' AV O V'; break; case '23' : //Channel Admin & Auto Voice & Ops & Voice $str = ' CA AV O V'; break; case '24' : //Auto Ops & Auto Voice $str = ' AO AV'; break; case '25' : //Channel Admin & Auto Ops & Auto Voice $str = ' CA AO AV'; break; case '26' : //Auto Ops & Auto Voice & Ops $str = ' AO AV O'; break; case '27' : //Channel Admin & Auto Ops & Auto Voice & Ops $str = ' CA AO AV O'; break; case '28' : //Auto Ops & Auto Voice & Voice $str = ' AO AV V'; break; case '29' : //Channel Admin & Auto Ops & Auto Voice & Voice $str = ' CA AO AV V'; break; case '30' : //Auto Ops & Auto Voice & Ops & Voiced $str = ' AO AV O V'; break; case '31' : //Channel Admin & Auto Ops & Auto Voice & Ops & Voiced $str = ' CA AO AV O V'; break; default : $str = ''; break; } return $str; } function removeChar($str) { $str = str_replace('"', '', $str); return $str; } function time_convert($time) { $hours = floor($time/3600); $minutes = floor(($time%3600)/60); $seconds = floor(($time%3600)%60); if($hours>0) $time = $hours."h $minutes"."m $seconds".'s'; else if($minutes>0) $time = $minutes."m $seconds".'s'; else $time = $seconds.'s'; return $time; } function getCodec($codec) { switch ($codec) { case '0' : $codec = 'CELP 5.2 Kbit'; break; case '1' : $codec = 'CELP 6.3 Kbit'; break; case '2' : $codec = 'GSM 14.8 Kbit'; break; case '3' : $codec = 'GSM 16.4 Kbit'; break; case '4' : $codec = 'Windows CELP 5.2 Kbit'; break; case '5' : $codec = 'Speex 3.4 Kbit'; break; case '6' : $codec = 'Speex 5.2 Kbit'; break; case '7' : $codec = 'Speex 7.2 Kbit'; break; case '8' : $codec = 'Speex 9.3 Kbit'; break; case '9' : $codec = 'Speex 12.3 Kbit'; break; case '10' : $codec = 'Speex 16.3 Kbit'; break; case '11' : $codec = 'Speex 19.5 Kbit'; break; case '12' : $codec = 'Speex 25.9 Kbit'; break; default : $codec = ''; break; } return $codec; } function setPPriv($str) { switch ($str) { case '5' : //Server Admin $str = 'R SA'; break; case '4' : //Registered $str = 'R'; break; default : $str = 'U'; break; } return $str; } function setPPrivText($str) { switch ($str) { case '5' : //Server Admin $str = 'Server Administrator
Registered'; break; case '4' : //Registered $str = 'Registered'; break; default : $str = 'None'; break; } return $str; } function setCPrivText($str) { switch ($str) { case '1' : //Channel Admin $str = 'Channel Admin'; break; case '2' : //Channel Ops $str = 'Channel Ops'; break; case '3' : //Channel Admin & Ops $str = 'Channel Admin
Ops'; break; case '4' : //Voice $str = 'Voice'; break; case '5' : //Channel Admin & Voice $str = 'Channel Admin
Voice'; break; case '6' : //Ops & Voice $str = 'Ops
Voice'; break; case '7' : //Channel Admin & Ops & Voiced $str = 'Channel Admin
Ops
Voiced'; break; case '8' : //Auto Ops $str = 'Auto Ops'; break; case '9' : //Channel Admin & Auto Ops $str = 'Channel Admin
Auto Ops'; break; case '10' : //Auto Ops & Auto Ops $str = 'Auto Ops
Ops'; break; case '11' : //Channel Admin & Auto Ops & Operator $str = 'Channel Admin
Auto Ops
Ops'; break; case '12' : //Auto Ops & Voiced $str = 'Auto Ops
Voiced'; break; case '13' : //Channel Admin & Auto Ops & Voiced $str = 'Channel Admin
Auto Ops
Voiced'; break; case '14' : //Auto Ops & Ops & Voiced $str = 'Auto Ops
Ops
Voiced'; break; case '15' : //Channel Admin & Auto Ops & Ops & Voiced $str = 'Channel Admin
Auto Ops
Ops
Voiced'; break; case '16' : //Auto Voice $str = 'Auto Voice'; break; case '17' : //Channel Admin & Auto Voice $str = 'Channel Admin
Auto Voice'; break; case '18' : //Auto Voice & Ops $str = 'Auto Voice
Ops'; break; case '19' : //Channel Admin & Auto Voice & Ops $str = 'Channel Admin
Auto Voice
Ops'; break; case '20' : //Auto Voice & Voice $str = 'Auto Voice
Voice'; break; case '21' : //Channel Admin & Auto Voice & Voice $str = 'Channel Admin
Auto Voice
Voice'; break; case '22' : //Auto Voice & Ops & Voice $str = 'Auto Voice
Ops
Voice'; break; case '23' : //Channel Admin & Auto Voice & Ops & Voice $str = 'Channel Admin
Auto Voice
Ops
Voice'; break; case '24' : //Auto Ops & Auto Voice $str = 'Auto Ops
Auto Voice'; break; case '25' : //Channel Admin & Auto Ops & Auto Voice $str = 'Channel Admin
Auto Ops
Auto Voice'; break; case '26' : //Auto Ops & Auto Voice & Ops $str = 'Auto Ops
Auto Voice
Ops'; break; case '27' : //Channel Admin & Auto Ops & Auto Voice & Ops $str = 'Channel Admin
Auto Ops
Auto Voice
Ops'; break; case '28' : //Auto Ops & Auto Voice & Voice $str = 'Auto Ops
Auto Voice
Voice'; break; case '29' : //Channel Admin & Auto Ops & Auto Voice & Voice $str = 'Channel Admin
Auto Ops
Auto Voice
Voice'; break; case '30' : //Auto Ops & Auto Voice & Ops & Voiced $str = 'Auto Ops
Auto Voice
Ops
Voiced'; break; case '31' : //Channel Admin & Auto Ops & Auto Voice & Ops & Voiced $str = 'Channel Admin
Auto Ops
Auto Voice
Ops
Voiced'; break; default : $str = 'None'; break; } return $str; } function indexOf($str,$strChar) { if(strlen(strchr($str,$strChar))>0) { $position_num = strpos($str,$strChar) + strlen($strChar); return $position_num; } else { return -1; } } function getChannelName($cid,$ip,$port,$tPort) { $name = 'Unknown'; $cArray = getChannels($ip,$port,$tPort); for($i=0;$i=10) { $innerArray[$j] = convertCharset($data[$i]); if($j>=8) { $cArray[$k]=$innerArray; $j = 0; $k = $k+1; } else { $j++; } } } fclose($fp); } return $cArray; } function getTSChannelUsers($ip,$port,$tPort) { $uArray = array(); $innerArray = array(); $out = ""; $j = 0; $k = 0; $fp = fsockopen($ip, $tPort, $errno, $errstr, 30); if($fp) { fputs($fp, "pl ".$port."\n"); fputs($fp, "quit\n"); while(!feof($fp)) { $out .= fgets($fp, 1024); } $out = str_replace("[TS]", "", $out); $out = str_replace("loginname", "loginname\t", $out); $data = explode("\t", $out); $num = count($data); for($i=0;$i=15) { $uArray[$k]=$innerArray; $j = 0; $k = $k+1; } else { $j++; } } fclose($fp); } return $uArray; } function usedID($usedArray,$cid) { $ok = true; for($i=0;$iServer:\n"; $html .= "$name

\n"; $html .= "Server IP:\n"; $html .= "$ip:$port

\n"; $html .= "Version:\n"; $html .= "".getTSVersion($ip,$tPort,$port)."

\n"; $html .= "Type:\n"; $html .= "$tsTypeText

\n"; $html .= "Welcome Message:\n"; $html .= "$welcomeMsg

"; fclose($fp); } return $html; } function channelInfo($ip,$tPort,$port,$cID) { $cArray = getChannels($ip,$port,$tPort); $uArray = getTSChannelUsers($ip,$port,$tPort); $html = ''; $cUser = 0; $ok = false; for($i=0;$iChannel:\n"; $html .= "".removeChar($name)."

\n"; $html .= "Topic:\n"; $html .= "".utf8_encode(removeChar($topic))."

\n"; $html .= "User in channel:\n"; $html .= "".$cUser."/".removeChar($max)."

\n"; $html .= "Codec:\n"; $html .= "".getCodec($codec)."

\n"; $name = str_replace("'","¶",$name); // $html .= "
\n"; } else { $html = "Channel is deleted!\n"; } return $html; } function getTSVersion($ip,$tPort,$port) { $out = ""; $fp = fsockopen($ip, $tPort, $errno, $errstr, 30); if($fp) { fputs($fp, "sel ".$port."\n"); fputs($fp, "ver\n"); fputs($fp, "quit\n"); while(!feof($fp)) { $out .= fgets($fp, 1024); } $out = str_replace("[TS]", "", $out); $out = str_replace("OK", "", $out); $out = str_replace("\n", "", $out); $data = explode(" ", $out); fclose($fp); } return $data[0]; } function convertCharset($text) { return iconv('windows-1252', 'utf-8', $text); } ?>