UBBCentral
Posted By: Basil Dumb ? about HTML Includes - 05/01/2016 6:07 AM
I have been way form UBB too long…I used to know this stuff, but….if I want a header above the forum, I know I have to insert HTML code in the Default Header Include field. But I want the background color, text, etc, that appears up there to take on the colors of certain tables within the main forum. Can someone give me a hint to get me started in the right direction? Thanks

Posted By: JAISP Re: Dumb ? about HTML Includes - 05/01/2016 11:56 AM
I use HTML in a JavaScript insert in the header as I use the same in every page with in the UBB and single pages outside on independent pages. Here is a example of my HTML used with style inserts.

Code
<TD style="border-bottom:1px solid #000000;" HEIGHT="18" BACKGROUND="'+PWloc+backgrPWloc+saybar+'"><FONT style="font-family: Times New Roman; font-size: 12px; font-color: #000000; font-weight: bold;"><CENTER>'+mobsaying+'</CENTER></FONT></TD>
Posted By: Basil Re: Dumb ? about HTML Includes - 05/01/2016 1:15 PM
Thanks for the Reply, JAISP. I understand (mostly ) HTML, but when you start talking JavaScript wrappers, you kinda loose me. No, not kinda. You loose me. onoes

What I want to do for starters is just basically have a table appear above the breadcrumb/navigation table that has the same properties as the bead crumb table (it terms of color, text style, etc.
Posted By: Basil Re: Dumb ? about HTML Includes - 05/01/2016 2:37 PM
Update. After searching bit on here, I think I found what I need:

<table class="t_inner" align="center" width="800">
<tr>
<td align="center" valign="middle" width="325">
<a href="http://My 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>
Posted By: JAISP Re: Dumb ? about HTML Includes - 05/01/2016 2:46 PM
Yes that is the correct way that you have explained for what you are attempting to do. I misunderstood somewhat as to what you had wanted.
Posted By: Basil Re: Dumb ? about HTML Includes - 05/01/2016 7:42 PM
Ok, so I sort of have it working if I use the same header image with a fixed URL; BUT I want to have an 3 images named header.jpg that will be slightly different for each of my current 3 styles. This is what I have on my Default Header Includes that is not working:

HTML
<table class="t_inner" align="center" width="800">
<tr>
<td align="center" valign="middle" width="325">
<a href="http://YOUR_FORUM_URL/" target="_top">
<img src="{$config.BASE_URL}/images/{$style_array.general}/header.jpg" border="0" alt="FORUM NAME" width="500" height="100"></a>
</td>
<td align="center" valign="middle">

<!--// This gives you another column for ads, etc //-->

</td>
</tr>
</table>


Note my image URL. Unfortunately the {config.BASIL_URL| and the {$style_array.general} are not parsing (not being replaced with the actual directories for each style). The image location just stays as "{$config.BASE_URL}/images/{$style_array.general}/header.jpg"

What do I need to do to make this work?
Posted By: JAISP Re: Dumb ? about HTML Includes - 05/01/2016 7:56 PM
Try this:

PHP Code
{$config.BASE_URL}/forums/images/{$style_array.general}/header.jpg 


That would give you something like this:

Code
http://www.yourdomainname.com/forums/images/general/header.jpg


As you have it in your current header it is calling:

Code
http://www.yourdomainname.com/images/general/header.jpg
Posted By: Basil Re: Dumb ? about HTML Includes - 05/01/2016 8:09 PM
Originally Posted by JAISP
Try this:

PHP Code
{$config.BASE_URL}/forums/images/{$style_array.general}/header.jpg 


That would give you something like this:

Code
http://www.yourdomainname.com/forums/images/general/header.jpg


As you have it in your current header it is calling:

Code
http://www.yourdomainname.com/images/general/header.jpg


What is is actually outputting is
PHP Code
http://{$config.BASE_URL}/forums/images/{$style_array.general}/header.jpg 

In other words, it is NOT parsing the $config.BASE_URL nor the $style_array.general parts at all. If I can figure out how to get it to parse correctly, I'm sure I can get it to work after that.

Posted By: JAISP Re: Dumb ? about HTML Includes - 05/01/2016 8:31 PM
Ok I figured it out

This:
Code
{$config.BASE_URL}/images/{$style_array.general}/newpm.gif


equals this:

Code
http://www.yourdomain.com/forums/images/general/default/newpm.gif


Now this is assuming your style is the default board style. If you are using a style with it's own image folder such as "beagleworld" then "default" would be "beagleworld".
Posted By: Basil Re: Dumb ? about HTML Includes - 05/01/2016 8:42 PM
Originally Posted by JAISP
Ok I figured it out

This:
Code
{$config.BASE_URL}/images/{$style_array.general}/newpm.gif


equals this:

Code
http://www.yourdomain.com/forums/images/general/default/newpm.gif


Now this is assuming your style is the default board style. If you are using a style with it's own image folder such as "beagleworld" then "default" would be "beagleworld".


Yes! That's what I am trying to do BUT it is not parsing. I must need to put something else to cause the code to parse.

This is what I have in my HTML includes Tab in the Default Header box:

HTML
<table class="t_inner" align="center" width="800">
<tr>
<td align="center" valign="middle" width="325">
<a href="http://YOUR_FORUM_URL/" target="_top">
<img src="{$config.BASE_URL}/images/{$style_array.general}/header.jpg" border="0" alt="FORUM NAME" width="500" height="100"></a>
</td>
<td align="center" valign="middle">

<!--// This gives you another column for ads, etc //-->

</td>
</tr>
</table>


The table is working, but I get a broken image icon instead of the header image. And when I right-click on the broken image icon and copy the image address, I'm getting:

http://$config.BASE_URL}/images/{$style_array.general}/header.jpg

In other words - the issue is that the $config.BASE_URL and $style_array.general parts are not getting parsed! What do I need to do to my code above so that in interprets $config.BASE_URL" to be www.mysite.com/forums/ ???
Posted By: JAISP Re: Dumb ? about HTML Includes - 05/01/2016 8:52 PM
Ok I just cut and pasted your code into both UBB.Threads 7.5.9 and UBB.Threads 7.6.0 with the only change of the actual image file name as follows below and it worked on both versions. I wanted to make sure that where I was testing it that it wasn't making a difference on the version of the UBB Software.

Code
<table class="t_inner" align="center" width="800">
<tr>
<td align="center" valign="middle" width="325">
<a href="http://YOUR_FORUM_URL/" target="_top">
<img src="{$config.BASE_URL}/images/{$style_array.general}/newpm.gif" border="0" alt="FORUM NAME" width="500" height="100"></a>
</td>
<td align="center" valign="middle">

<!--// This gives you another column for ads, etc //-->

</td>
</tr>
</table>
Posted By: Gizmo Re: Dumb ? about HTML Includes - 05/01/2016 9:06 PM
Really, all you'd need to do is call the CSS classes for your header design; the easiest place to see them all would be to view the source of the stylesheet you're using.

I don't believe that you can call variables in the header, it's definitely something you'd have to fiddle with yourself. Do you have a header graphic that is different depending on the styles? If so, just make an "extra css" for the cell that your image is in, then change it in the styles; or if it's a static image that will not change, just put it in the /images folder and embed it directly.
Posted By: Gizmo Re: Dumb ? about HTML Includes - 05/01/2016 9:46 PM
BTW, I usually use:
Code
<div id="header"></div>


Then add to it as needed, need an image, add the image code; need to use CSS? Add an "extra" class as "#header".
Posted By: Basil Re: Dumb ? about HTML Includes - 05/01/2016 10:40 PM
Originally Posted by JAISP
Ok I just cut and pasted your code into both UBB.Threads 7.5.9 and UBB.Threads 7.6.0 with the only change of the actual image file name as follows below and it worked on both versions. I wanted to make sure that where I was testing it that it wasn't making a difference on the version of the UBB Software.

Code
<table class="t_inner" align="center" width="800">
<tr>
<td align="center" valign="middle" width="325">
<a href="http://YOUR_FORUM_URL/" target="_top">
<img src="{$config.BASE_URL}/images/{$style_array.general}/newpm.gif" border="0" alt="FORUM NAME" width="500" height="100"></a>
</td>
<td align="center" valign="middle">

<!--// This gives you another column for ads, etc //-->

</td>
</tr>
</table>


Maybe we are cutting and pasting into different places? Let me be very clear about where I am pasting:

In CP >> Display Options >> General >> HTML Includes (Tab) Then I past into the "Default Header" box.

Is that where you pasted my code, or in some file? And did it actually display the image and not a broken image?
Posted By: Basil Re: Dumb ? about HTML Includes - 05/01/2016 10:50 PM
Originally Posted by Gizmo
Really, all you'd need to do is call the CSS classes for your header design; the easiest place to see them all would be to view the source of the stylesheet you're using.

I don't believe that you can call variables in the header, it's definitely something you'd have to fiddle with yourself. Do you have a header graphic that is different depending on the styles? If so, just make an "extra css" for the cell that your image is in, then change it in the styles; or if it's a static image that will not change, just put it in the /images folder and embed it directly.


I wanted to have a table at the very top that has the same properties as the breadcrumb table. Using <table class="t_inner" ...> I got that part to work fine. But it's pointing different graphics per style that isn't working (but JAISP said it worked for him). Weird.

Posted By: Gizmo Re: Dumb ? about HTML Includes - 05/02/2016 12:32 AM
If you're making a new one to work along side the default one, why call the new pm graphic? it's not needed... unless i'm missing something
Posted By: Basil Re: Dumb ? about HTML Includes - 05/02/2016 12:45 AM
Originally Posted by Gizmo
If you're making a new one to work along side the default one, why call the new pm graphic? it's not needed... unless i'm missing something


You are looking at what JAISP did just to try it out. My graphic is simply called header. He was just pointing to that image to see if my code (in my first post) worked - it did for him, but I can't get it to work for me. frown
Posted By: JAISP Re: Dumb ? about HTML Includes - 05/02/2016 12:48 AM
I went into the template editor and edited the header.tpl file and placed it under the navigation bar.
Posted By: Basil Re: Dumb ? about HTML Includes - 05/02/2016 2:13 AM
Originally Posted by JAISP
I went into the template editor and edited the header.tpl file and placed it under the navigation bar.


I gave up making it work via the HTML Includes page. I did what you did, except I placed it above the Nav bar. Works great so far.
Posted By: Gizmo Re: Dumb ? about HTML Includes - 05/02/2016 2:57 AM
Yeah, placing it in the template would make it force the coding. I use the html includes items to include a php script that I put all of my changes in, so I can just use FTP and an editor to tweak.
© 2019 UBB.threads PHP Forum Software Community