PDA

View Full Version : Release: TeamSpeak 2 Banner Dispatcher


Cyrus
05-01-2007, 15:18
We are proud to announce a new nifty tool for your TeamSpeak 2 servers written in entire PHP 5. The tool is called TeamSpeak 2 Banner Dispatcher and allows you to define multiple banners and multiple banner link targets for TeamSpeak 2 servers running in the same instance.

The dispatcher uses XML-files as data storage and provides a well-documented easy to use PHP 5 API for associating servers and banners. Of course you can also use any other programming language that supports DOM-XML manipulation for manipulating the association tables.

The package contains the dispatcher class, example files and a README and is licensed under GNU General Public License.

Download TeamSpeak 2 Banner Dispatcher 0.3 (http://www.planetteamspeak.com/component/option,com_docman/task,doc_details/Itemid,69/gid,64/)

Edit:
Claw made a useful video tutorial that explains basic usage of this tool to newbies. Unfortunately he used a proprietary codec called "Camtasia" so hopefully you non-windows guys do understand my readme ;-)
Videotutorial: http://download.myvu.de/bannerdispatcher.rar

ScreaM_GER
05-01-2007, 15:54
Really a nice release!
Many hoster often asked whether it is somehow possible to have different banners on virtual servers.
Everytime we could only say "sorry, that is not possible". But now we can say "Yes, it is possible" :D

Maybe ATHP can offer a "privat banner" as extra special or something else.

Cyrus
07-01-2007, 17:56
Version 0.3 has been released and adds database support using PDO. This has been tested with SQLite 3, but should work with others like MySQL too.

Debone Tallywacker
10-02-2007, 09:36
im not really good at programming anything, i need a little help setting the Banner Dispatcher up on my system ive downloaded the Banner Dispatcher. but got no clue where to begin or end... i got my own TS server and webserver. im so i have access

Please help

Cyrus
10-02-2007, 11:21
please refer to the README and the examples provided

Debone Tallywacker
11-02-2007, 01:52
well thats the problem, im a newb at programming. so i dont understand the readme

i got no clue where to place the files or what to write in the XML file
if thats even something i have to do...

please help, if i could get an example of what had to be done. i might have a better understanding of what to do

the Readme seems to me like its really only for people who knows the programming language

ShadyPieZ
17-02-2007, 17:22
well thats the problem, im a newb at programming. so i dont understand the readme

i got no clue where to place the files or what to write in the XML file
if thats even something i have to do...

please help, if i could get an example of what had to be done. i might have a better understanding of what to do

the Readme seems to me like its really only for people who knows the programming language
I'm having the same problem as this guy, if someone could supply me with an example i'm sure i'll be able to understand alot more. :)

Cyrus
17-02-2007, 19:17
default-configurator.php and default-dispatcher.php are kind of example files. They already consist most of the parts the README describe. You just have to alter the values a bit.

and if you are a bit experienced you may have a look at the:
default-pdo files that use Databases instead of XML-files.

And please do not PM me.

Debone Tallywacker
19-02-2007, 17:54
i understand the *.php files somewhat, what i need an example of is the *.xml file

Cyrus
19-02-2007, 21:55
the xml-file get's created by the default-configurator.php just run it once

karimali831
19-02-2007, 23:55
I wish I understand this. :(
Looks like I can't have it. :(

astanford
22-02-2007, 22:47
if you need help shoot me a PM and i will install if for you.

ShadyPieZ
01-04-2007, 00:26
Has anyone managed to make a decent tutorial for this as I'd really like it on my server.

Or if anyone can help me via PM it would be much appreciated.

Claw
01-04-2007, 17:17
Has anyone managed to make a decent tutorial for this as I'd really like it on my server.

Or if anyone can help me via PM it would be much appreciated.

I've created an video tutorial - It should be very easy to setup your servers with the TeamSpeak Banner Dispatcher!

You can download it under the following link:
The File (http://download.myvu.de/bannerdispatcher.rar)
The Codec (If you just see a black screen) (http://www.techsmith.com/download/codecs.asp)

Have fun with it ;-)

Reedy Boy
01-04-2007, 21:25
I've created an viedeo tutorial - It should be very easy to setup your servers with the TeamSpeak Banner Dispatcher!

You can download it under the following link:
The File (http://download.myvu.de/bannerdispatcher.rar)
The Codec (If you just see a black screen) (http://www.techsmith.com/download/codecs.asp)

Have fun with it ;-)

Nice one

Should help people out loads

May be worth posting the files with the extra comments in? ;)

Cyrus
02-04-2007, 11:08
nice work, thanks for this claw, now also beginners should understand the thing ;)

Debone Tallywacker
02-04-2007, 21:45
I've created an video tutorial - It should be very easy to setup your servers with the TeamSpeak Banner Dispatcher!

You can download it under the following link:
The File (http://download.myvu.de/bannerdispatcher.rar)
The Codec (If you just see a black screen) (http://www.techsmith.com/download/codecs.asp)

Have fun with it ;-)

Awsome job Claw... tells me excactly what i need to know.

Thumbs up for a great video :p

randal
13-04-2007, 14:14
Hi,
I have six server on the same base. The banerdisplay is working, but the baner is on all server. How to do diffrent banners on all server?

Debone Tallywacker
14-04-2007, 09:59
Hi,
I have six server on the same base. The banerdisplay is working, but the baner is on all server. How to do diffrent banners on all server?

everything listet below can be found in default-configuration.php

This part is for the default banners. it gets shown on all servers unless you specify some specific routes...

/*
* Define some default routes.
*/
$router->addStaticRoute('banner', 'default', 'http://Example.com/someimage.jpg');
$router->addStaticRoute('target', 'default', 'http://http://www.Example.com/');

"default" Dont Change this one. its for the banner dispatcher. so it know what image and link to give to undefined servers


This is the Specific Routes. Here you Define what server should have what banner

/*
* Define some specific routes
*/
$router->addStaticRoute('banner', '1', 'http://Example.com/CoolLogo.jpg');
$router->addStaticRoute('target', '1', 'http://www.Example.com');
$router->addStaticRoute('banner', '2', 'http://Example.com/CoolLogo2.jpg');
$router->addStaticRoute('target', '2', 'http://www.AnotherExample.com');

You can add as many "$router->addStaticRoute" as you have servers. just remember each server should have a banner and a target for it to have an image and a link.

however i think it could work without a target so it would only show an image but im not sure...

"banner" Defines what the image should be for the server

"target" Defines what the target should be. aka. what Website it should open when clicking on the image

"1" Defines what server the banner and target is defined for

the server ID of all the servers can be found through the superadmin web interface

ID1 is 1
ID2 is 2
and so on.....

Hope this helps you

Martyr
25-07-2007, 20:22
Hi all

Sry this might be a silly question but assuming I've made an XML file using this resource, where do I place the XML file to do the job?

In a folder in my TS server installation??

Thanks
M.

Debone Tallywacker
26-07-2007, 01:15
if i remember correctly the XML file will automaticly be placed where it needs to be once you run the php script

ginger|HFD
26-07-2007, 07:17
Another fantastic work made by the third party tools people. Nice to see and nice to have!

Danke!

uMbRaNoX
27-07-2007, 14:41
hi there ppls

my problem is the next :
i know how to adjust the files but i cant get that xml file and i also dunno how to get it by running the default configuration.php
because i dont know how to run it i changed it and saved it but no xml file is created ?
im running ts on my home computer 24 hours 7 days a week and i dont have a webserver installed on it
i dunno where to start and in what maps i have to place what files i would love to have some help can u tell me how to do it ?
for example i have all the php files that come with the dispatcher download
- then i change the default configuration
-then the default dispatcher and add the links and banner for the other virtual server
- then i have to change something in the ini file of ts itself
- i restart ts and then it should work

that how i see it now and i have no clue over in what map i have to put the changed php files
- to what php file the ini file should refer to and where to change it in the ini file (prob on the place i filled in the banner that is showing everywhere now )
and how i get a xml file ?
i tried to open the default configuration.php in explorer but no xml file is showing ?
i would like to see that xml file somewhere :)

can u clear some things up for me , i know for some of u this sounds stupid mabey but i need to b taken by the hand and that someone starts with:
ok u open the dispatcher map, then u see the php files open the default configuration in dreamweaver ( my standard client for webthingy's) then change this and that ..
save it and then open ....

safe all ur files in this or that folder on the puter where u run the server
etc etc
step by step :(
if anyone would b so kind i would b so greatfull and mabey some others that have the same skills as me ( no skills lol)


thanks a million already !

uMbRaNoX
03-08-2007, 20:06
ok i downloaded a free app called wamp
it allows u to create a map on ur harddrive thats set as a server able to run php aswell
i did that and typed in my IE http://localhost/default-configuration.php
and the xml file was created so far so good
then i changed the ini file like on the movie and i changed the dispatcher witch
http://localhost:14242 superadmininlog passw. in the tcp line like on the movie
for the location i used http://localhost: (the portnumber that shows on my ts superadmin login screen)
my banners are not on the local server but on a www.something.com server
and i refered to them in the default configphp
the xml file looks like i was expecting but...
my banners still dont show up
i have 3 servers (virtual )
any idea's ?

sorry if this explaination isnt fully detailed i typed it at work

Cyrus
04-08-2007, 09:30
Did you activate access_u and access_r loglevels in the server.ini?

uMbRaNoX
04-08-2007, 14:24
i dont think i did how do i do that mate and thanks a LOT for ur quick reply by the way !!

ps : im at home now and can give u lil more detailed info :

first i downloaded this local server thats freeware and does the job great
http://www.e-novative.info/software/wamp.php
then i runned my default config.php while it was in the server map i created
by wamp with the command in explorer
http://localhost/default-configuration.php
that created the xml file
then i adjusted the server ini with the 2 lines as on the movie with :
http://localhost/default-dispacher.php
and still no banners show up ??


this is what i did and in the server ini i just added this line http://localhost/default-dispacher.php to both the ISPLinkURL=http://localhost/default-dispacher.php
and the GFX URL=http://localhost/default-dispacher.php

thats all i changed in the ini not what u mentioned i think can u help me out, do i need to change the acces u and acces r to 1 instead of 0 ?
regards eddy
i changed it to 1 and still no banners this is how my ini looks like now

[debug]
MessageTypes=LMTALL
MessageDepths=LMDALL
[Main Config]
ExternalIPDectection=1
HTTPServer Port=14534
HTTPServer Enabled=1
DateTimeFormat=dd-mm-yyyy hh:nn:ss
TCPQueryPort=51234
AllowedClientNameChars=
DisAllowedClientNameChars=()[]{}
BoundToIp1=
[WebPost]
AdminEmail=na
ISPLinkURL=http://localhost/default-dispatcher.php
ISPName=Private
ISPCountryNumber=4445
Enabled=1
PostURL=
ListPublic=0
UserAgent=teamspeak
[log]
access_r=1
access_u=1
channel_registerred=0
channel_unregisterred=0
sa=0
chat=0
kick_server=0
kick_channel=0
[Spam]
max_commands=10
in_seconds=2
[ISP]
GFX URL=http://localhost/default-dispatcher.php

hope u can help

Cyrus
05-08-2007, 10:16
You cannot use localhost as hostname because then the client would try to download the banner from his own pc which will not work.

uMbRaNoX
05-08-2007, 21:09
ok i understand that and in the default config all te banners are refering to a normal www server not on the local pc or do u mean that the dispatcher also not can run on a local server ?

BHKai
05-08-2007, 22:22
In other words, the information about the banner is sent to the client the client is the one that gets the banner.

So lets say the ip of your server is 12.123.123.45. You would put http://12.123.123.45/default-dispatcher.php because when the information about the banner is sent to the client the client will go to your server instead of trying to look on their computer.

uMbRaNoX
08-08-2007, 16:05
hello there :)

Cyrus i sended u all the files im using by pm will u pls b so kind to take a look at it, because in my opinion it shoeld work like this and i sended them to someone else aswell and he told me he wasnt using multiple servers but it does look good the way i did it.

i know u probably dont like ppl pm ing u about this but i have not much choise and if ur not willing or able to to check my files will u also b so kind to tell me that way someone else mabey wants to take a look at it .
but i dont feel so comfy to put them in the forum cuz i didnt change anything all my personal things are in there.

regards Eddy

Vashji
10-08-2007, 19:55
Hey guys i need a little help understanding something here.

* Specify a PDO
*/
$br = new BannerRouterPDO(new PDO('sqlite:default.sqlite'));

How can i change that to use mysql instead of sqlite

Claw
10-08-2007, 20:16
http://php.net/pdo

Vashji
11-08-2007, 05:17
still need help now after doing that i get this error
Catchable fatal error: Argument 1 passed to BannerRouterPDO::__construct() must be an instance of PDO, string given, called in C:\xampp\htdocs\bannerdispatcher\default-pdo-dispatcher.php on line 8 and defined in C:\xampp\htdocs\bannerdispatcher\BannerRouterPDO.p hp on line 59

Cyrus
11-08-2007, 13:45
Read the error message: you should pass a PDO object and you passed a string
so compare with the original code and you probably will find your mistake

Vashji
11-08-2007, 23:34
not really i'm not php savvy kinda hit a dead end here

Claw
12-08-2007, 00:15
$br = new BannerRouterPDO(new PDO('mysql:host=localhost;dbname=test', $user, $pass));

slayer1991
10-09-2007, 01:37
the video tutorial link is down...
i really need to know how to do this!!!!!!!!!
re up the vid? pease?

Claw
10-09-2007, 12:33
the video tutorial link is down...
i really need to know how to do this!!!!!!!!!
re up the vid? pease?

http://web5.hotel450.server4you.de/download.myvu.de/bannerdispatcher.rar

Impact-John
30-07-2008, 22:19
video link still not working?

Impact-John
31-07-2008, 01:43
i tried the best as i can without any help and am getting this error message

Fatal error: Uncaught exception 'RuntimeException' with message 'Unable to write to default.xml' in /home/shooter/public_html/BannerRouter.php:355 Stack trace: #0 /home/shooter/public_html/BannerRouter.php(83): BannerRouter->createXMLStore('default.xml') #1 /home/shooter/public_html/default-dispatcher.php(7): BannerRouter->__construct('default.xml') #2 {main} thrown in /home/shooter/public_html/BannerRouter.php on line 355

Alice_LJ
31-07-2008, 09:36
Thanks for that, good info there.:)

__________________
jewelry store (http://www.embracejewelry.com)

Claw
31-07-2008, 13:02
video link still not working?

http://web186.itsaserver.org/download.myvu.de/bannerdispatcher.rar

Impact-John
02-08-2008, 12:14
i am still getting malformed xml file errors and with the tutorial it says create a blank file named default.xml im not sure what im doing wrong

Claw
02-08-2008, 12:37
...

Wait for the following release:
http://forum.planetteamspeak.com/showthread.php?t=600

Impact-John
03-08-2008, 01:54
seems very good but there should be something with real ease for non programmers / linux experienced people to run like the banner dispatcher the read me for that program doesnt really help if you are not a pro in programming and in linux.

Cyrus
09-08-2008, 13:40
hmm maybe the programer is just not interested in such people using the software - without getting payed

orDian
13-08-2008, 15:45
Cant get it really work.
I only got one banner and that is the default..
I have 2 ts servers running on my pc.
And my xampp server.
i put this php file in the bannerdispatcher folder:
BannerRouter.php
<?php
/**
* Multiple Banner Application for TeamSpeak 2
*
*
* LICENSE:
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* @copyright 2006 Steven Barth
* @license http://www.gnu.org/licenses/gpl.html GNU General Public License
* @version $Id$
* @since 1.0
*/

/**
* Multiple Banner Application for TeamSpeak 2
*
* @copyright 2006 Steven Barth
* @license http://www.gnu.org/licenses/gpl.html GNU General Public License
* @version Release: $Id$
* @since 1.0
*/

class BannerRouter
{
/**
* Deinfes the expiration time of a dynamic route (default 24h)
*
*/
const DYNAMIC_ROUTE_EXPIRATION = 2073600;

/**
* Maximum filesize of a banner file (default 50kiB)
*/
const DISPATCHER_MAX_FILESIZE = 51200;

/**
* Lines to read from the logfile
*/
const DISPATCHER_LINES_TO_READ = 30;

/**
* XML storage file
*
* @var string
*/
protected $xmlstore;

/**
* TCP-Query stream
*
* @var resource
*/
protected $stream = null;

/**
* XML-Document
*
* @var DOMDocument
*/
protected $document;

/**
* Creates a new BannerRouter
*
* @param string $xmluri
*/
public function __construct($xmluri)
{
if (!is_readable($xmluri) || !is_writable($xmluri)) {
$this->createXMLStore($xmluri);
} else {
if (!$this->document = DOMDocument::load($xmluri)) {
throw new RuntimeException($xmluri . ' does not seem to be a wellformed XML-file');
}
}

$this->document->preserveWhiteSpace = false;
$this->document->formatOutput = true;

$this->xmlstore = $xmluri;
}

/**
* Connects to a given TeamSpeak 2 server
*
* @param string $serveruri
* @param string $username
* @param string $password
* @return void
*/
public function connect($serveruri, $username, $password)
{
$this->stream = @stream_socket_client($serveruri, $errcode, $errstring, 3);

if (!is_resource($this->stream)) {
throw new RuntimeException($errstring, $errcode);
}

$this->query("slogin $username $password");
}

/**
* Adds a new static route
*
* @param string $type
* @param string $source
* @param string $destination
* @param boolean $overwrite
* @return void
*/
public function addStaticRoute($type, $source, $destination, $overwrite = true)
{
$staticRoutes = $this->document->getElementsByTagName('staticRoutes')->item(0);
if ($overwrite) {
$this->dropStaticRoute($type, $source);
}
if ($this->getStaticRoute($type, $source) === null) {
$newRoute = $staticRoutes->appendChild($this->document->createElement('route'));
$newRoute->setAttribute('type', $type);
$newRoute->setAttribute('source', $source);
$newRoute->setAttribute('destination', $destination);
}
}

/**
* Returns a matching route or null if there are no matches
*
* @param string $type
* @param string $source
* @return DOMElement
*/
public function getStaticRoute($type, $source)
{
$xpath = new DOMXPath($this->document);
$list = $xpath->query('/routing/staticRoutes/route[@type="' . $type . '"][@source="' . $source . '"]');

if ($list->length > 0) {
return $list->item(0);
} else {
return null;
}
}

/**
* Drops a route if matching
*
* @param string source
* @return void
*/
public function dropStaticRoute($type, $source)
{
if ($route = $this->getStaticRoute($type, $source)) {
$route->parentNode->removeChild($route);
}
}

/**
* Adds a new dynamic route
*
* @param string $source
* @param string $destination
* @param integer $expiration
* @param boolean $overwrite
* @return void
*/
public function addDynamicRoute($source, $destination, $expiration, $overwrite = true)
{
$dynamicRoutes = $this->document->getElementsByTagName('dynamicRoutes')->item(0);
if ($overwrite) {
$this->dropDynamicRoute($source);
}
if ($this->getDynamicRoute($source) === null) {
$newRoute = $dynamicRoutes->appendChild($this->document->createElement('route'));
$newRoute->setAttribute('expiration', $expiration);
$newRoute->setAttribute('source', $source);
$newRoute->setAttribute('destination', $destination);
}
}

/**
* Returns a matching route or null if there are no matches
*
* @param string $source
* @return DOMElement
*/
public function getDynamicRoute($source)
{
$xpath = new DOMXPath($this->document);
$list = $xpath->query('/routing/dynamicRoutes/route[@source="' . $source . '"]');

if ($list->length > 0) {
return $list->item(0);
} else {
return null;
}
}

/**
* Drops a route if matching
*
* @param string source
* @return void
*/
public function dropDynamicRoute($source)
{
if ($route = $this->getDynamicRoute($source)) {
$route->parentNode->removeChild($route);
}
}

/**
* Cleans up expired dynamic routes
*
* @return void
*/
public function cleanDynamicRoutes()
{
$xpath = new DOMXPath($this->document);
$list = $xpath->query('/routing/dynamicRoutes/route[@expiration<' . time() . ']');
foreach ($list as $item) {
$item->parentNode->removeChild($item);
}
}

/**
* Commits changes in the XML-Document to the XML-Store
*
* @return void
*/
public function commit()
{
if (!@file_put_contents($this->xmlstore, $this->document->saveXML(), LOCK_EX)) {
throw new RuntimeException('Unable to write to ' . $xmluri, 0x01);
}
}

/**
* Dispatches a banner request
*
* @param string $userIp
* @return void
*/
public function dispatchBanner($userIp)
{
//Fetch loglines from TS2 log beginning with latest
$lines = array_reverse(explode("\r\n", $this->query('log ' . self::DISPATCHER_LINES_TO_READ)));

//Search for the IP-Pattern
$pos = false;
foreach ($lines as $line) {
$pos = strpos($line, " client connected [IP: $userIp");
if ($pos !== false) {
break;
}
}

//If there is any match, fetch server id, otherwise use 'default'
if ($pos !== false) {
$pos0 = strpos($line, 'SID: ');
$id = substr($line, $pos0 + 5, $pos - $pos0 - 5);
$id = (integer)$id;
} else {
$id = 'default';
}

//Probing banner routes
if (!$route = $this->getStaticRoute('banner', $id)) {
$route = $this->getStaticRoute('banner', 'default');
}

//Probing target routes
if (!$tRoute = $this->getStaticRoute('target', $id)) {
$tRoute = $this->getStaticRoute('target', 'default');
}

//Add dynamic routes if user clicks on the banner later
if ($tRoute !== null) {
$this->addDynamicRoute($userIp, $tRoute->getAttribute('destination'), time() + self::DYNAMIC_ROUTE_EXPIRATION);
}

//Probe for banner and maximum filesize and stream data to client
if ($route !== null) {
$fp = @fopen($route->getAttribute('destination'), 'rb');
$data = @stream_get_contents($fp, self::DISPATCHER_MAX_FILESIZE);
if (feof($fp)) {
$mime = (substr($route->getAttribute('destination'), -4) == '.png') ? 'image/png' : 'image/jpeg';
header("Content-Type: $mime");
header("Content-Length: " . strlen($data));
echo $data;
}
@fclose($fp);
}
}

/**
* Dispatches target requests from user
*
* @param string $userIp
* @return void
*/
public function dispatchTarget($userIp)
{
//Probing target routes
if (!$route = $this->getDynamicRoute($userIp)) {
$route = $this->getStaticRoute('target', 'default');
}

if ($route === null) {
header('Content-Type: text/plain');
echo "No matching route for your IP $userIp\n";
echo "No default route found\n";
echo "Giving up";
} else {
header('Location: ' . $route->getAttribute('destination'));
}
}

/**
* Assigns banner URL on target TeamSpeak 2 server
*
* @param string $url
* @return void
*/
public function assignBannerURL($url)
{
$this->query("globalset hoster_gfx_url $url");
}

/**
* Creates a new XMLStore
*
* @param string $xmluri
* @return void
*/
protected function createXMLStore($xmluri)
{
$this->document = new DOMDocument('1.0', 'iso-8859-1');
$rootNode = $this->document->appendChild($this->document->createElement('routing'));
$rootNode->appendChild($this->document->createElement('staticRoutes'));
$rootNode->appendChild($this->document->createElement('dynamicRoutes'));
if (!@file_put_contents($xmluri, $this->document->saveXML(), LOCK_EX)) {
throw new RuntimeException('Unable to write to ' . $xmluri, 0x01);
}
}

/**
* Queries the TeamSpeak-Server and returns the reply or throws an exception on failure
*
* @param string $cmd
* @return string
*/
protected function query($cmd) {
if (!is_resource($this->stream)) {
throw new RuntimeExcpetion('not connected!');
}
stream_socket_sendto($this->stream, $cmd . "\n");
$reply = $line = '';
do {
$line = fgets($this->stream);
if ($line == "OK\r\n") {
break;
}
if (strtolower(substr($line, 0, 6)) == 'error,') {
throw new RuntimeException($line);
break;
}
$reply .= $line;
} while(true);
return $reply;
}
}


________________
default-configuration.php
<?php
/**
* You probably need to run this file only onces and then delete it to avoid overwriting your config
* Read README for more details
*/

require 'BannerRouter.php';
$router = new BannerRouter('default.xml');

$router->addStaticRoute('banner', 'default', 'http://ordian.ftp.sh/banner/4.jpg');
$router->addStaticRoute('target', 'default', 'http://example.com');
/*
* Define some specific routes
*/
$router->addStaticRoute('banner', '1', 'http://ordian.ftp.sh/banner/1.jpg');
$router->addStaticRoute('target', '1', 'http://example.com');
$router->addStaticRoute('banner', '2', 'http://ordian.ftp.sh/banner/2.jpg');
$router->addStaticRoute('target', '2', 'http://example.com');


/*
* Save changes
*/
$router->commit();
________________
default-dispatcher.php
<?php
require 'BannerRouter.php';

/*
* Specify a XML-Storage for our data
*/
$br = new BannerRouter('default.xml');

/*
* Clean up old existing routes that are outdated and not longer in use
*/
$br->cleanDynamicRoutes();

/*
* Connect to the tcp-query interface of the TS2-Server
*/
$br->connect('tcp://127.0.0.1:51234', '*HIDDEN*', '*HIDDEN*');

/*
* We distinguish between users browser and TeamSpeak-Client requesting by matching the user agent
*/
if (strstr($_SERVER['HTTP_USER_AGENT'], 'Indy')) {
/*
* We are requested by the TS2-Client send him the banner he asked for
*/
$br->dispatchBanner($_SERVER['REMOTE_ADDR']);

/*
* Set a new banner url to prevent caching of the banners
*/
$br->assignBannerURL('http://' . $_SERVER['SERVER_NAME'] . $_SERVER['SCRIPT_NAME'] . '/' . md5(microtime(true)));
} else {

/*
* Redirect the user to the page
*/
$br->dispatchTarget($_SERVER['REMOTE_ADDR']);
}


/*
* Save any changes to the XML-file
*/
$br->commit();
________________
default.xml

<?xml version="1.0" encoding="iso-8859-1"?>
<routing>
<staticRoutes>
<route type="banner" source="default" destination="http://ordian.ftp.sh/banner/4.jpg"/><route type="target" source="default" destination="http://example.com"/><route type="banner" source="1" destination="http://ordian.ftp.sh/banner/1.jpg"/><route type="target" source="1" destination="http://example.com"/><route type="banner" source="2" destination="http://ordian.ftp.sh/banner/2.jpg"/><route type="target" source="2" destination="http://example.com"/></staticRoutes>
<dynamicRoutes><route expiration="1220708229" source="192.168.0.2" destination="http://example.com"/></dynamicRoutes>
</routing>

________________
My server.ini
This is offcours not upload on my webserver.
Just in the TS Server directory.

[debug]
MessageTypes=LMTALL
MessageDepths=LMDALL
[Main Config]
ExternalIPDectection=1
HTTPServer Port=14534
HTTPServer Enabled=1
DateTimeFormat=dd-mm-yyyy hh:nn:ss
TCPQueryPort=51234
AllowedClientNameChars=
DisAllowedClientNameChars=()[]{}
BoundToIp1=
[WebPost]
AdminEmail=
ISPLinkURL=http://ordian.ftp.sh/bannerdispatcher/default-dispatcher.php
ISPName=Public
ISPCountryNumber=4445
Enabled=0
PostURL=
ListPublic=1
UserAgent=teamspeak
[log]
access_r=1
access_u=1
channel_registerred=0
channel_unregisterred=0
sa=0
chat=0
kick_server=0
kick_channel=0
[Spam]
max_commands=5
in_seconds=2
[ISP]
GFX URL=http://ordian.ftp.sh/bannerdispatcher/default-dispatcher.php




hmm i got it working :D yeah