Pain
Member
- Feb 20, 2016
- 102
- 17
- 53
Still not workingphp-gd installed?
You only have to start ./run start
Code:
<?php
set_time_limit(0);
date_default_timezone_set("Europe/Warsaw");
header('Content-Type: image/png');
$config = array (
'VIP' => '40',
'S-VIP' => '39',
'CEO' => '9',
'ROOT' => '10',
'SSA' => '13'
);
//GETTING CACHE
$cache = file_get_contents('cache.ss');
$cache = json_decode($cache, true);
$clients = $cache['clients'];
$serverGroups = $cache['groups'];
$online = $cache['server']['virtualserver_clientsonline'] - $cache['server']['virtualserver_queryclientsonline'];
$channelcounter = $cache['server']['virtualserver_channelsonline'];
$clientconnections = $cache['server']['virtualserver_client_connections'];
$slots = $cache['server']['virtualserver_maxclients'];
$secs = $cache['server']['virtualserver_uptime'];
$now = date_create('now', new DateTimeZone('GMT'));
$here = clone $now;
$here->modify($secs.' seconds');
$diff = $now->diff($here);
$uptime = $diff->format('%a D %h H %i M %s S');
///////ADMINS COUNTER
//CEOs counter
$client = $cache['clients'];
$CEOs = 0;
foreach($client as $target) {
$sgtarget = explode(',', $target['client_servergroups']);
if(in_array($config['CEO'], $sgtarget)) { $CEOs++; }
}
//ROOTs counter
$client = $cache['clients'];
$ROOTs = 0;
foreach($client as $target) {
$sgtarget = explode(',', $target['client_servergroups']);
if(in_array($config['ROOT'], $sgtarget)) { $ROOTs++; }
}
//SSAs counter
$client = $cache['clients'];
$SSAs = 0;
foreach($client as $target) {
$sgtarget = explode(',', $target['client_servergroups']);
if(in_array($config['SSA'], $sgtarget)) { $SSAs++; }
}
///////SPECIAL GROUPS COUNTER
$client = $cache['clients'];
$VIPs = 0;
foreach($client as $target) {
$sgtarget = explode(',', $target['client_servergroups']);
if(in_array($config['VIP'], $sgtarget)) { $VIPs++; }
}
$client = $cache['clients'];
$SVIPs = 0;
foreach($client as $target) {
$sgtarget = explode(',', $target['client_servergroups']);
if(in_array($config['S-VIP'], $sgtarget)) { $SVIPs++; }
}
//BANNER GENERATING
$time = date("H:i");
$date = date("d.m.y");
$fbebas = 'resources/fonts/bebas.ttf';
$img = imagecreatefrompng("resources/img/bg.png");
$adminscounter = $CEOs + $ROOTs + $SSAs;
$vipscounter = $VIPs + $SVIPs;
$color = array(
'white' => imagecolorallocate($img, 255, 255, 255),
'green' => imagecolorallocate($img, 0, 255, 0),
'red' => imagecolorallocate($img, 255, 0, 0)
);
imagettftext($img, 70, 0, 530, 380, $color['white'], $fbebas, $time. ' | ' .$date);
imagettftext($img, 40, 0, 480, 620, $color['white'], $fbebas, 'Random news about server');
imagettftext($img, 50, 0, 90, 295, $color['white'], $fbebas, $online. '/' .$slots);
imagettftext($img, 50, 0, 1380, 285, $color['white'], $fbebas, $channelcounter);
imagettftext($img, 45, 0, 430, 870, $color['white'], $fbebas, 'Server uptime:' .$uptime);
if($socket = @fsockopen('localhost', 10011, $errno, $errstr, 2)) {
imagettftext($img, 50, 0, 80, 690, $color['green'], $fbebas, Online);
}
else {
imagettftext($img, 50, 0, 80, 690, $color['red'], $fbebas, Offline);
}
imagettftext($img, 50, 0, 125, 495, $color['white'], $fbebas, $clientconnections);
imagettftext($img, 50, 0, 1400, 495, $color['white'], $fbebas, $adminscounter);
imagettftext($img, 50, 0, 1400, 690, $color['white'], $fbebas, $vipscounter);
imagepng($img, '/var/www/banner.png');
imagedestroy($img);
?>
how can I solve this problem please help me
teamspeak 3: -IP REMOVED-
Edited BY MOD QRAKTZYL
Please do not post your ip here. If you want to invite people for help, join the r4p3 forums.
Last edited by a moderator: