gameover16
Member
- Jul 6, 2016
- 16
- 0
- 51
Wrong Thread Title
i need get user avatar in ts3 server from php but i get error
error
PHP:
<?php
// load framework files
require_once("libraries/TeamSpeak3/TeamSpeak3.php");
// connect and get server object
$serverObj = TeamSpeak3::factory("serverquery://serveradmin:[email protected]:10011/?server_port=9987");
// grab first matching id for given nickname and query db info
$clientDbid = current($serverObj->clientFindDb("123"));
$clientInfo = $serverObj->clientInfoDb($clientDbid);
// init a file transfer for the client avatar using random transfer id
$download = $node->transferInitDownload(rand(0x0000, 0xFFFF), 0, "/avatar_" . $clientInfo["client_base64HashClientUID"]);
$transfer = TeamSpeak3::factory("filetransfer://" . $download["host"] . ":" . $download["port"]);
// download the avatar data
$avatar = $transfer->download($download["ftkey"], $download["size"]);
// send header and display image
header("Content-Type: " . TeamSpeak3_Helper_Convert::imageMimeType($avatar));
?>
error
HTML:
Notice: Undefined variable: node in /opt/lampp/htdocs/ts3/index.php on line 13
Fatal error: Call to a member function transferInitDownload() on a non-object in /opt/lampp/htdocs/ts3/index.php on line 13