10. How to add random header image?
Create a new directory calledheaders/
in thestyles/we_universal/theme/
location. You should put all header images in the new directory. Now openincludes/functions.php
and find these existing lines:
Before those existing lines, add these additional lines:Code: Select all
// The following assigns all _common_ variables that may be used at any point in a template. $template->assign_vars(array(
Now also find this existing line:Code: Select all
// Path to directory with header images (must contain trailing slash) $inventea_images_path = "styles/" . rawurlencode($user->style['style_path']) . '/theme/headers/'; // Get list of images in directory $inventea_images_list = array_diff(scandir( $phpbb_root_path . $inventea_images_path), array('.', '..')); if (!empty($inventea_images_list)) { // Get random image name $inventea_random_image = $inventea_images_list[array_rand($inventea_images_list)]; }
After this existing line, add the following additional line:Code: Select all
'SITE_LOGO_IMG' => $user->img('site_logo'),
Next openCode: Select all
'INVENTIA_RANDOM_IMAGE' => (isset($inventea_random_image)) ? $web_path . $inventea_images_path . $inventea_random_image : '',
styles/we_universal/template/overall_header.html
and find:
Replace with:Code: Select all
<div class="inventea-dashboard">
That's it! Don't forget to upload images.Code: Select all
<div class="inventea-dashboard" style="background-image: url({INVENTIA_RANDOM_IMAGE});">
Random header image on we_universal - we_universal
Random header image on we_universal
- EA117
- Registered User
- Posts: 1970
- Joined: Wed Aug 15, 2018 3:23 am
- Contact: