Random Header im PHPBB3 Forum ausschalten

Alles zu Styles, Templates, Icons und Smilies für phpBB 3.0.x, sowie allgemeine Designfragen zur Integration von phpBB in bestehende Websites.
phpBB Styles Demo
Forumsregeln
Bei Style spezifischen Fragen ist der Stylename und die Downloadquelle des Styles erforderlich, besser noch die URL vom betroffenen Forum.
Antworten
el-1
Mitglied
Beiträge: 1
Registriert: 08.05.2008 15:32

Random Header im PHPBB3 Forum ausschalten

Beitrag von el-1 »

Hallo zusammen
Ich habe in einem neuen Design für das PHPBB3-Forum einen Random-Header. Diesen möchte ich aber "deaktivieren", sodass nur noch 1 Bild als Header angezeigt wird.

Aufbau des Randoms:
10 Header-Bilder ([1-10].jpg)
1 Random-PHP-Script (random.php) --> Unten aufgeführt

Was muss ich jetzt z.B. in der random.php ändern, dass immer nur das Bild header.jpg angezeigt wird?

Vielen Dank für eure Antworten
Gruss el-1

random.php

Code: Alles auswählen

  <?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( $extList[ strtolower( $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( $extList[ strtolower( $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 (100, 100) 
            or die ("Cannot initialize new GD image stream"); 
        $background_color = imagecolorallocate ($im, 255, 255, 255); 
        $text_color = imagecolorallocate ($im, 0,0,0); 
        imagestring ($im, 2, 5, 5, "IMAGE ERROR", $text_color); 
        imagepng ($im); 
        imagedestroy($im); 
    } 
} 
?> 
Antworten

Zurück zu „[3.0.x] Styles, Templates und Grafiken“