|
Joined: Nov 2006
Posts: 31
newbie
|
newbie
Joined: Nov 2006
Posts: 31 |
Hello people,
Does anybody know of a quick way to add an image to the top-left corner of the page? Like a title image that would display on every page?
Thanks,
MW
|
|
|
|
Joined: Jun 2006
Posts: 9,242 Likes: 1
Former Developer
|
Former Developer
Joined: Jun 2006
Posts: 9,242 Likes: 1 |
Easiest way is to add a bit of HTML in the Display Options -> General -> HTML Includes tab. Just stick it in the Default Header box.
|
|
|
|
Joined: Jun 2006
Posts: 16,375 Likes: 129
|
Joined: Jun 2006
Posts: 16,375 Likes: 129 |
There are several threads about doing this with a div and the style system. I thought I had one on my watchlist, but it comes up with nothing too helpful, but i'm sure the search will 
|
|
|
|
Joined: Aug 2006
Posts: 1,649 Likes: 1
Pooh-Bah
|
Pooh-Bah
Joined: Aug 2006
Posts: 1,649 Likes: 1 |
Here's a simple HTML solution; adjust accordingly. Add to Control Panel » Display Options » HTML Includes » Default Header:
<br />
<table align="center" width="800">
<tr>
<td align="center" valign="middle" width="325">
<a href="http://YOUR_FORUM_URL/" target="_top">
<img alt="FORUM NAME" width="300" height="50"
src="YOUR_FORUM_LOGO" border="0"></a>
</td>
<td align="center" valign="middle">
<!--// This gives you another column for ads, etc //-->
</td>
</tr>
</table>
<br />
GangsterBB.NET (Ver. 7.6.1.1) PHP Version 5.6.40 / MySQL 5.7.23-23 (was 5.6.41-84.1) / Apache 2.4.54 2007 Content Rulez Contest - Hon Mention UBB.classic 6.7.2 - RIP
|
|
|
|
Joined: Jun 2006
Posts: 16,375 Likes: 129
|
Joined: Jun 2006
Posts: 16,375 Likes: 129 |
That's a good basic one jgeoff, but what if you had a different logo for each style  ...
|
|
|
|
Joined: Nov 2006
Posts: 3,095 Likes: 1
Carpal Tunnel
|
Carpal Tunnel
Joined: Nov 2006
Posts: 3,095 Likes: 1 |
|
|
|
|
Joined: Jun 2006
Posts: 16,375 Likes: 129
|
Joined: Jun 2006
Posts: 16,375 Likes: 129 |
nope.... As I said, add a div, set it to a non existant class: <div id="my_header"> </div> Then set a new section in your style editor to add a custom class, and set a background image, then use the height attribute then whammo, custom background images for every style  ... #my_header {
color: #000000;
background-image: url('images/stylename/header.gif');
background-repeat: no-repeat;
height: 230px;
position: relative;
}
|
|
|
|
Joined: Dec 2006
Posts: 184
member
|
member
Joined: Dec 2006
Posts: 184 |
Quoting Rick from a question I asked : "Basically, I added a div with a custom class name in the header:" <div class="header_graphic">
</div> "And then in the Extra Properties for each stylesheet, I define the image to use and it's height. Looks something like this:" .header_graphic {
background: url(/site_images/header_custom.gif) no-repeat 50% 0;
height: 98px;
position: relative;
}

|
|
|
|
Joined: Nov 2006
Posts: 3,095 Likes: 1
Carpal Tunnel
|
Carpal Tunnel
Joined: Nov 2006
Posts: 3,095 Likes: 1 |
What you no like JS? 
|
|
|
|
Joined: Dec 2006
Posts: 184
member
|
member
Joined: Dec 2006
Posts: 184 |
|
|
|
|
Joined: Jun 2006
Posts: 16,375 Likes: 129
|
Joined: Jun 2006
Posts: 16,375 Likes: 129 |
psh, it's basically the same as mine, only i use "id" versus "class" hehe... And NT, I respect JavaScript, however I don't respect it enough to do things that I could better do with CSSing 
|
|
|
|
Joined: Nov 2006
Posts: 3,095 Likes: 1
Carpal Tunnel
|
Carpal Tunnel
Joined: Nov 2006
Posts: 3,095 Likes: 1 |
Just ribbing ya Giz 
|
|
|
|
Joined: Jun 2006
Posts: 16,375 Likes: 129
|
Joined: Jun 2006
Posts: 16,375 Likes: 129 |
Just ribbing ya Giz  careful, i spit 
|
|
|
|
Joined: Aug 2006
Posts: 1,649 Likes: 1
Pooh-Bah
|
Pooh-Bah
Joined: Aug 2006
Posts: 1,649 Likes: 1 |
That's a good basic one jgeoff, but what if you had a different logo for each style  ... See, I was just answering the specific question: Does anybody know of a quick way to add an image to the top-left corner of the page? Like a title image that would display on every page? Your solution is great, however, as an answer to a different question. lol 
GangsterBB.NET (Ver. 7.6.1.1) PHP Version 5.6.40 / MySQL 5.7.23-23 (was 5.6.41-84.1) / Apache 2.4.54 2007 Content Rulez Contest - Hon Mention UBB.classic 6.7.2 - RIP
|
|
|
|
Joined: Jun 2006
Posts: 16,375 Likes: 129
|
Joined: Jun 2006
Posts: 16,375 Likes: 129 |
nah, mine expands on this, for additional styles; but we're both right 
|
|
|
|
Joined: Jul 2006
Posts: 4,057
|
Joined: Jul 2006
Posts: 4,057 |
I knew this existed lol
CSS Images or CSS Graphic Header
That should help with the old search in the future lol.
BOOM !! Version v7.6.1.1 People who inspire me Isaac ME Gizmo
|
|
|
|
Joined: Jul 2006
Posts: 4,057
|
Joined: Jul 2006
Posts: 4,057 |
Is there a way to hook up on which CSS is being used?
I'm creating a headers (Images + Text) and i use a inc.php file to process the date to display which ever festive image for example.
But if i use a Date to change the image i.e. New Year i loose the ability to detect which style sheet is being used, so i cant use the other images as they blend better you see.
So up to now its either, Date shows that image but static color. Or Blended image, but no date hook up. (via style sheet).
Any workarounds? thanks. If the answer is java i would need an example to start from. As me and java dont know each other lol.
BOOM !! Version v7.6.1.1 People who inspire me Isaac ME Gizmo
|
|
|
|
Joined: Jul 2006
Posts: 4,057
|
Joined: Jul 2006
Posts: 4,057 |
Bump ? Any guidance pleeeease lol Chrimbo is over now and i need to get things back to normal 
BOOM !! Version v7.6.1.1 People who inspire me Isaac ME Gizmo
|
|
|
|
Joined: Jun 2006
Posts: 3,839 Likes: 1
Carpal Tunnel
|
Carpal Tunnel
Joined: Jun 2006
Posts: 3,839 Likes: 1 |
Can't you see the CSS if you view the source?
The useful styles editor, should also assist - don't forget to refresh the image to ensure you are seeing the latest info displayed.
|
|
|
|
Joined: Jul 2006
Posts: 4,057
|
Joined: Jul 2006
Posts: 4,057 |
Yes i can, but how can i code it so i can write a script to show the correct css image for that theme.
I'm using the example above where i have the custom css as the image. It works as expected.
BUT I have a script that checks the dates in a php file. And if its Christmas then a Christmas image is shown. As the CSS (Image) has to be updated via a style sheet, i'm loosing the combustibility. I have to go into every style sheet and update the css path to the new image manually. I'm trying to get it more Automated.
The CSS method above is great for Text i have that changes according to the times of the day. But as you like me Ian you have sub forums too. And ive now realised that i cant custom image for custom headers as the CSS is already set.
Or after all that. I need a way of Hooking up what style sheet a member has as there preferred or default, and then get that css image to show.
I know someone mentioned a java script way, but for that i wouldnt know the how or the hook ups?
BOOM !! Version v7.6.1.1 People who inspire me Isaac ME Gizmo
|
|
|
|
Joined: Jul 2006
Posts: 4,057
|
Joined: Jul 2006
Posts: 4,057 |
Okay a bit of a think later... I can now have different headers between Normal Headers and custom headers. What i had to do was to make an additional rule for the custom header for each forum. <div class="header_graphic">
</div>
and .header_graphic {
background: url(/site_images/header_custom.gif) no-repeat 50% 0;
height: 98px;
position: relative;
} And to get it to work in the custom headers <div class="header_custom">
</div>
and .header_custom {
background: url(/site_images/header_custom.gif) no-repeat 50% 0;
height: 98px;
position: relative;
} So my style sheets contain x2 extra css rules now. Its going to get longer as i have about 12 i want to customise. BUT.......... My "HOW" Still remains. How can i change these images on date references? By this i mean the likes of Christmas, new year etc.. I cant use transparent images due to the loss of quality (white pix's) I have or did use a php script that checked for the date, and then a simple else if would show different images for the festive season or otherwise. But because the image source is in the css in the style sheet i need a way to check and override it. Check - Which css is being used. Override - the default image. I hope that make more sense.
BOOM !! Version v7.6.1.1 People who inspire me Isaac ME Gizmo
|
|
|
|
Joined: Jun 2006
Posts: 9,242 Likes: 1
Former Developer
|
Former Developer
Joined: Jun 2006
Posts: 9,242 Likes: 1 |
I think you'd actually need to reference a script for the header_custom.gif file. That script would check the current date and then display the proper image.
So, something like:
background: url(/path/to/header_custom.php) no-repeat 50% 0;
And then the header_custom.php script would output the proper image.
|
|
|
|
Joined: Jul 2006
Posts: 4,057
|
Joined: Jul 2006
Posts: 4,057 |
background: url(/path/to/header_custom.php) no-repeat 50% 0; would be in my style sheet as the class rule. I didn't know you could call a script like that with css. I like the thinking and it may just work. Nice One Rick  I should have time at the weekend to try this out 
BOOM !! Version v7.6.1.1 People who inspire me Isaac ME Gizmo
|
|
|
|
Joined: Jul 2006
Posts: 4,057
|
Joined: Jul 2006
Posts: 4,057 |
I'm struggling with this one, i think its more about how it fits together.
A bit of lunch and will have another go...
BOOM !! Version v7.6.1.1 People who inspire me Isaac ME Gizmo
|
|
|
|
Joined: Jul 2006
Posts: 4,057
|
Joined: Jul 2006
Posts: 4,057 |
Yehhhh got it working after a bit of hair pulling. Rick Put me on the right track, and its a neat trick. Thing to remember is you have to remember IMAGE as that's what the css background-image is. Your Style sheet calls the php script. (Style Sheet Extra Properties) .my_header { background-color: none; background-image: url('http://** Path to my Script**/image.inc.php');background-repeat: no-repeat; background-position: top center; height: 104px; width:695; position: relative; } PHP FILE <?php ##Source = Style Sheet Dark Grey. # Exit must exist or it can cause problems. # 1 file for the image and 1 file for the text  $today = date("dm"); // result == 2806 Day, Month if ($today == ("0101")) { header('Location: http://**Path to Seasonal Image/newyear/header-eve-dkblue.gif'); // Voila! exit; // Happy New year. } ?> You can then add more elseif to include more dates. Ive read the the EXIT is important. So i would leave it there. ============================================== Now in the Forum : Custom Inserts : Headers Call the script to display the image in the div / class tag. You can find more examples above  <table width="100%" border="0" > <tr> <td class="my_header"><div align="center"></div></td> </tr> </table> Mines still in testing... But seems to work fine, just need some headache tablets as that battered my head at first but its simple now lol This page my help http://www.mambers.com/showpost-p_122103-postcount_23.htmlor http://www.mambers.com/showthread-t_24861-page_3.htmlPhew was that complicated to get my head around lol
BOOM !! Version v7.6.1.1 People who inspire me Isaac ME Gizmo
|
|
|
2 members (Gizmo, 1 invisible),
198
guests, and
94
robots. |
Key:
Admin,
Global Mod,
Mod
|
|
|
|