Is there such a mod where the header pic could change with a different pic on a page refresh with Black Pearl? I have used something like that with Joomla and like it, but am not sure if it has to do more with PHPBB or the Black Pearl template.
Thanks,
schemer
p.s. To keep it simple for now, I have edited the Phoenix pic and changed it with a circular pic of my choosing but having it randomly pick from a group of pics in a folder on refresh would be cool. And even better with a square or rectangular option.
SOLVED Changing Header Pic Mod For Black Pearl?
Subject: Re: Changing Header Pic Mod For Black Pearl?
html for the header:
Save this as a file to YOUR-THEME/jscripts/switch.js
Add this to YOUR-THEME.css and put the images in YOUR-THEME/images/headers/image*.png - jpg - gif - And change the parameters to suit whatever your images are.
<div align="center">
<script type="text/javascript" src="{T_TPL_PATH}jscripts/switch.js"></script>
<noscript><div id="mainpic0"> </div></noscript>
</div>
<script type="text/javascript" src="{T_TPL_PATH}jscripts/switch.js"></script>
<noscript><div id="mainpic0"> </div></noscript>
</div>
Save this as a file to YOUR-THEME/jscripts/switch.js
<!--
images = new Array(4);
images[0] = "<div id='mainpic0'></div>";
images[1] = "<div id='mainpic1'></div>";
images[2] = "<div id='mainpic2'></div>";
images[3] = "<div id='mainpic3'></div>";
images[4] = "<div id='mainpic4'></div>";
index = Math.floor(Math.random() * images.length);
document.write(images[index]);
// -->
images = new Array(4);
images[0] = "<div id='mainpic0'></div>";
images[1] = "<div id='mainpic1'></div>";
images[2] = "<div id='mainpic2'></div>";
images[3] = "<div id='mainpic3'></div>";
images[4] = "<div id='mainpic4'></div>";
index = Math.floor(Math.random() * images.length);
document.write(images[index]);
// -->
Add this to YOUR-THEME.css and put the images in YOUR-THEME/images/headers/image*.png - jpg - gif - And change the parameters to suit whatever your images are.
/* Images for Header Array*/
#mainpic0 {
background-image:url(images/headers/image0.png);
width:853px;
height:200px;
}
#mainpic1 {
background-image:url(images/headers/image1.png);
width:853px;
height:200px;
}
#mainpic2 {
background-image:url(images/headers/image2.png);
width:853px;
height:200px;
}
#mainpic3 {
background-image:url(images/headers/image3.png);
width:853px;
height:200px;
}
#mainpic4 {
background-image:url(images/headers/image4.png);
width:853px;
height:200px;
}
#mainpic0 {
background-image:url(images/headers/image0.png);
width:853px;
height:200px;
}
#mainpic1 {
background-image:url(images/headers/image1.png);
width:853px;
height:200px;
}
#mainpic2 {
background-image:url(images/headers/image2.png);
width:853px;
height:200px;
}
#mainpic3 {
background-image:url(images/headers/image3.png);
width:853px;
height:200px;
}
#mainpic4 {
background-image:url(images/headers/image4.png);
width:853px;
height:200px;
}
Subject: Re: Changing Header Pic Mod For Black Pearl?
Hi.
The idea is brillant, mort, but wouldn't it be simplier to change document.getElementById('header').style.backgroundImage = ? or just something like that.
The idea is brillant, mort, but wouldn't it be simplier to change document.getElementById('header').style.backgroundImage = ? or just something like that.
Subject: Re: Changing Header Pic Mod For Black Pearl?
There are lots of scripts around so no matter which one chooses - there are always alternative ways of doing things. ;)
BTW: The script paths and vars above is for Icy Phoenix - so he/she is going to have to modify it anyway. :LOL:
BTW: The script paths and vars above is for Icy Phoenix - so he/she is going to have to modify it anyway. :LOL:
Subject: Re: Changing Header Pic Mod For Black Pearl?
Thanks a lot Mort. I will see if I can figure it out with my setup and go from there.
Cheers,
schemer
p.s. I tried for about half the day figuring this stuff out but I guess I need to learn the different paths and filenames to get a handle on this stuff. :( I did the js stuff and css stuff just fine but took a long time to figure out (probably incorrectly) that the file I needed to edit for the header was named "overall_header.html" but when I ran the mods I just ended up with no pics at all. :oops:
p.s. I tried this one below as it seemed really easy to implement and keep track of but it didn't work. Anybody know why it doesn't work?
http://www.phpbb.com/kb/article/adding-a-random-header-image/
p.s.s. I got this one at the link above working finally. Stupid mistakes like using caps for the .png extension will make you chase your tail. One other glitch and I had to hunt down some "{ }" brackets and remove them. All is good now. :mrgreen:
mort wrote: [View Post]
Thanks a lot Mort. I will see if I can figure it out with my setup and go from there.
Cheers,
schemer
p.s. I tried for about half the day figuring this stuff out but I guess I need to learn the different paths and filenames to get a handle on this stuff. :( I did the js stuff and css stuff just fine but took a long time to figure out (probably incorrectly) that the file I needed to edit for the header was named "overall_header.html" but when I ran the mods I just ended up with no pics at all. :oops:
p.s. I tried this one below as it seemed really easy to implement and keep track of but it didn't work. Anybody know why it doesn't work?
http://www.phpbb.com/kb/article/adding-a-random-header-image/
p.s.s. I got this one at the link above working finally. Stupid mistakes like using caps for the .png extension will make you chase your tail. One other glitch and I had to hunt down some "{ }" brackets and remove them. All is good now. :mrgreen:
Subject: Re: Changing Header Pic Mod For Black Pearl?
Amazing what one can find when one looks around! :LOL:
Subject: Re: Changing Header Pic Mod For Black Pearl?
Yep 8) I have done a few mods but they are usually on Joomla and seem a little more user friendly, or I am still scared to go too deep into PHPBB. :mryellow: I tripped on a simple mistake and although I figured it out pretty quick, it goes to show how easy it is to mess up. In the code:
<img src="{T_IMAGESET_PATH}/site-logo-{SITE_LOGO_RANDOM}.EXTENSION" alt="Logo" title="Logo" />
where you are supposed to change .EXTENSION to jpg, gif, png etc, it was just natural while in the editor to backspace the word EXTENSION, and replace it with capital letters for png. But I run on a Linux server and when adding pics etc on other sites I always have to rename all the pics as they come off the camera in caps. Of course this will never happen again as that is how lessons are learned. :wink:
Thanks,
schemer
<img src="{T_IMAGESET_PATH}/site-logo-{SITE_LOGO_RANDOM}.EXTENSION" alt="Logo" title="Logo" />
where you are supposed to change .EXTENSION to jpg, gif, png etc, it was just natural while in the editor to backspace the word EXTENSION, and replace it with capital letters for png. But I run on a Linux server and when adding pics etc on other sites I always have to rename all the pics as they come off the camera in caps. Of course this will never happen again as that is how lessons are learned. :wink:
Thanks,
schemer
Subject: Re: [SOLVED] Changing Header Pic Mod For Black Pearl?
I have created a script for a random avatar that could also be used for random logo...
Random Avatar Generator
Random Avatar Generator
Page 1 of 1
You cannot post new topicsYou cannot reply to topics
You cannot edit your posts
You cannot delete your posts
You cannot vote in polls
You cannot attach files
You can download files
You cannot post calendar events
This is a "Lo-Fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Powered by Icy Phoenix based on phpBB
Generation Time: 0.9629s (PHP: 2% SQL: 98%)
SQL queries: 17 - Debug Off - GZIP Enabled