Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- header('Content-type: image/png');
- require_once('libraries/TeamSpeak3/TeamSpeak3.php');
- require_once('config.php');
- $failure = false;
- if($_SERVER['REMOTE_ADDR'] == "31.19.106.65" && date("G",time()) >= 11 && date("G",time()) < 18){
- array_push($config['gruss'],"Guten Morgen");
- }
- $grussformel = utf8_encode($config['gruss'][mt_rand(0,count($config['gruss'])-1)]);
- $file = "user.txt";
- $userlist = file($file);
- for($i=0;$i < count($userlist); $i++){
- if(!empty($userlist[$i])){
- $userparts = explode("=43a242skds4ad0lf23ad3g0rg02853sd#fdr0bert0bl4nc0si74uaf65ds>",$userlist[$i]);
- if(!(empty($userparts[0]) || empty($userparts[1]))){
- $user[$userparts[0]] = $userparts[1];
- }
- }
- }
- if (array_key_exists($_SERVER['REMOTE_ADDR'],$user)){
- $grussformel = $grussformel." ".$user[$_SERVER['REMOTE_ADDR']];
- } else {
- $client = [];
- $clients = [];
- try {
- $ts3 = TeamSpeak3::factory(
- "serverquery://". $config['loginname'] .":". $config['loginpass']
- ."@". $config['ip'] .":". $config['queryport']
- ."/?server_port=". $config['serverport'];)
- $client = $ts3->clientList();
- } catch (Exception $e) {
- $failure = true;
- }
- foreach($client as $x){
- $clients[htmlentities($x->connection_client_ip)] = htmlentities($x->client_nickname);
- }
- foreach($clients as $x => $y){
- $user[$x] = $y;
- }
- if (array_key_exists($_SERVER['REMOTE_ADDR'],$clients) && !$failure){
- $grussformel = $grussformel." ".$clients[$_SERVER['REMOTE_ADDR']];
- } else {
- $grussformel = "";
- }
- $textfilestr = "";
- foreach($user as $x => $y){
- if(!(empty($x) || empty($y))){
- $textfilestr .= $x."=43a242skds4ad0lf23ad3g0rg02853sd#fdr0bert0bl4nc0si74uaf65ds>".$y."\n";
- }
- }
- file_put_contents($file, $textfilestr);
- }
- $grussformel = mb_convert_encoding($grussformel, 'HTML-ENTITIES',"UTF-8");
- $grussformel = html_entity_decode($grussformel, ENT_NOQUOTES, "ISO-8859-1");
- $total = (intval(date("G",time())) * 3600) + (intval(date("i",time())) * 60) + intval(date("s",time()));
- $hour = floor($total / 10000);
- $min = floor($total % 10000 / 100);
- $text = "WELTENTE";
- $datum = date("d.m.Y",time());
- $uhr = date("H:i",time()+60)." MEZ | ".sprintf("%02d", $hour).":".sprintf ("%02d", $min)." ENT";
- $bild = imagecreatefrompng('images/weltente_banner_background_white.png');
- $text_color = ImageColorAllocate ($bild, 197, 32, 51);
- $font = 'fonts/open-sans.ttf';
- imagettftext($bild, 25, 0, 1100, 55, $text_color, $font, $datum);
- imagettftext($bild, 100, 0, 435, 190, $text_color, $font, $text);
- $bbox = imagettfbbox(25, 0, $font, $uhr);
- $center = (imagesx($bild) / 2) - (($bbox[2] + 75 - $bbox[0]) / 2) ;
- imagettftext($bild, 50, 0, $center, 280, $text_color, $font, $uhr);
- $bbox = imagettfbbox(25, 0, $font, $grussformel);
- $center = (imagesx($bild) / 2) - (($bbox[2] - 250 - $bbox[0]) / 2) ;
- imagettftext($bild, 25, 0, $center, 350, $text_color, $font, $grussformel);
- imagepng ($bild);
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement