Previous Thread
Next Thread
Print Thread
Hop To
Joined: Dec 2003
Posts: 6,566
Likes: 78
Joined: Dec 2003
Posts: 6,566
Likes: 78
How would I go about inserting a custom header per style.
I know we have the html includes. But if I allow several styles for the users to select some images look bad depending on the style a user selects.
My thinking is somehow to use the styles editor but I am not sure how to go about it.
Say I have imagemap1 for a header it looks okay for stock but not for the dark style. So how would I display imagemap1 for stock and imagemap2 for dark.


Blue Man Group
There is no such thing as stupid questions. Just stupid answers
Joined: Apr 2007
Posts: 3,940
Likes: 1
SD Offline
Former Developer
Former Developer
Joined: Apr 2007
Posts: 3,940
Likes: 1
General -- HTML Includes -- at the top, insert:

HTML
<div class="muhahaha">
<a href="/ubbthreads/ubbthreads.php?ubb=cfrm">
<div class="header_graphic"></div>
</a>
</div>
This is common to all wink

in the extra css for EACH style, insert:

HTML
.header_graphic {
background: url(../images/logos/badabing.png)  top left no-repeat;
height: 130px;
margin:0;
}

this gives a clickable image at the upper left corner for each style..

things you might vary:
  • size (css)
  • location (css - top center, top right, .. whateva)
  • site name (duh)
  • badabing.png (for each style, diff logo)


keep in mind that there are 100 ways to do it, so this is just one wink

note: i created a directory under images called 'logos' just for this on my site(s)

also note: you may just get by with 2 logos.. yoursitelite.png & yoursitedark.png. in that case, each dark style's 'badabing.png' would be yoursitedark.png and the others would use yoursitelite.png

Joined: Jul 2006
Posts: 4,057
Joined: Jul 2006
Posts: 4,057
i do it with php

from the HTML Includes
include ('/home/domains/mysite.co.uk/forums/_headers/main.inc.php');

Then add each colored header *.jpg
to the css of each style.

Trust me its complicated.

So if you have 5 styles.
That's 5 images to create. (Normal)
But then 5 x 5 for each style and image.

The trick is this : which i didn't think could be done.
Rick pointed me in the right direction ages ago.

PHP Code
$header_day = <<<DAY1

<table width="100%" border="0" >
  <tr>
	<td class="my_header"><div align="center"></div></td>
  </tr>
   <tr>
	<td><div align="center" class="my_header_txt">$title</div></td>
  </tr>
 </table>

DAY1;

echo "$header_day"; // echo's out the contents of if else results.  



BOOM !! Version v7.6.1.1
People who inspire me Isaac ME Gizmo
Joined: Dec 2003
Posts: 6,566
Likes: 78
Joined: Dec 2003
Posts: 6,566
Likes: 78
Thanks I think I will try Sirdude's method first since it looks like the most simplistic. And easy to keep track of.


Blue Man Group
There is no such thing as stupid questions. Just stupid answers
Joined: Dec 2003
Posts: 6,566
Likes: 78
Joined: Dec 2003
Posts: 6,566
Likes: 78
It works perfect. Now just need to clean up some images.


Blue Man Group
There is no such thing as stupid questions. Just stupid answers
Joined: Apr 2007
Posts: 3,940
Likes: 1
SD Offline
Former Developer
Former Developer
Joined: Apr 2007
Posts: 3,940
Likes: 1
congrats! :rawk: laugh

Joined: Dec 2003
Posts: 6,566
Likes: 78
Joined: Dec 2003
Posts: 6,566
Likes: 78
Yep and what I really like it is all stored in the style and config file so I don't have to screw with it for updates.


Blue Man Group
There is no such thing as stupid questions. Just stupid answers
Joined: Jul 2006
Posts: 4,057
Joined: Jul 2006
Posts: 4,057
I forgot to say mines more complicated as i have titles
changing depending on dates / times too,

for example the Christmas period.

SD works a treat too wink


BOOM !! Version v7.6.1.1
People who inspire me Isaac ME Gizmo
Joined: Dec 2003
Posts: 6,566
Likes: 78
Joined: Dec 2003
Posts: 6,566
Likes: 78
Originally Posted by Mark S
I forgot to say mines more complicated as i have titles
changing depending on dates / times too,

for example the Christmas period.

SD works a treat too wink
Yea I figured that when I saw the day value.
I might try that in the future when I get a library of mastheads built.


Blue Man Group
There is no such thing as stupid questions. Just stupid answers

Link Copied to Clipboard
ShoutChat
Comment Guidelines: Do post respectful and insightful comments. Don't flame, hate, spam.
Recent Topics
Version 7.7.5 Images suddenly not displaying
by Stovebolt - 05/04/2024 11:19 AM
Do I need to rebuild my database?
by Baldeagle - 04/07/2024 2:58 AM
Who's Online Now
1 members (Geoff), 770 guests, and 174 robots.
Key: Admin, Global Mod, Mod
Random Gallery Image
Latest Gallery Images
Los Angeles
Los Angeles
by isaac, August 6
3D Creations
3D Creations
by JAISP, December 30
Artistic structures
Artistic structures
by isaac, August 29
Stones
Stones
by isaac, August 19
Powered by UBB.threads™ PHP Forum Software 8.0.0
(Preview build 20240506)