KCGaming
Member
Here is the code I'm using hope it helps
change this line to have the correct settings
this works by just sending messages to users who are in the Forum server group only avoiding guest and allowing members to opt out
change this line to have the correct settings
$ts3 = TeamSpeak3::factory("serverquery://queryname:querypassword@serverip:queryport/?server_port=serverport&use_offline_as_virtual=1&no_query_clients=1");
this works by just sending messages to users who are in the Forum server group only avoiding guest and allowing members to opt out
PHP:
require_once("libraries/TeamSpeak3/TeamSpeak3.php");
try {
$ts3 = TeamSpeak3::factory("serverquery://queryname:querypassword@serverip:queryport/?server_port=serverport&use_offline_as_virtual=1&no_query_clients=1");
$clients = $ts3->request("clientdblist")->toList();
}
catch (Exception $e) {
echo '<div style="background-color:red; color:white; display:block; font-weight:bold;">QueryError: ' . $e->getCode() . ' ' . $e->getMessage() . '</div>';
}
$Subject= "New Post in forum ".$nodeInfo['title']." in thread ".$threadData['title'];
$message= $visitor['username']." posted in the topic ".$threadData['title']." at "."[URL]".$url."[/URL]" ;
//$message .=print_r($threadData, true);
$identy ="qLgP7HGIplhOLt1vMrLBHMv8x7M=";
foreach($ts3->serverGroupGetByName("Forum")->clientList() as $client)
{
$ts3->messageCreate($client["client_unique_identifier"], $Subject, $message);
}