PHP Classes

TeamSpeak PHP Banner: Manage users accessing a TeamSpeak server

Recommend this page to a friend!
     
  Info   Example   View files Files   Install with Composer Install with Composer   Download Download   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
Not yet rated by the usersTotal: 25 All time: 11,210 This week: 71Up
Version License PHP version Categories
tsbanner 1.0Custom (specified...5Networking, PHP 5
Description 

Author

This package can get data about users accessing a TeamSpeak server.

It can connect to a TeamSpeak server and send commands to get information about the users connected to it.

Currently, the class can send several types of commands to the TeamSpeak server:

- Add a ban to a user or a client IP address

- Delete one or all ban

- Get the current list of bans

- Get the list of clients' IP addresses

- Create a channel

- Add or delete permissions to access a channel

- Get a channel permission list

- Find channels

- Create channel groups

- Add permission to channel groups

- Get the list of channel groups

- Create a channel group copy

- Delete a channel group

- Delete channel group permission

- Get the list of channel groups

- Get the list of channel group permissions

- Rename a channel group

- Get the information about a channel

- Get the list of channels

- Move a channel to another parent channel

- Get the channel permission list

- Add permissions for a client

- Get a client avatar image

- List, get information, find, edit, delete permissions or delete a client in the database

- Find, and edit a client information

- Get the identifier of one or all clients

- Etc..

In german:

Ein simples PHP Script welche einen Teamspeak³ Banner generiert.

Picture of Kevin Härtling
  Performance   Level  
Name: Kevin Härtling <contact>
Classes: 1 package by
Country: Germany Germany
Age: ???
All time rank: 4524239 in Germany Germany
Week rank: 178 Up12 in Germany Germany Up

Example

<?php
//-> Copyright © 2016 by Canna
//-> 4.3.2017 Changes by Lars "elyday" <me@elyday.net>
//-> Version: 0.9.7

include('lib/ts3admin.class.php');
include(
'config.inc.php');
header('Content-Type:image/png');
date_default_timezone_set('Europe/Berlin');;

$date = date('d.F Y');
$time = date('H:i') . " Uhr";
$slots = 0;
$maxSlots = 0;

function
tsconnect()
{
    global
$ts3config;
   
$ts3 = new ts3admin($ts3config['ts3host'], $ts3config['ts3qport']);
   
$connecting = $ts3->connect();
    if (
$connecting['success']) {
       
$select = $ts3->selectServer($ts3config['ts3port'], true);
        if (
$select['success']) {
            if (
$ts3config['ts3user'] != "" && $ts3config['ts3pass']) {
               
$logging = $ts3->login($ts3config['ts3user'], $ts3config['ts3pass']);
                if (
$logging)
                    return
$ts3;
                else
                    return
'<p>Die Login Daten funktionieren nicht!</p>';
            } else
                return
'<p> Fehler in der config.inc.php. Bitte überprüfe diese und stelle sicher, dass alle Daten vorhanden sind!</p>';
        } else
            return
'<p>Der TS3 Port ist fehlerhaft!</p>';
    } else
        return
'<p>Es ist ein unerwarteter Fehler aufgetreten. </p>';
}

$ts3 = tsconnect();
$sinfo = $ts3->serverInfo();
if (
$sinfo['success']) {
   
$sinfo = $sinfo['data'];
   
$slots = $sinfo['virtualserver_clientsonline'] - $sinfo['virtualserver_queryclientsonline'];
   
$maxSlots = $sinfo['virtualserver_maxclients'];
   
$query = $sinfo['virtualserver_queryclientsonline'] - 1;
   
$text = $time . " | " . $date . " | User: " . $slots . "(+" . $query . ") / " . $maxSlots;
   
$textTime = $time;
   
$textDate = $date;
   
$textClients = $slots . "/" . $maxSlots;
   
$image = imagecreatefrompng('img/cannadesign_tsbanner.png');
   
$textColor = imagecolorallocate($image, 79, 95, 5);
   
//imagestring($image, 5, 10, 5, $text, $textColor);
    //imagettftext($image, 18, 0, 5, 225, $textColor, "fonts/Exo-Medium.ttf", $text);
   
imagettftext($image, 20, 0, 60, 200, $textColor, "fonts/Exo-Medium.ttf", $textTime);
   
imagettftext($image, 20, 0, 60, 240, $textColor, "fonts/Exo-Medium.ttf", $textDate);
   
imagettftext($image, 20, 0, 60, 280, $textColor, "fonts/Exo-Medium.ttf", $textClients);
   
imagejpeg($image);
} else {
    echo
$ts3;
}
?>


Details

Einführung

Dieses Script verwendet die ts3admin.class.php . Es erstellt eine Grafik mit der aktuellen Uhrzeit, dem Datum und der Anzahl der verbundenen Clients.

Installation

  1. config.inc.php mit euren Daten anpassen (TS³ serverquery wird benötigt)
  2. Dateien auf eueren Webspace hochladen
  3. Das Script unter der URL www.euredomain.de/banner.png (.php) aufrufen
  4. Im TS³ euren virtuellen Server editieren
  5. Unter "Banner Gfx URL" den Link zu dem PHP Script auf eurem Webspace einfügen
  6. Viel Spass. :)

Features

  • Kinderleichte Anpassung durch den kurzen und verständlichen Code
  • Einfach die Grafik ändern und vorhandene Texte ersetzen, hinzufügen oder ändern
  • Einfügen von verschiedenen Fonts möglich
  • Weitere Updates folgen..

  Files folder image Files (7)  
File Role Description
Files folder imageimg (2 files)
Files folder imagelib (1 file)
Accessible without login Plain text file banner.php Example Example script
Accessible without login Plain text file config.inc.php Conf. Configuration script
Accessible without login Plain text file LICENSE Lic. License text
Accessible without login Plain text file README.md Doc. Documentation

  Files folder image Files (7)  /  img  
File Role Description
  Accessible without login Image file Banner.jpg Data Auxiliary data
  Accessible without login Image file cannadesign_tsbanner.png Data Auxiliary data

  Files folder image Files (7)  /  lib  
File Role Description
  Plain text file ts3admin.class.php Class Class source

The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page.
Install with Composer Install with Composer
 Version Control Unique User Downloads Download Rankings  
 100%
Total:25
This week:0
All time:11,210
This week:71Up