Forum


Notice to all users

We are migrating towards a new forum system located at community.teamspeak.com, as such this forum will become read-only on January 29, 2020

Page 1 of 2 12 LastLast
Results 1 to 15 of 25

Thread: Dynamic Banner

  1. #1
    Join Date
    March 2008
    Location
    United States
    Posts
    83

    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
    January 2009
    Location
    Denmark
    Posts
    76
    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
    January 2009
    Location
    Denmark
    Posts
    76

    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
    March 2008
    Location
    United States
    Posts
    83
    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
    January 2009
    Location
    Denmark
    Posts
    76
    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
    February 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
    December 2009
    Location
    Berlin
    Posts
    40
    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
    13
    hmmm why dont you just make an animated gif with the 3 pics?
    this should work without any problems...

  9. #9
    Join Date
    January 2010
    Location
    US
    Posts
    133
    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
    March 2008
    Location
    United States
    Posts
    83
    I'm at least happy to see that some people are finding this useful =D

  11. #11
    Join Date
    December 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
    September 2008
    Location
    Brazil
    Posts
    26
    Nice Job.

    Thanks!

  13. #13
    Join Date
    January 2010
    Location
    Russia
    Posts
    14

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

  15. #15
    Join Date
    January 2010
    Location
    Germany
    Posts
    2,029
    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. TeamSpeak 3 dynamic banner image
    By Sad_Metallist in forum Tools / Web Based
    Replies: 0
    Last Post: March 27th, 2011, 01:52 AM
  2. TeamSpeak 3 dynamic banner image
    By Sad_Metallist in forum General Questions
    Replies: 0
    Last Post: March 27th, 2011, 01:52 AM

Posting Permissions

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