The information that MrMagoo put up works great! However, I too would like to watch only one channel (with subchannels) on a particular server. Is it possible with this code?
Code:
<?php
$usemarquee = 0;
$scrolldirection = "Up";
// **** settings - to be edited before first use ****
$serverAddress = "67.19.91.114"; // can be ip address or url
$serverQueryPort = 51234; // default 51234, must be accessible and usable. check server.ini
$serverUDPPort = 8786; // default 8767
// **** end of settings ****
if (eregi("block-TS_HALO.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");
}
// determine number of players in channel
$playercount = 0;
foreach($playerList as $playerInfo) {
if($playerInfo[channelid] == $channelid) $playercount++;
}
// close connection to teamspeak server
closeSocket($socket);
$content .= "</Marquee><br>";
?>
karmajay Nuke Cadet
Joined: Aug 21, 2004
Posts: 6
Posted:
Thu Aug 26, 2004 7:50 am
Thanks for the work!
Where do those bullets actually go? I have them in my webpost folder, yet they don't show up.
Also, I noticed that if there is a space in the name, the block only picks up the letters before the space. Is there someone to fix this?
Thanks!
karmajay Nuke Cadet
Joined: Aug 21, 2004
Posts: 6
Posted:
Fri Aug 27, 2004 8:53 am
I figured it out, just had to change the path for thos ebullets.
Thanks!
THEREDRUM Nuke Cadet
Joined: Sep 06, 2003
Posts: 1
Posted:
Fri Aug 27, 2004 4:53 pm
Thanks for the credit there Magoo U piece o chit!
}#{REDRUM Orginal "Un-Hacked" Teamspeak block creator.
mrmagoo_83 Sergeant
Joined: Oct 03, 2003
Posts: 88
Posted:
Fri Sep 10, 2004 11:54 am
Hey I stated many times that I was not the creator of this block. I just tweaked some of it to fit my needs.
So don't go getting torked at me.
And on a second note, this wasn't the orginal code you sent me, I lost that code when my first site & teamspeak server went down. I then downloaded the code for the above block off another site, cause I tried to email you and see about getting it sent to me again. But heard nothing back, I liked yours cause it had the connect button, but since I never heard from you again, I went in search elsewhere. I found this code and edited it. That code had no Copyright name on it, like yours did, yours even had your website at the top I think.
So yes, you wrote a very nice TS block. But I didn't give credit cause I didn't use the block you gave me. So lose the attitude with me, cause I didn't do anything wrong.
CurtisTheGreat Nuke Soldier
Joined: Aug 09, 2004
Posts: 22
Posted:
Fri Sep 17, 2004 2:42 pm
Is there a way to make this script work with a Teamspeak server username and password? The server that I would be connecting to requires usernames and passwords to connect.
Any help would be great!
RobbieB Lieutenant
Joined: Jul 15, 2003
Posts: 195
Location: California
Posted:
Sun Sep 19, 2004 8:58 pm
How can I use this as just a standalone file? ie. non nuke site, plain page, just this.
I have 2 reasons for not wanting to use it as a block. I have a separate child site that the ts is really for and that site isn't on phpnuke. But also, I couldn't figure out how to change the indenting of the channel and user names. As it is now, the channel is indented or has more cell padding or margin then my regular blocks, and then the users in each channel themselves start in like the middle of the block so basically, anyone with more then 1 letter in their name pushes the block width way wider then the rest of my blocks.
Last edited by RobbieB on Mon Sep 20, 2004 10:25 am; edited 1 time in total
CurtisTheGreat Nuke Soldier
Joined: Aug 09, 2004
Posts: 22
Posted:
Mon Sep 20, 2004 4:53 am
*bump*
Quote:
Is there a way to make this script work with a Teamspeak server username and password? The server that I would be connecting to requires usernames and passwords to connect.
CurtisTheGreat Nuke Soldier
Joined: Aug 09, 2004
Posts: 22
Posted:
Tue Sep 21, 2004 5:12 am
No one has any ideas here?
Pagannn Nuke Cadet
Joined: Oct 12, 2004
Posts: 1
Posted:
Tue Oct 12, 2004 4:27 pm
Inspector wrote:
instead of using fscanf for separating the values or using next-functions you should use:
$line=fgets($socket);
$data=explode("\t",$line);
I fixed it. I'm sure it could have been done in a cleaner way, but I'm a php n00b as well.
This is a direct replacement of the do..while loop that contains the fscanf function (the line of code before the while loop begins MUST be included):
Code:
//Skip the first line. It only contains header labels
fgets($socket);
while (true)
{
//Read the next line from the socket
$line = fgets($socket);
//Break it up on the tab delimiter
$playerinfo = explode("\t", $line);
//Bail out if only one element
if (count($playerinfo) == 1)
{
//Only one element means the OK has been encountered.
//The list is done.
break;
}
This also removes the double quotes from the player name.
karmajay Nuke Cadet
Joined: Aug 21, 2004
Posts: 6
Posted:
Wed Oct 13, 2004 2:45 pm
Curtisthegreat,
I believe the block uses the admin name and password to get all the data.
It does work for channels where the users need passwords.
PresumedEvil Nuke Cadet
Joined: Jan 11, 2004
Posts: 5
Posted:
Tue Nov 02, 2004 12:26 pm
There's one that a couple of us worked up for CPG-Nuke at my site, and for DL in the cpgnuke forums as well.
www.presumedevil.com to see what it looks like. Needs no webpost at all, as it runs on a ported query tool.
Other questions can be directed to the www.cpgnuke.com forums on this, or on mine.
JWP1987 Nuke Cadet
Joined: Jan 06, 2005
Posts: 4
Posted:
Thu Jan 06, 2005 11:30 am
I've been coding a teamspeak block recently where you can get all the player, channel and server data by clicking on names.
Just been cleaning out the code and removing glitches like html tags being processed etc.
the TS block is running on http://www.btb-clan.f2s.com/index.php
it's at the bottom of the page in the middle.
it doesn't use webpost but it does use the database to output the channel and user data.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum