https://www.icyphoenix.com/viewtopic.php?f=32&t=7980 ----------------------------------- schemer Thu 04 Aug, 2011 23:02 Changing Header Pic Mod For Black Pearl? ----------------------------------- 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. ----------------------------------- mort Fri 05 Aug, 2011 00:01 Re: Changing Header Pic Mod For Black Pearl? ----------------------------------- [b]html[/b] for the header: [code linenumbers=false]
[/code] Save this as a file to YOUR-THEME/jscripts/[b]switch.js[/b] [code linenumbers=false] [/code] Add this to YOUR-THEME.css and put the images in [b]YOUR-THEME/images/headers/image*[/b].png - jpg - gif - And change the parameters to suit whatever your images are. [code linenumbers=false]/* 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; } [/code] ----------------------------------- Informpro Fri 05 Aug, 2011 00:20 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. ----------------------------------- mort Fri 05 Aug, 2011 06:59 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: ----------------------------------- schemer Fri 05 Aug, 2011 15:04 Re: Changing Header Pic Mod For Black Pearl? ----------------------------------- [quote user="mort" post="53353"]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:[/quote] 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 Sat 06 Aug, 2011 03:06 Re: Changing Header Pic Mod For Black Pearl? ----------------------------------- Amazing what one can find when one looks around! :lol: ----------------------------------- schemer Sat 06 Aug, 2011 15:00 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: [code linenumbers=false] Logo [/code] 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 ----------------------------------- Mighty Gorgon Wed 24 Aug, 2011 22:11 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... [url=http://www.icyphoenix.com/viewtopic.php?f=33&t=7168]Random Avatar Generator