|
Joined: Jun 2006
Posts: 956
Old Hand
|
Old Hand
Joined: Jun 2006
Posts: 956 |
Is there a way to use {$tbopen} and {$tbclose} in the html header include? I use the following code to display a header on every page: <table width="100%" class="t_outer" cellpadding="0" cellspacing="0">
<tr>
<td>
<table width="100%" class="t_inner" cellpadding="0" cellspacing="1">
<tr>
<td colspan="3" class="category">
<span style="float:right">Community</span>
<span style="float:left">Dragon-Clan</span>
</td>
</tr>
<tr>
<td class="alt-2" align="center">
<img src="http://www.dragonclan-forum.de/ubbthreads/images/logos/general_logo.gif" height="60" width="468" alt="Dragon-Clan" border="0" />
</td>
</tr>
</table>
</td>
</tr>
</table> This looks ugly if a style use a wrapper with a lot a graphic borders and I like to use the border on the header to. This cannot be hardcode and so I search for a way to use the wrapper.
|
|
|
|
Joined: Jun 2006
Posts: 9,242 Likes: 1
Former Developer
|
Former Developer
Joined: Jun 2006
Posts: 9,242 Likes: 1 |
Currently it takes a couple of steps. First in the send_header function in libs/ubbthreads.inc.php you'll see a big list of global variables. You need to add $wrappers to that list of globals. Your header file would need to be done in php, but you could then use the $tbopen and $tbclose variables in your header.
<?php
$tbopen = $wrappers[$wrapper_id]['open'];
$tbclose = $wrappers[$wrapper_id]['close'];
?>
|
|
|
|
Joined: Jun 2006
Posts: 956
Old Hand
|
Old Hand
Joined: Jun 2006
Posts: 956 |
I put the $wrappers at the end of line 423. What else need to be done? If I try your example code the wrapper dont come up.
Last edited by Zarzal; 08/26/2007 1:34 PM.
|
|
|
|
Joined: Jun 2006
Posts: 9,242 Likes: 1
Former Developer
|
Former Developer
Joined: Jun 2006
Posts: 9,242 Likes: 1 |
Sorry. In libs/ubbthreads.inc.php look for this line about line 423:
global $style_array,$tree, $ubb, $config, $myinfo,$ubbt_lang, $dbh, $smarty, $PHPSESSID, $SID,$debug,$var_start,$var_sep,$var_eq, $forumvisit,$user, $userob, $VERSION;
Just add $wrappers to the list of variables:
global $style_array,$tree, $ubb, $config, $myinfo,$ubbt_lang, $dbh, $smarty, $PHPSESSID, $SID,$debug,$var_start,$var_sep,$var_eq, $forumvisit,$user, $userob, $VERSION, $wrappers;
The code I had posted in my previous post actually goes into your header include file.
|
|
|
|
Joined: Jun 2006
Posts: 956
Old Hand
|
Old Hand
Joined: Jun 2006
Posts: 956 |
Ok, thats clear. Both done. Now, how do I call the wrapper in the in include? I try several things but be not able to get it. Can you give me one more example please how to use it in the include?
|
|
|
|
Joined: Jun 2006
Posts: 9,242 Likes: 1
Former Developer
|
Former Developer
Joined: Jun 2006
Posts: 9,242 Likes: 1 |
Your full header include would end up looking something like this:
<?php
$tbopen = $wrappers[$wrapper_id]['open'];
$tbclose = $wrappers[$wrapper_id]['close'];
echo <<<HTML_BLOCK
$tbopen
<tr>
<td class="tdheader">
Header class
</td>
</tr>
<tr>
<td class="alt-1">
Alt-1 class
</td>
</tr>
$tbclose
HTML_BLOCK;
?>
|
|
|
|
Joined: Jun 2006
Posts: 956
Old Hand
|
Old Hand
Joined: Jun 2006
Posts: 956 |
I try your example but it dont work (for me). There must be something else missing.
|
|
|
|
Joined: Jun 2006
Posts: 9,242 Likes: 1
Former Developer
|
Former Developer
Joined: Jun 2006
Posts: 9,242 Likes: 1 |
Hmm, I'll see if I can figure it out.
|
|
|
|
Joined: Jun 2006
Posts: 956
Old Hand
|
Old Hand
Joined: Jun 2006
Posts: 956 |
this would be very nice. Thank you for looking into it. If this work the layout of the whole site includes a custom header looks smarter.
|
|
|
|
Joined: Jun 2006
Posts: 9,242 Likes: 1
Former Developer
|
Former Developer
Joined: Jun 2006
Posts: 9,242 Likes: 1 |
Ah, forgot one line in your header include.
Before $tbopen and $tbclose are defined you need to add this:
$wrapper_id = $style_array['wrappers'];
|
|
|
|
Joined: Jun 2006
Posts: 956
Old Hand
|
Old Hand
Joined: Jun 2006
Posts: 956 |
YES - very nice. It work. Thank you very much.
|
|
|
|
Joined: Jun 2006
Posts: 16,367 Likes: 126
|
Joined: Jun 2006
Posts: 16,367 Likes: 126 |
I'd like to see something like this in the codebase so we could just referance it; would make dealing with wrappers a little more... "fun"
|
|
|
2 members (Ruben, SenecaFlyer),
929
guests, and
67
robots. |
Key:
Admin,
Global Mod,
Mod
|
|
|
|