• Rejestracja
vBHELP.pl - polskie wsparcie vBulletin

Widok wątkowy

  1. #4
    Awatar gonzek
    gonzek jest nieaktywny Advanced Member
    Dołączył
    Feb 2008
    Przegląda
    Szczecin, Poland
    Posty
    608
    Przydatne posty
    1

    Domyślnie

    google padło? :P

    http://www.webhelp.pl/forum/viewtopi...264&highlight=

    http://www.google.pl/search?hl=pl&q=...e&lr=&aq=f&oq=

    Stwórz plik PHP, który będzie identyfikował się jako obrazek (header). W nim wstaw kod losujący. W szablonie podmień link z oryginalnego loga do tego pliku.

    pzdr

    edit:
    ten kod powinien pomoc

    Kod php:
    <?php 


        $folder 
    '.'


        
    $extList = array(); 
        
    $extList['gif'] = 'image/gif'
        
    $extList['jpg'] = 'image/jpeg'
        
    $extList['jpeg'] = 'image/jpeg'
        
    $extList['png'] = 'image/png'


    $img null


    if (
    substr($folder,-1) != '/') { 
        
    $folder $folder.'/'



    if (isset(
    $_GET['img'])) { 
        
    $imageInfo pathinfo($_GET['img']); 
        if ( 
            isset( 
    $extListstrtolower$imageInfo['extension'] ) ] ) && 
            
    file_exists$folder.$imageInfo['basename'] ) 
    ) { 
        
    $img $folder.$imageInfo['basename']; 

    } else { 
        
    $fileList = array(); 
        
    $handle opendir($folder); 
        while ( 
    false !== ( $file readdir($handle) ) ) { 
            
    $file_info pathinfo($file); 
            if ( 
                isset( 
    $extListstrtolower$file_info['extension'] ) ] ) 
    ) { 
                
    $fileList[] = $file
            } 
        } 
        
    closedir($handle); 


        if (
    count($fileList) > 0) { 
            
    $imageNumber time() % count($fileList); 
            
    $img $folder.$fileList[$imageNumber]; 
        } 

    if (
    $img!=null) { 
        
    $imageInfo pathinfo($img); 
        
    $contentType 'Content-type: '.$extList$imageInfo['extension'] ]; 
        
    header ($contentType); 
        
    readfile($img); 
    } else { 
        if ( 
    function_exists('imagecreate') ) { 
            
    header ("Content-type: image/png"); 
            
    $im = @imagecreate (100100
                or die (
    "Cannot initialize new GD image stream"); 
            
    $background_color imagecolorallocate ($im255255255); 
            
    $text_color imagecolorallocate ($im0,0,0); 
            
    imagestring ($im255"IMAGE ERROR"$text_color); 
            
    imagepng ($im); 
            
    imagedestroy($im); 
        } 

    ?>
    w tym samym katalogu powinny byc pliki typu 1.jpg 2.jpg itd...
    Ostatnio edytowane przez gonzek ; 29.01.2009 o 00:33


Podobne wątki

  1. Zmiana loga
    By David in forum Pytania i problemy
    Odpowiedzi: 2
    Ostatni post / autor: 12.05.2010, 18:12
  2. Zmiana standardowego loga
    By krzychu in forum Pytania i problemy
    Odpowiedzi: 2
    Ostatni post / autor: 22.02.2010, 18:56
  3. Zmiana Loga
    By neopl in forum Pytania i problemy
    Odpowiedzi: 2
    Ostatni post / autor: 10.12.2009, 21:13
  4. Problem ze zmianą Loga
    By neopl in forum Pytania i problemy
    Odpowiedzi: 12
    Ostatni post / autor: 07.12.2009, 16:54
Chmurka.pl

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67