Teamspeak Banner Rotation

Aug 12, 2016
11
1
35
I just want to release a simple code for a banner rotation for your teamspeak server. It changes banner and the banner url at the same point. Perfect for social media stuff etc.

Here is the framework that i use: https://github.com/planetteamspeak/ts3phpframework

Code:
    <?php
    require("libraries/TeamSpeak3/TeamSpeak3.php");

    $ts3_VirtualServer = TeamSpeak3::factory("serverquery://querylogin:[email protected]:10011/?server_port=9987&nickname=Bannerwechsel_Bot");

    $zahl = rand(1,5);

    if($zahl == 1)
    {
    $ts3_VirtualServer->modify(array(
    "virtualserver_hostbanner_url" => "URL Banner 1",
    "virtualserver_hostbanner_gfx_url" => "Graphic URL 1",
    ));
    }

    if($zahl == 2)
    {
    $ts3_VirtualServer->modify(array(
    "virtualserver_hostbanner_url" => "URL Banner 2",
    "virtualserver_hostbanner_gfx_url" => "Graphic URL 2",
    ));
    }

    if($zahl == 3)
    {
    $ts3_VirtualServer->modify(array(
    "virtualserver_hostbanner_url" => "URL Banner 3",
    "virtualserver_hostbanner_gfx_url" => "Graphic URL 3",
    ));
    }
    
    if($zahl == 4)
    {
    $ts3_VirtualServer->modify(array(
    "virtualserver_hostbanner_url" => "URL Banner 4",
    "virtualserver_hostbanner_gfx_url" => "Graphic URL 4",
    ));
    }
    
    if($zahl == 5)
    {
    $ts3_VirtualServer->modify(array(
    "virtualserver_hostbanner_url" => "URL Banner 5",
    "virtualserver_hostbanner_gfx_url" => "Graphic URL 5",
    ));
    }

     ?>

Crontab:

Code:
*/15 * * * * /usr/bin/php /home/bannerbot/bannerwechsel.php >/dev/null 2>&1
 
Top