Icy Phoenix

     
 


Post new topic  Reply to topic 
Page 1 of 1
 
 
Reply with quote Download Post 
Post 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.
 



 
schemerSend private message  
Back to topPage bottom
Icy Phoenix is an open source project, you can show your appreciation and support future development by donating to the project.

Support us
 
Reply with quote Download Post 
Post Re: Changing Header Pic Mod For Black Pearl? 
 
html for the header:

Code: [Download] [Hide] [Select]
<div align="center">
<script type="text/javascript" src="{T_TPL_PATH}jscripts/switch.js"></script>
<noscript><div id="mainpic0">&nbsp;</div></noscript>
</div>



Save this as a file to YOUR-THEME/jscripts/switch.js

Code: [Download] [Hide] [Select]
<!--
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.

Code: [Download] [Hide] [Select]
/* 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;
}

 



 
Edited by mort, Fri 05 Aug, 2011 06:56: Added <noscript>
mortSend private message  
Back to topPage bottom
Reply with quote Download Post 
Post 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.
 



 
InformproSend private message  
Back to topPage bottom
Reply with quote Download Post 
Post 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.  
 



 
mortSend private message  
Back to topPage bottom
Reply with quote Download Post 
Post Re: Changing Header Pic Mod For Black Pearl? 
 
mort wrote: [View Post]
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.  


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.  

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.  
 



 
schemerSend private message  
Back to topPage bottom
Reply with quote Download Post 
Post Re: Changing Header Pic Mod For Black Pearl? 
 
Amazing what one can find when one looks around!  
 



 
mortSend private message  
Back to topPage bottom
Reply with quote Download Post 
Post Re: Changing Header Pic Mod For Black Pearl? 
 
Yep    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.   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: [Download] [Hide] [Select]

    <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.  
Thanks,
schemer
 



 
schemerSend private message  
Back to topPage bottom
Reply with quote Download Post 
Post 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
 




____________
Luca
SEARCH is the quickest way to get support.
Icy Phoenix ColorizeIt - CustomIcy - HON
 
Mighty GorgonSend private messageSend e-mail to userVisit poster's website  
Back to topPage bottom
Post new topic  Reply to topic  Page 1 of 1
 


Display posts from previous:    

HideWas this topic useful?

Link this topic
URL
BBCode
HTML




 
Permissions List
You cannot post new topics
You 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


  

 

  cron