Creating a banner with Time and Date which updates every 60 secs. HALP!

iAndrewGG

Member
Mar 9, 2016
34
4
40
Hello guys,
I've tried writing myself a php script to do it but seems like it doesn't really want to work...
Just wondering if anyone else have done it before and could share it with me? I've searched already (on our forums + another places) and i couldn't really find it.

Regards, Andrew
 

Qraktzyl

Retired Staff
Contributor
Nov 2, 2015
997
723
161
I've seen a couple of those on the forums here, you might retry to search for it lol!
I know @Multivit4min had one, I'm still using his version but I really wondered what happened with it. It looks like he removed the download from his website.
 

Multivit4min

Member
Sep 2, 2015
27
49
53
The links are up again on my site multivitamin.wtf, but currently my page has no real content,
I maybe get some CMS later when I have some money + time left so I dont need to create the Page by myself ;)
 

dedmen

TeamSpeak Developer
Contributor
Mar 28, 2016
530
583
157
There you go. This needs "php5-imagick" installed. just put call this from a php script and then just use the link to the site as the image in teamspeak. I use that on mine to display something like a news report.
This is a raw copy out of my code so dont complain about uglyness ^^
PHP:
function makeImageF($text, $W=800, $fsize=13,$bgr=1,$bgb=1,$bgg=1,$bga=127){
      $H = substr_count ($text,"\n") * 20;
       //$H = 50;
       
    $im = imagecreatetruecolor($W, $H);
       imagesavealpha($im, true);
    $background_color = imagecolorallocatealpha ($im, $bgr,$bgb,$bgg,$bga);        //RGB color background.
    imagefill ($im,0,0,$background_color);
       $text_color = imagecolorallocate($im, 0, 0, 0);
       
       $i = 0;
       putenv('GDFONTPATH=' . realpath('.'));
       foreach (explode("\n" , $text) as $value){
           imagettftext ($im , $fsize ,0, 0 , ($i * 16)+16, $text_color, dirname(__FILE__) . '/cour.ttf',$value);
           //array imagettftext ( resource $im , int $size , int $angle , int $x , int $y , int $col , string $fontfile , string $text )
           // imagestring($im, 1, 0, $i * 20, $value,$text_color);
           $i+=1;
       }
    header('Content-type: image/png');//jpeg
    imagepng($im);
    imagedestroy($im);
    return;
}
 
Top