Results 1 to 15 of 21
Thread: Dynamic Banner
-
20-03-2010, 02:39 #1
-= TeamSpeak Lover =-
- Join Date
- Mar 2008
- Location
- United States
- Posts
- 80
Dynamic Banner
*NOTE*That I am aware of, no one has posted this, if so, I will remove this post.
*NOTE*Also, please be aware that I am not very good with instructions, so please ask any quesitons and I will assist with as much as I can!
Alright, so recently I decided to make some dynamic banners for my clan and so I am here to share the coding.
Save the following in a notepad as a ".php" file.
Here is what should happen if you have the coding and images correct.PHP Code:<?php
$sigImage = array("img1.jpg", "img2.jpg", "img3.jpg"); // Add/remove with the different filenames of you sig backgrounds
// RANDOMIZE BACKGROUND //
// Chooses a background from an array at random for the sig
$sigIndex = rand(0, count($sigImage)-1);
$sigImage = $sigImage[$sigIndex];
// The main image to put the stats over.
$imageExt = explode(".", $sigImage);
if(strtolower($imageExt[1]) == "jpg"){
$image = imagecreatefromjpeg($sigImage);
}elseif(strtolower($imageExt[1]) == "png"){
$image = imagecreatefrompng($sigImage);
}else{
die("Unsupported filetype!");
}
// WRITE OUT THE IMAGE //
header('Content-type: image/jpeg');
imagejpeg($image, NULL, 100);
imagedestroy($image);
?>
Refresh a few times to see the 3 different banners
1.) Must have file host (i.e. x10hosting.com)
2.) You must replace the "img#" with the wanted image.
3.) To get the banner to change in teamspeak, open the Virtual Server Editor, paste the link to the dynamic banner, and lastly change the Gfx timer to a minimum of 60 (this number determines how often it will change, this is counted by seconds).
-
23-03-2010, 23:01 #2
-= TeamSpeak Lover =-
- Join Date
- Jan 2009
- Location
- EU
- Posts
- 78
That looks real nice... I try it out, and see how it works...
I'll Let you know, if there are any problems...
Cheers
-
23-03-2010, 23:54 #3
-= TeamSpeak Lover =-
- Join Date
- Jan 2009
- Location
- EU
- Posts
- 78
1 Question.
Couldn't it be possibul just to add a IP instead?PHP Code:1.) Must have file host (i.e. x10hosting.com)
xx.xx.xx.xx:/Teamspeak Folder Name/Banner Foldername/banner.php
because what you wrote in the code, schould be able to function.
Very simpel and straight...
Cheers Matey...
-
25-03-2010, 01:57 #4
-= TeamSpeak Lover =-
- Join Date
- Mar 2008
- Location
- United States
- Posts
- 80
-
25-03-2010, 15:46 #5
-= TeamSpeak Lover =-
- Join Date
- Jan 2009
- Location
- EU
- Posts
- 78
Well I cant see the banner, but something is moved in the top of my TS, so in a way it does work...
But when I have it fully function, then I let you know.
and thx for the reply
cheers
-
29-03-2010, 21:43 #6
-= TeamSpeak User =-
- Join Date
- Feb 2010
- Location
- UK
- Posts
- 1
I have implemented this today, it resolved the problem I had when our clan spawned a training wing.
Works a treat, thanks very much.
Mac
-
02-05-2010, 16:30 #7
-= TeamSpeak Lover =-
- Join Date
- Dec 2009
- Location
- Berlin
- Posts
- 39
Works like a charm! I use PNG instead and relative paths (since pictures and php are hosted on same site).
Thanks for your work
-
07-05-2010, 14:44 #8
hmmm why dont you just make an animated gif with the 3 pics?
this should work without any problems...
-
07-05-2010, 19:11 #9
-= TeamSpeak Addict =-
- Join Date
- Jan 2010
- Location
- US
- Posts
- 135
heh, I hate when someone comes along and blows up perfectly good code with a perfectly good idea... =)
BUT, I can still see uses for this. It's easier to add/remove images mostly, than editing an animated GIF. You can also run different promotions and whatnot to display different banners based upon other criteria, etc.
So I think the simple solution of an animated GIF works, but there are many instances in which solutions such as this are necessary/desired as well.
-
08-05-2010, 09:10 #10
-= TeamSpeak Lover =-
- Join Date
- Mar 2008
- Location
- United States
- Posts
- 80
I'm at least happy to see that some people are finding this useful =D
-
09-05-2010, 00:07 #11
-= TeamSpeak User =-
- Join Date
- Dec 2009
- Location
- Sweden
- Posts
- 25
And if you want abanner using more colors than a gif supports, then this is the way
-
23-05-2010, 08:35 #12
-= TeamSpeak User =-
- Join Date
- Sep 2008
- Location
- Brazil
- Posts
- 27
Nice Job.
Thanks!
-
30-03-2011, 04:47 #13
-= TeamSpeak User =-
- Join Date
- Jan 2010
- Location
- Russia
- Posts
- 17
-
28-06-2012, 19:18 #14
-= TeamSpeak Addict =-
- Join Date
- Jun 2011
- Location
- Russian Federation
- Posts
- 208
guys, is it possible to alter the script as something that he supported formats gif
-
28-06-2012, 19:31 #15
-= TeamSpeak Fanatic =-
- Join Date
- Jan 2010
- Location
- Germany
- Posts
- 2,038
As long as PHP Supports Image Manipulation for the Filetype...
See imagecreatefromgif and imagegif
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Similar Threads
-
High CPU Usage for TS3 Client caused by TS3 SERVER's Banner Feature
By montagnesy in forum Server SupportReplies: 5Last Post: 15-02-2013, 01:51 -
Channel Banner
By yamato in forum WindowsReplies: 3Last Post: 01-07-2012, 13:43 -
Dynamic Banner
By webhostbudd in forum [TeamSpeak 2] Server SupportReplies: 1Last Post: 02-09-2008, 21:57 -
banner problem
By wisley in forum [TeamSpeak 2] Server SupportReplies: 9Last Post: 08-08-2006, 12:06 -
Banner in TS
By SoulTaker2002 in forum [TeamSpeak 2] Server SupportReplies: 45Last Post: 15-02-2006, 16:56


Reply With Quote

