Community Forums Today's Posts     Member List     Archive    
Page 2 of 2 FirstFirst 12
Results 16 to 21 of 21

Thread: Dynamic Banner

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

  2. #17
    Join Date
    Jun 2011
    Location
    Russian Federation
    Posts
    208
    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
    Jun 2012
    Location
    Portugal
    Posts
    145
    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; 12-07-2012 at 00:29.

  4. #19
    Join Date
    Jun 2011
    Location
    Russian Federation
    Posts
    208
    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
    Jun 2008
    Posts
    7,762
    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.
    ---------------------------------------------------------
    Please don't send me private support questions.
    They belong into the forum and maybe other users have these questions/problems too.

    TeamSpeak FAQ || What should i report, when i open a client thread? || Report and upload your Crashdump here
    NPL License (Registration)

  6. #21
    Join Date
    Jun 2012
    Location
    Portugal
    Posts
    145
    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.

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
  •