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 2 of 2 FirstFirst 12
Results 16 to 25 of 25

Thread: Dynamic Banner

  1. #16
    Join Date
    June 2011
    Location
    Russian Federation
    Posts
    204
    Unfortunately I did not understand this ...

  2. #17
    Join Date
    June 2011
    Location
    Russian Federation
    Posts
    204
    please help if you know how) I can see much to ask, just know that by this forum you have your personal life and time, well, if the possibility exists there, then they help to make this script as a gif

  3. #18
    Join Date
    June 2012
    Location
    Portugal
    Posts
    317
    I grabbed your code and modified a little. You can put files in any dir and picks .jpg and .png and the rest does the same as your code.

    External URLs can be used instead of /images/ as long your host has allow_url_fopen allowed.

    PHP Code:
    <?php
    // URL or directory including the last slash ( / )

        
    $img_dir 'images/';

    //dont edit below this point

        
    $images = array();

        
    // find all images in dir //
        
        
    $files scandir($img_dir);
        
        foreach(
    $files as $f) {
            
    $extension end(explode('.',$f));
            if(
    $extension == 'jpg') {
                
    $images[] = $f;
            }
            elseif(
    $extension == 'png') {
                
    $images[] = $f;
            }
        }    
        
        
    $random array_rand($images);
        
    $chosen $images[$random];
        
        if(
    end(explode('.',$chosen)) == 'jpg') {
            
    $image imagecreatefromjpeg($img_dir.$chosen);
        }
        elseif(
    end(explode('.',$chosen)) == 'png') {
            
    $image imagecreatefrompng($img_dir.$chosen);
        }

        
    // WRITE OUT THE IMAGE //
        
    header('Content-type: image/jpeg');
        
    imagejpeg($imageNULL100);
        
    imagedestroy($image);

    ?>
    Last edited by barricas; July 12th, 2012 at 01:29 AM.

  4. #19
    Join Date
    June 2011
    Location
    Russian Federation
    Posts
    204
    Thanks of course, but do not understand the meaning of your actions, if this is the same ... You could not have done the same way only with gif formats

  5. #20
    Join Date
    June 2008
    Posts
    18,513
    Quote Originally Posted by Ar2rJke View Post
    Thanks of course, but do not understand the meaning of your actions, if this is the same ... You could not have done the same way only with gif formats
    And how should such a gif show the current amount of users on as server or the current time as an example?
    This needs to be done with an image file, that reloads every x seconds and this can be sdone with sucha script only.
    When sending me private messages: Please make sure to include reference link to your forum thread or post.

    TeamSpeak FAQ || What should i report, when i open a client thread?

  6. #21
    Join Date
    June 2012
    Location
    Portugal
    Posts
    317
    As dante said, it is possible with a script to check the info then putting it in an image.
    Btw if support for more images is needed just add more elseif's, or tell me I can add more.
    I just improved the fact you don't need to list everyimage in the file, just put in a dir and it gets all for you. Just makes it simplier.

    I tested it and it works wonders.... downloaded a bunch of game banners to a dir and it gets them all.

  7. #22
    Join Date
    June 2014
    Posts
    13

    Dynamic Server Banner ?

    Name:  pngpng.png
Views: 943
Size:  2.9 KB

    How can i do something like
    Last edited by dante696; January 28th, 2015 at 08:41 AM. Reason: merged , we have a search feature in our forum!

  8. #23
    Join Date
    August 2013
    Location
    Germany
    Posts
    541
    So if you want to show something like the date or time or the online users u'll need the script above with addition of a sockopen() for a query telnet connection or use the simple rest API by ScP.

    Note that for a query connection you need the query ip / port and the permissions to use it and to use the API the server must be on the serverlist for at least half an hour.


    If no one is going to provide such a simple php script, then i will post an example for booth query and API later here.

  9. #24
    Join Date
    June 2013
    Location
    TeamSpeak Community Forums
    Posts
    108
    Did anyone actually figure out a way to do this, as I would be interested in doing it as well :P

  10. #25
    Join Date
    October 2015
    Posts
    3
    Hello,

    Sorry for bumping an old thread but, I wanted to do this on my TeamSpeak server and was wondering if TeamSpeak wont allow it anymore? I have the script working fine (the modified version that barricas made). it displays the image as if I was browsing directly to it. but TeamSpeak just wont show it, just curious if someone still has this working and can help me? Server version is 3.0.11.4 and my client is 3.0.18.1

    Thanks

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, 03:52 AM
  2. TeamSpeak 3 dynamic banner image
    By Sad_Metallist in forum General Questions
    Replies: 0
    Last Post: March 27th, 2011, 03: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
  •