Skocz do zawartości
  • 👋 Witaj na MPCForum!

    Przeglądasz forum jako gość, co oznacza, że wiele świetnych funkcji jest jeszcze przed Tobą! 😎

    • Pełny dostęp do działów i ukrytych treści
    • Możliwość pisania i odpowiadania w tematach
    • System prywatnych wiadomości
    • Zbieranie reputacji i rozwijanie swojego profilu
    • Członkostwo w jednej z największych społeczności graczy

    👉 Dołączenie zajmie Ci mniej niż minutę – a zyskasz znacznie więcej!

    Zarejestruj się teraz

Problem z EvoBanner


Rekomendowane odpowiedzi

Opublikowano

Witam, otóż posiadam problem z evobannerem

https://scr.hu/NLXnmR inni też tak samo widzą jak na tym screenie, za duże to i dół się nie mieści nie wiem w której częśći kodu mogę zmienić

 

<?php

/**
 *   File name            : banner.php                     
 *   Created              : 27.11.2015
 *   Copyright            : (C) 2015 gWoycer & EvoSpeak.PL
 *   Email                : [email protected]
 *   Last modified        : 28.11.2015
 *   Contact TS3 IP       : (EvoSpeak.PL) or (TSRV.PL)
 *   ZAKAZ USUWANIA INFORMACJI O AUTORZE Z PLIKÓW
*/

    include 'config.php';
    include_once 'src/ts3admin.php';

    $ip = getenv('HTTP_CLIENT_IP')?:
    getenv('HTTP_X_FORWARDED_FOR')?:
    getenv('HTTP_X_FORWARDED')?:
    getenv('HTTP_FORWARDED_FOR')?:
    getenv('HTTP_FORWARDED')?:
    getenv('REMOTE_ADDR');
    $cache = '';

    //WPISYWANIE DANYCH W PLIK
    if (!file_exists('src/info.tmp') || filemtime('src/info.tmp') + 1 * 30 < time()) {
        $ts = new ts3admin($c['ts3']['host'], $c['ts3']['query_port'], 2);
        $ts->connect();
        $ts->login($c['ts3']['login'], $c['ts3']['password']);
        $ts->setName($c['ts3']['name']);
        $ts->selectServer($c['ts3']['login_port']);

        
        $cache = [];
        $cache['server'] = $ts->getElement('data', $ts->serverInfo());
        $cache['groups'] = $ts->getElement('data', $ts->serverGroupList());
        $cache['clients'] = $ts->getElement('data', $ts->clientList('-ip -groups'));
        @file_put_contents('src/info.tmp', json_encode($cache));
    } else {
        $cache = file_get_contents('src/info.tmp');
        $cache = json_decode($cache, true);
    }

    //DANE Z SERWERA
    $count = $cache['server']['virtualserver_clientsonline'] - $cache['server']['virtualserver_queryclientsonline'];
    $chan = $cache['server']['virtualserver_channelsonline'];
    $cone = $cache['server']['virtualserver_client_connections'];

    //POBIERANIE INFO O UZYTKOWNIKU
    foreach($cache['clients'] as $client) {
        if($client[connection_client_ip] == $ip){
            $uname = $client['client_nickname'];
            $udbi = $client['clid'];
            $groups = $client['client_servergroups'];
        }
    }

    //TWORZENIE BANNERU
    putenv('GDFONTPATH=' . realpath('.'));
    $sigImage = $c['ts3']['banner']['bg_imgs'];
        $sigIndex = rand(0, count($sigImage)-1);
        $sigImage = $sigImage[$sigIndex];
        $imageExt = explode(".", $sigImage);
        if(strtolower($imageExt[1]) == "jpg"){
               $image   = imagecreatefromjpeg($sigImage);
        } elseif (strtolower($imageExt[1]) == "png"){
               $image   = imagecreatefrompng($sigImage);
        } else {
               die("Niewlasciwy typ pliku...");
        }

    imagealphablending($image, true);
    $font = 'fonts/rex.ttf';
    $fontn = 'fonts/arial2.ttf';
    $bn = imagecreatefrompng($c['ts3']['banner']['static_img']);
    $ww = imagesx($bn);
    $wh = imagesy($bn);
    imagecopy($image, $bn, 0, 0, 0, 0, $ww, $wh);
    $white = imagecolorallocate($image, 255, 255, 255);
    $purple = imagecolorallocate($image, 7, 9, 40);

        

    if ($groups == $c['ts3']['banner']['guest_group']) {
        $sigtx = $c['ts3']['banner']['no_reg_info'];
        $sigix = rand(0, count($sigtx)-1);
        $sigtx = str_replace('%uname%',$uname,$sigtx[$sigix]);
        imagettftext($image, 22, 0, 59, 37, $white, $font,  $sigtx);
    } else {
        $sigt = $c['ts3']['banner']['reg_info'];
        $sigi = rand(0, count($sigt)-1);
        $sigt = str_replace('%uname%',$uname,$sigt[$sigi]);
        imagettftext($image, 22, 0, 59, 37, $white, $font,  $sigt);        
    }


    if ($count < 10) {
        imagettftext($image, 50, 0, 258, 495, $purple , $fontn ,  $count );
    } elseif ($count < 100 ) {
        imagettftext($image, 50, 0, 246, 495, $purple , $fontn ,  $count );
    } else {
        imagettftext($image, 50, 0, 207, 495, $purple , $fontn ,  $count );
    }
    imagettftext($image, 45, 0, 648, 525, $purple , $fontn ,  $cone );
    imagettftext($image, 50, 0, 1088, 495, $purple , $fontn ,  $chan );


    header('Content-type: image/jpeg');
    imagejpeg($image, NULL, 100);
    imagedestroy($image);
    imagedestroy($bn);
?>
Opublikowano

Myślę że to zależy od rozdzielczości Twojego okna TeamSpeak3.

Zarchiwizowany

Ten temat przebywa obecnie w archiwum. Dodawanie nowych odpowiedzi zostało zablokowane.

×
×
  • Dodaj nową pozycję...