Closed Sebbo94BY closed 6 years ago
Only examples are found in the documentation:
// load framework files
require_once("libraries/TeamSpeak3/TeamSpeak3.php");
// connect to local server, authenticate and spawn an object for the virtual server on port 9987
$ts3_VirtualServer = TeamSpeak3::factory("serverquery://username:password@127.0.0.1:10011/?server_port=9987");
// build and display HTML treeview using custom image paths (remote icons will be embedded using data URI sheme)
echo $ts3_VirtualServer->getViewer(new TeamSpeak3_Viewer_Html("images/viewericons/", "images/countryflags/", "data:image"));
Unfortunately, there's not much in way of examples of viewer options.
I would advise checking the TeamSpeak3_Viewer_Html
class.
Sorry there's not better documentation for this!
Basically, all you need to do is create your own custom class that implements TeamSpeak3_Viewer_Interface
. The fetchObject() method is called once for every item in the server tree. Sorting and gathering the object information is done automatically by the framework.
Your code can then look like this:
echo $server->getViewer(new YourCustomViewerClass($arg1, $arg2, $arg3));
Hey,
Is there any documentation with examples, what you can build and which options are available?