Community Forums Today's Posts     Member List     Archive    
Results 1 to 6 of 6
  1. #1
    Join Date
    Jun 2005
    Location
    UK
    Posts
    34

    PHP and TS Chat ?

    Does anyone have an example of how to use php to send text to a channel on TS ?

    I want to link my websites Shout Box, so that anything people shout on the shout box, will get sent to TS into a specific channel.

    And if possible , anything said in the channel sent to the shout box, that would require a plugin I know..

    I hope some one has example code I could look at in php, and that some one can code a plugin to do this.

  2. #2
    Join Date
    Dec 2009
    Location
    Germany
    Posts
    1,662
    Quote Originally Posted by Yavin View Post
    And if possible , anything said in the channel sent to the shout box, that would require a plugin I know..
    This is also possible with a Teamspeak server bot. I could add this to my Teamspeak bot, that all messages are captured and send to a PHP script by POST.

    I would prefer as command, example:
    *Shoutbox*: User "Homepage_XYZ" wrote:
    Hello, message, longer message, ...
    *TS_XYZ*: !send Answer message, ...
    *TS Bot*: Message successfully sent...
    *Shoutbox* is the PHP script of your homepage.
    *TS_XYZ* is an user on your Teamspeak server.
    *TS Bot* is a Teamspeak server bot which has this command.

    Just answer me if you are interested and you are able to run a Teamspeak bot. But I need some days to add this, my ToDo is long .


    With your PHP script just send the following telnet commands and it will show like in the example above:
    Code:
    use port={virtualserver port}
    login {loginname} {password}
    clientupdate client_nickname=Shoutbox
    whoami
    clientmove clid={client_id from whoami} cid={channelID to send the message to}
    sendtextmessage targetmode=2 msg=User\s"Homepage_XYZ"\swrote:\nHello,\smessage,\slonger\smessage,\s...

  3. #3
    Join Date
    Jun 2005
    Location
    UK
    Posts
    34
    I tried using fsock to connect to the server but it failed to connect :S

    At the moment I just want a simply php script that will have an edit box and a send button and anything typed into the box and sent will appear on TS.

    if some one could do that and list the code I would be very appreciative.

  4. #4
    Join Date
    Dec 2009
    Location
    Germany
    Posts
    1,662
    You can use this:

    http://forum.teamspeak.com/showthread.php?t=46905
    http://forum.teamspeak.com/showthread.php?t=48162

    Or you can use my simple class which I use on my homepage (I just removed the database queries for the TS3 server login and address).

    http://server.german-fighters.com/mu...leTSTelnet.zip

  5. #5
    Join Date
    Jun 2005
    Location
    UK
    Posts
    34
    Hay m8, I am trying to use your code.

    I changed the IP and Port in the top function TSconnect to our server. and then added the following code.

    Code:
    $Session = new SimpleTSTelnet();
    if ($Session->TSconnect()){ 
    	$Session->TSLogin("WebSite");
    	$msg=$Session->convertText2TS($msg);
    	//$Session->???? - Send $msg to guild chat tab ??
    	$Session->Disconnect();
    	
    } else {
    	echo "Failed to send message";
    }
    Few things, first of all the connection fails and times out, and second what do I need for TScommand to send $msg into the guild chat tab ?

    not sure but my server might not support fsock not sure how to test this tho.

  6. #6
    Join Date
    Dec 2009
    Location
    Germany
    Posts
    1,662
    Quote Originally Posted by Yavin View Post
    what do I need for TScommand to send $msg into the guild chat tab ?
    After connecting and login with my class, you have to do the following commands:

    Code:
    whoami
    clientmove clid={client_id from whoami} cid={channelID to send the message to}
    sendtextmessage targetmode=2 msg=User\s"Homepage_XYZ"\swrote:\nHello,\smessage,\slonger\smessage,\s...

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •