Results 1 to 5 of 5
Thread: TeamSpeak Viewer
-
20-11-2005, 19:06 #1
TeamSpeak Viewer
I've heard a lot about a script which allowes you to view who is on a teamspeak server on your we page. Does anyone know a download link for it and a way to install it?
P.S. Is version 1.1 still around and working?
Thanks
-
20-11-2005, 19:11 #2http://forum.goteamspeak.com/showthread.php?t=21905
Originally Posted by Bullet-ProofMonk
http://forum.goteamspeak.com/showthread.php?t=17382
http://forum.goteamspeak.com/showthread.php?t=17230
-
20-11-2005, 19:27 #3
Most were made in 2004, and the last linked topic has broken links in it.
But I'll try the one. I'm assuming I have to host the php file and images?
-
20-11-2005, 22:05 #4
-= TeamSpeak User =-
- Join Date
- Jan 2005
- Location
- NC
- Posts
- 1
I Use a Php Block
Use the Below block-Teaspeak block for my website,,,,I found it a year or so on the forums here....
<?php
// **** settings - to be edited before first use ****
$serverAddress = "xxx.xx.xxx.xx"; // can be ip address or url
$serverQueryPort = 51234; // default 51234, must be accessible and usable. check server.ini
$serverUDPPort = 8767; // default 8767
// **** end of settings ****
if (eregi("block-Teamspeak.php", $PHP_SELF)) {
Header("Location: index.php");
die();
}
global $user, $cookie;
getusrinfo($user);
cookiedecode($user);
$username = $cookie[1];
// opens a connection to the teamspeak server
function getSocket($host, $port, $errno, $errstr, $timeout) {
global $errno, $errstr;
@$socket = fsockopen($host, $port, $errno, $errstr, $timeout);
if($socket and fread($socket, 4) == "[TS]") {
fgets($socket, 128);
return $socket;
}// end if
return false;
}// end function getSocket(...)
// sends a query to the teamspeak server
function sendQuery($socket, $query) {
fputs($socket, $query."\n");
}
// answer OK?
function getOK($socket) {
$result = fread($socket, 2);
fgets($socket, 128);
return($result == "OK");
}
// closes the connection to the teamspeak server
function closeSocket($socket) {
fputs($socket, "quit");
fclose($socket);
}
// retrieves the next argument in a tabulator-separated string (PHP scanf function bug workaround)
function getNext($evalString) {
$pos = strpos($evalString, "\t");
if(is_integer($pos)) {
return substr($evalString, 0, $pos);
}
else {
return $evalString;
}
}
// removes the first argument in a tabulator-separated string (PHP scanf function bug workaround)
function chopNext($evalString) {
$pos = strpos($evalString, "\t");
if(is_integer($pos)) {
return substr($evalString, $pos + 1);
}
else {
return "";
}
}
// MAIN PROGRAM START
// establish connection to teamspeak server
$socket = getSocket($serverAddress, $serverQueryPort, $errno, $errstr, 3);
if($socket == false) {
$content .= "An error connecting to the TeamSpeak server has occured!<br>\n";
$content .= "Error number: ".$errno."<br>\n";
$content .= "Error description: ".$errstr."<br>\n";
return;
}
// select the one and only running server on port 8767
sendQuery($socket, "sel ".$serverUDPPort);
// retrieve answer "OK"
if(!getOK($socket)) {
die("Server didn't answer "OK" after last command. Aborting.");
}// end if
// retrieve player list
sendQuery($socket,"pl");
// read player info
$playerList = array();
do {
$playerinfo = fscanf($socket, "%s\t%d\t%d\t%d\t%d\t%d\t%d\t%d\t%d\t%d\t%d\t%d\t% d\t%s\t%s");
list($playerid, $channelid, $receivedpackets, $receivedbytes, $sentpackets, $sentbytes, $d, $d, $totaltime, $idletime, $d, $d, $d, $s, $playername) = $playerinfo;
if($playerid != "OK") {
$playerList[$playerid] = array("playerid" => $playerid,
"channelid" => $channelid,
"receivedpackets" => $receivedpackets,
"receivedbytes" => $receivedbytes,
"sentpackets" => $sentpackets,
"sentbytes" => $sentbytes,
"totaltime" => $totaltime,
"idletime" => $idletime,
"playername" => $playername);
}
} while($playerid != "OK");
// retrieve channel list
sendQuery($socket,"cl");
// read channel info
$channelList = array();
do {
$channelinfo = "";
do {
$input = fread($socket, 1);
if($input != "\n" && $input != "\r") $channelinfo .= $input;
} while($input != "\n");
$channelid = getNext($channelinfo);
$channelinfo = chopNext($channelinfo);
$codec = getNext($channelinfo);
$channelinfo = chopNext($channelinfo);
$parent = getNext($channelinfo);
$channelinfo = chopNext($channelinfo);
$d = getNext($channelinfo);
$channelinfo = chopNext($channelinfo);
$maxplayers = getNext($channelinfo);
$channelinfo = chopNext($channelinfo);
$channelname = getNext($channelinfo);
$channelinfo = chopNext($channelinfo);
$d = getNext($channelinfo);
$channelinfo = chopNext($channelinfo);
$d = getNext($channelinfo);
$channelinfo = chopNext($channelinfo);
$topic = getNext($channelinfo);
if($channelid != "OK") {
if($isdefault == "Default") $isdefault = 1; else $isdefault = 0;
// determine number of players in channel
$playercount = 0;
foreach($playerList as $playerInfo) {
if($playerInfo[channelid] == $channelid) $playercount++;
}
$channelList[$channelid] = array("channelid" => $channelid,
"codec" => $codec,
"parent" => $parent,
"maxplayers" => $maxplayers,
"channelname" => $channelname,
"isdefault" => $isdefault,
"topic" => $topic,
"currentplayers" => $playercount);
}
} while($channelid != "OK");
// display channel list
$content .= "<table width=\"100%\">\n";
$counter = 0;
foreach($channelList as $channelInfo) {
// default channel?
if($channelInfo[isdefault] == 1) {
$channelname = $channelInfo[channelname];
} else {
$channelname = $channelInfo[channelname];
}
if ($channelInfo[currentplayers] > 0) {
$content .= "<tr><td><img src=\"images/bullet_channel.gif\" border=\"0\"></td><td colspan=\"1 \">".$channelname." </td></tr>";
}
$counter++;
foreach ($playerList as $playerInfo) {
if ($channelInfo[channelid] == $playerInfo[channelid]) {
$content .= "<tr><td></td><td colspan=0><img src=\"images/bullet_0.gif\" border=\"0\" align=left>".$playerInfo[playername]."</td></tr>\n";
}
}
}
if($counter == 0) $content .= "<tr><td colspan=\"4\" align=\"CENTER\">No channels</td></tr>\n";
$content .= "</table>\n";
// close connection to teamspeak server
closeSocket($socket);
$content .= "<form name=\"testform\">";
$content .= "<input type=\"text\" name=\"NICKNAME\" size=\"19\" > ";
$content .= "NICKNAME";
$content .= "<br>";
//$content .= "<input type=\"text\" name=\"LOGINNAME\"> LOGIN NAME--For Registered Users";
$content .= "<br>";
//$content .= "<input type=\"text\" name=\"PASSWORD\"> PASSWORD--Registered Users";
//$content .= "<br>";
$content .= "<input type=\"button\" value=\"-->Submit<--\" onClick=\"location.href='teamspeak://$serverAddress: $serverUDPPort/nickname=' + testform.NICKNAME.value \">";
$content .= "<br>";
$content .= "</form>";
$content .="<center><a href=\"http://www.goteamspeak.com\"><img src=\"https://sales.tritoncia.com/images/link_to_teamspeak.gif\" border=\"0\" alt=\"Go to Teamspeak.com\"></a></center>"
."";
?>
-
04-12-2005, 17:36 #5
-= TeamSpeak User =-
- Join Date
- Nov 2005
- Location
- tennessee
- Posts
- 6
Quick Question
Ok my team speak server is password protected to keep out drifters who venture in and either want to play music or use foul language.
any way the script above i have it on my webpage and works really well. but does anyone know if there is away to put my ts server password on this script. either hidden or a box that one could type it in.
i dont not mind people drifting in from my website just not from scouting the ts server.
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Similar Threads
-
Looking for a teamspeak viewer in HTML
By boardy in forum [TeamSpeak 2] Client SupportReplies: 2Last Post: 18-07-2005, 16:53 -
teamspeak viewer ?
By NoS in forum [TeamSpeak 2] Server SupportReplies: 2Last Post: 11-07-2004, 22:07 -
[SEARCH/SUCHE] TeamSpeak Viewer
By Stromberg in forum [TeamSpeak 2] Addons & ScriptsReplies: 2Last Post: 17-06-2004, 10:10



Reply With Quote

