Random Header Image

Main >> Content >> Tutorials >> phpBB Forums >> Random Header Image

A random header changes everytime you enter the forum. You can also use this tutorial if you only want to change the image. The header image is also known as the site logo.
Step 1: First you have to make your logo/images. Name it site-logo-NUMBER-HERE.extension (extension=jpg, png, gif etc.). Where it says number you have to write the number of the header. If you only got one just type 1. If you have more than one image remember that you have to save all of them in the same extension (ex: jpg).

Step 2: Start your text editing program, I use notepad. Open up the file called includes/functions.php. Scroll down to line 3539 where you'll see this text:
		'T_STYLESHEET_NAME'		=> $user->theme['theme_name'],


Step 3: Copy the code under and paste it right after the code over. Change the place where it says NUMBER-OF-IMAGES to the number you got. If yu got one it should look like this: mt_rand(1, 1)
        'SITE_LOGO_RANDOM'      => mt_rand(1, NUMBER-OF-IMAGES),


Step 4: We still have to use the editing program. Now you have to open styles/your style name/template/overall_header.html. Scroll down to line 108 where you'll see this line:
<a href="{U_INDEX}" title="{L_INDEX}" id="logo">{SITE_LOGO_IMG}</a>


Step 5: Replace the {SITE_LOGO_IMG} with the code under. Remember to change the .EXTENSION with the extention of your images (ex: jpg).
<img src="{T_IMAGESET_PATH}/site-logo-{SITE_LOGO_RANDOM}.EXTENSION" alt="Logo" title="Logo" />

Step 6: The only thing left now it to upload your images. Use your FTP program and upload all the images to this folder styles/your style name here/imageset directory.

Step 7: If your new header images doesn't show when you refresh your forum, you have to log on to your ACP. Then go to Styles >> Templates. Find the template you are using and click refresh right next to it. Now your new header should show. Good luck.