Community Forums Today's Posts     Member List     Archive    
Page 1 of 2 12 LastLast
Results 1 to 15 of 21

Thread: Dynamic Banner

  1. #1
    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.
    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(0count($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($imageNULL100);
        
    imagedestroy($image);

    ?>
    Here is what should happen if you have the coding and images correct.
    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).

  2. #2
    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

  3. #3
    Join Date
    Jan 2009
    Location
    EU
    Posts
    78

    Smile

    1 Question.

    PHP Code:
    1.Must have file host (i.ex10hosting.com
    Couldn't it be possibul just to add a IP instead?

    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...

  4. #4
    Join Date
    Mar 2008
    Location
    United States
    Posts
    80
    Quote Originally Posted by Miscni View Post
    1 Question.

    PHP Code:
    1.Must have file host (i.ex10hosting.com
    Couldn't it be possibul just to add a IP instead?

    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...
    I believe this should work, but I have not been able to test it yet, but if it does work please do let me know

  5. #5
    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

  6. #6
    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

  7. #7
    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

  8. #8
    Join Date
    May 2010
    Location
    Austria
    Posts
    9
    hmmm why dont you just make an animated gif with the 3 pics?
    this should work without any problems...

  9. #9
    Join Date
    Jan 2010
    Location
    US
    Posts
    135
    Quote Originally Posted by Gagi2 View Post
    hmmm why dont you just make an animated gif with the 3 pics?
    this should work without any problems...
    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.

  10. #10
    Join Date
    Mar 2008
    Location
    United States
    Posts
    80
    I'm at least happy to see that some people are finding this useful =D

  11. #11
    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

  12. #12
    Join Date
    Sep 2008
    Location
    Brazil
    Posts
    27
    Nice Job.

    Thanks!

  13. #13
    Join Date
    Jan 2010
    Location
    Russia
    Posts
    17

  14. #14
    Join Date
    Jun 2011
    Location
    Russian Federation
    Posts
    208
    guys, is it possible to alter the script as something that he supported formats gif

  15. #15
    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

  1. Replies: 5
    Last Post: 15-02-2013, 01:51
  2. Channel Banner
    By yamato in forum Windows
    Replies: 3
    Last Post: 01-07-2012, 13:43
  3. Dynamic Banner
    By webhostbudd in forum [TeamSpeak 2] Server Support
    Replies: 1
    Last Post: 02-09-2008, 21:57
  4. banner problem
    By wisley in forum [TeamSpeak 2] Server Support
    Replies: 9
    Last Post: 08-08-2006, 12:06
  5. Banner in TS
    By SoulTaker2002 in forum [TeamSpeak 2] Server Support
    Replies: 45
    Last Post: 15-02-2006, 16:56

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •