You are missing our premiere tool bar navigation system! Register and use it for FREE!

NukeCops  
•  Home •  Downloads •  Gallery •  Your Account •  Forums • 
Readme First
- Readme First! -

Read and follow the rules, otherwise your posts will be closed
Modules
· Home
· FAQ
· Buy a Theme
· Advertising
· AvantGo
· Bookmarks
· Columbia
· Community
· Donations
· Downloads
· Feedback
· Forums
· PHP-Nuke HOWTO
· Private Messages
· Search
· Statistics
· Stories Archive
· Submit News
· Surveys
· Theme Gallery
· Top
· Topics
· Your Account
Who's Online
There are currently, 301 guest(s) and 0 member(s) that are online.

You are Anonymous user. You can register for free by clicking here
Nuke Cops :: View topic - TeamSpeak Block [ ]
 Forum FAQ  •  Search  •   •  Memberlist  •  Usergroups   •  Register  •  Profile •    •  Log in to check your private messages  •  Log in

 
Post new topic  Reply to topicprinter-friendly view
View previous topic Log in to check your private messages View next topic
Author Message
mrmagoo_83
Sergeant
Sergeant


Joined: Oct 03, 2003
Posts: 88


PostPosted: Tue Mar 09, 2004 7:23 am Reply with quoteBack to top

I found a TeamSpeak block, actually I think I posted the code here a while back. Anyway...

I was able to edited the code and adapt it to my purpose. It now only shows the channels that contain players. I got sick of it scrolling through the 50 channels that were empty.

Anyway, there is no major editing needed, you just have to go into the file and insert your TS server data into a single line, and then its done.

It works as a side block, and I removed the connect portion (was bothersome, since our server is passworded anyway). So now it does nothing but show the channel name and the name of the players in that channel. Though I am working on making it show the status of those players, but as I know very little about PHP, I am just screwing around right now.
Find all posts by mrmagoo_83View user's profileSend private message
gear
Captain
Captain


Joined: May 14, 2003
Posts: 579

Location: Mid-Cities

PostPosted: Tue Mar 09, 2004 8:20 am Reply with quoteBack to top

Sounds great Exclamation

Now, where is it Question Razz

g

_________________
http://toprake.com

Last edited by gear on Sun Oct 24, 2004 4:53 am; edited 1 time in total
Find all posts by gearView user's profileSend private messageVisit poster's website
mrmagoo_83
Sergeant
Sergeant


Joined: Oct 03, 2003
Posts: 88


PostPosted: Tue Mar 09, 2004 8:55 am Reply with quoteBack to top

oops, I guess it would have help if I posted the code.

I am at work now, I will try to post it so people can download it tonight when I get home.
Find all posts by mrmagoo_83View user's profileSend private message
bretonmage
Captain
Captain


Joined: Feb 21, 2004
Posts: 421


PostPosted: Tue Mar 09, 2004 9:53 am Reply with quoteBack to top

Speaking of the TS block, has anyone ever got the Webpost thingie to work? (so that the login button works)
Find all posts by bretonmageView user's profileSend private message
gear
Captain
Captain


Joined: May 14, 2003
Posts: 579

Location: Mid-Cities

PostPosted: Tue Mar 09, 2004 10:07 am Reply with quoteBack to top

I could get the ts module working perfectly on my test site for short periods, but then things would go wrong. Something about "[DATABASE ERROR:]1016: Can't open file: 'ts2_user.MYI'. (errno: 145)". I asked a php/sql specialist I know and he used technical terms like "sql-brainfart" when elaborating on the issue Laughing.

But during the brief periods of operation I could login.

g

_________________
http://toprake.com

Last edited by gear on Sun Oct 24, 2004 4:54 am; edited 1 time in total
Find all posts by gearView user's profileSend private messageVisit poster's website
XenoMorpH
Lieutenant
Lieutenant


Joined: Aug 24, 2003
Posts: 187

Location: Coevorden, Netherlands

PostPosted: Wed Mar 10, 2004 4:06 pm Reply with quoteBack to top

I got a neat TS-block on my site for downloading. It doesn't need webpost and ya can join the cannel with just 1 click on it.

_________________
http://www.tdi-hq.com
MSN- status: Image
Find all posts by XenoMorpHView user's profileSend private message
DevilsTaco
Private
Private


Joined: Dec 27, 2003
Posts: 46

Location: Los Angeles

PostPosted: Thu Mar 11, 2004 11:52 am Reply with quoteBack to top

Well, are we eventually going to be posting the codes for these blocks or is this a just a "woof" thread? Laughing
Here let me join in...
My wife is really hot! Laughing

_________________
Enlightening humanity; one brain freeze at a time. www.lemonsquishy.com/gobblog/index.php
Find all posts by DevilsTacoView user's profileSend private messageVisit poster's website
endofmission
Sergeant
Sergeant


Joined: Feb 02, 2004
Posts: 104


PostPosted: Sun Mar 14, 2004 7:36 am Reply with quoteBack to top

XenoMorpH wrote:
I got a neat TS-block on my site for downloading. It doesn't need webpost and ya can join the cannel with just 1 click on it.

Nice site where was the Download for the TS block??

DevilsTaco wrote:
My wife is really hot!

maybe you should post her pic if the code is not going to be posted LOL
Find all posts by endofmissionView user's profileSend private messageSend e-mailVisit poster's websiteAIM Address
DevilsTaco
Private
Private


Joined: Dec 27, 2003
Posts: 46

Location: Los Angeles

PostPosted: Wed Mar 17, 2004 6:17 pm Reply with quoteBack to top

Laughing

Code:
   XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXb.
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXc
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXb
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXk
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXN
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXc
XXXXXXXXXXXXXXXXXXX9XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXe
XXXXXXXXXXXXXXXXXXE@XXX9XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXb.
XXXXXXXzXXXXXXXXXX4XXXzXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXc
XXXXXX3XXXXXXXXXX\XX"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX9XXXXXXXb.
XXXXXEXXXXXXXXXX"X5@XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"""*X&XXXXXXXXXXN.
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX*XXXXXXXXXXXXXXX" x:    ^XXXXXXX!XXXN
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX9XXXXXXXXXXXXXXX !        #XXXXXkXEXXXL
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXFXXXXXXXXXXXXXXXE >         'XXXXEXX9XXXN
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXdXXXXXXXXXX\XXXX& !           XXXNXEXXXXXXL
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXPdXF@XXX          .   #XXXXXXXXXXXL
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXPlXXzXXXXXXNL   -   '    ?XXXXXXXXXXXr
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX&/ '>'     >"XXXXXXXXXE
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX#*XXXXXXXXXXXXXXXXXf  "":    ! 'X> "XXXXX.
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXP"       "*XXXXXXXXXXX"  .r"     !  ?X    "*XXXb
XXXXXXXXXXXXX/XXXXXXXXXXXXXXX*"               `"""#**X"    ze    f   9%
XXXXXXXXXXXXXX(XXXXXXXXXXP"                            ^%.'XXE  f    '>"
XXXXXXXXXXXXXXX9X"                                         ?6.z%      % '
XXXXX#XXXXXXXXX@N                                          XX  %
XXXXXXXeC2**#XXXX&                                        XXEM   ".
XXXXXXXXXXXXXX ?X^b                                      XXXE!#    ".
XXXXXXXXXXXFXE 'X> "*eu....                             XXXXE!!9     %
XXXXXXXXXX 'X>  X>                 .@"                 @XXXXE!!!9     S
XXXXXXXX"  @X   9L               eF                   @XXXXXE!!!!N     >
lXXXX*"   'XX>  9E            zX#                    @XXXXXXE?*W!!N    9
XXXX      XF9>  '&         zXX"   :u                d*XXXXXXE!!!!X*k   'E
XXXE      X 9>   X        JXX"  X@XXN                dXXXXXXE!!!!!k     E!
XXXE     :X 'N   X>       XX~  @XX"`9~              JXXXXXXXET*U!!!L    9!>    f
XXXF     'E  X>  4E      JXF  9XF*  "              JXXXXXXXXE!!!!TNUL   9!!   f
XXX       N  4E  'X      XE  JX '` "                 XXXXXXXE!!!!!M     '!!> f
XXE       X   X   X>    JX   XF  /                  XXXXXX*"^*W!!!!M    '!!!!
XX        9>  4k  4L    XF  'E'~                   XXX*"        ^*W!M    E!@
X         'L   X> 'N   dX    "=                   *"                ^*   &9
F          !    X  9>  "     '                                           9~
L          '    '& 'K      '                                             f
XN          h    "L 9                                                   f
XXXk        '     'L'>                                                 :
XXXXXL         ...udLB                                                  7~+.
XXXXXXN    zdXX#)@XBXLF%                                               J       "
XXXXXXXNdXXXX" WX*.XX &                                               /
XXXXXXXXXXP  \@X!  :  '>                             .XF             /
XXXXXXXXXXXXXXXXeuu"                              .dXX?>            :
XXXXXXXXXXXXXXXXXXXk                    .=      .@XX#!!>           :
XXXXXXXXXXXXXXXXXXXXX.                ::       JXXX%!!!F        u="
XXXXXXXXXXXXXXXXXXXXXXk                .="     XXX%!!~//     ."
XXXXXXXXXXXXXXXXXXXXXXXXc                    .dXXX!!! @    J
XXXXXXXXXXXXXXXXXXXXXXXXXXc                  XXX*!!!!W    F
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXe.             .X#!!!!U"   .4
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXTXXXWe.            ^"   r"   ^L
XXXXXXXXXXXXXXXXXXXXXXXXXXXXX!XXXXXXXXXXXXWWeu..    /       %
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXdXXXXXXXXXXXXXXXXXXXXeJ         ^L
XXXXXXXXXXXXXXXXXXXXXXXXXXXXEXXXXXXXXXXXXXXXXXXXXXX%           %
XXXXXXXXXXXXXXXXXXXXXXXXXXXXdXXXXXXXXXXXXXXXXXXXXX" %           'c
XXXXXXFdXXXXXXXXXXXXXXXXXXXdXXXXXXXXXXXXXXXXXXXXX    h             ".




   

_________________
Enlightening humanity; one brain freeze at a time. www.lemonsquishy.com/gobblog/index.php
Find all posts by DevilsTacoView user's profileSend private messageVisit poster's website
XenoMorpH
Lieutenant
Lieutenant


Joined: Aug 24, 2003
Posts: 187

Location: Coevorden, Netherlands

PostPosted: Thu Mar 18, 2004 5:45 am Reply with quoteBack to top

endofmission wrote:

Nice site where was the Download for the TS block??


What about the download section? LOL

_________________
http://www.tdi-hq.com
MSN- status: Image
Find all posts by XenoMorpHView user's profileSend private message
DevilsTaco
Private
Private


Joined: Dec 27, 2003
Posts: 46

Location: Los Angeles

PostPosted: Thu Mar 18, 2004 1:21 pm Reply with quoteBack to top

XenoMorpH wrote:
endofmission wrote:

Nice site where was the Download for the TS block??


What about the download section? LOL


lol
No man, these are different blocks...
These guys came in here like a gaggle of geese and started honking about their unique blocks and never graced us with the code.

Hey, guys... we're still here!
Hello!

_________________
Enlightening humanity; one brain freeze at a time. www.lemonsquishy.com/gobblog/index.php
Find all posts by DevilsTacoView user's profileSend private messageVisit poster's website
endofmission
Sergeant
Sergeant


Joined: Feb 02, 2004
Posts: 104


PostPosted: Thu Mar 18, 2004 5:28 pm Reply with quoteBack to top

yes I agree I want the new TS block!!

_________________
Image
Find all posts by endofmissionView user's profileSend private messageSend e-mailVisit poster's websiteAIM Address
mrmagoo_83
Sergeant
Sergeant


Joined: Oct 03, 2003
Posts: 88


PostPosted: Fri Apr 16, 2004 8:53 am Reply with quoteBack to top

Sorry, I am back, had to go away for a while and never got to post the code, my fault.

But after the anticiaption here it is.....

Code:
<?php

$usemarquee = 0;
$scrolldirection = "Up";

// **** settings - to be edited before first use ****
$serverAddress = "XXX.XXX.XXX.XXX";  // 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 &quot;OK&quot; 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/teamspeak/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/teamspeak/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 .= "</Marquee><br>";

?>
Find all posts by mrmagoo_83View user's profileSend private message
endofmission
Sergeant
Sergeant


Joined: Feb 02, 2004
Posts: 104


PostPosted: Wed Apr 21, 2004 4:31 am Reply with quoteBack to top

Great Job, I think this is the best and easiest one I have used. By the way if you dont have the .gif's here I linked them to my site just click the ones you need and save them to your site:

bullet_0 CLICK HERE

bullet_channel CLICK HERE

_________________
Image
Find all posts by endofmissionView user's profileSend private messageSend e-mailVisit poster's websiteAIM Address
Inspector
Nuke Cadet
Nuke Cadet


Joined: Apr 29, 2004
Posts: 1


PostPosted: Thu Apr 29, 2004 2:07 am Reply with quoteBack to top

instead of using fscanf for separating the values or using next-functions you should use:

$line=fgets($socket);
$data=explode("\t",$line);

background:
in fscanf whitespaces are recognized as separators even if you use /t (tab) in the format string. not so using explode. explode REALLY only uses /t to separate the data. but carefull, to get this working in the current script, a view lines more have to be changed.

b.t.w. i don't think this is a bug in fscanf. it's just the way this function works...
Find all posts by InspectorView user's profileSend private message
Display posts from previous:      
Post new topic  Reply to topicprinter-friendly view
View previous topic Log in to check your private messages View next topic
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



Powered by phpBB © 2001, 2005 phpBB Group

Ported by Nuke Cops © 2003 www.nukecops.com
:: FI Theme :: PHP-Nuke theme by coldblooded (www.nukemods.com) ::
Powered by TOGETHER TEAM srl ITALY http://www.togetherteam.it - DONDELEO E-COMMERCE http://www.DonDeLeo.com - TUTTISU E-COMMERCE http://www.tuttisu.it
Web site engine's code is Copyright © 2002 by PHP-Nuke. All Rights Reserved. PHP-Nuke is Free Software released under the GNU/GPL license.
Page Generation: 0.288 Seconds - 162 pages served in past 5 minutes. Nuke Cops Founded by Paul Laudanski (Zhen-Xjell)
:: FI Theme :: PHP-Nuke theme by coldblooded (www.nukemods.com) ::