Previous Thread
Next Thread
Print Thread
Hop To
#195233 08/26/2007 6:07 AM
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:

Code
<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.


my board: http://www.dragonclan-forum.de
my hobby: http://www.biker-reise.de
Ich kann bei Fragen zu UBBthreads in Deutsch weiterhelfen oder es zumindest versuchen
Joined: Jun 2006
Posts: 9,242
Likes: 1
R
Former Developer
Former Developer
R Offline
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.

Code
<?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 2:34 PM.

my board: http://www.dragonclan-forum.de
my hobby: http://www.biker-reise.de
Ich kann bei Fragen zu UBBthreads in Deutsch weiterhelfen oder es zumindest versuchen
Joined: Jun 2006
Posts: 9,242
Likes: 1
R
Former Developer
Former Developer
R Offline
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?


my board: http://www.dragonclan-forum.de
my hobby: http://www.biker-reise.de
Ich kann bei Fragen zu UBBthreads in Deutsch weiterhelfen oder es zumindest versuchen
Joined: Jun 2006
Posts: 9,242
Likes: 1
R
Former Developer
Former Developer
R Offline
Joined: Jun 2006
Posts: 9,242
Likes: 1
Your full header include would end up looking something like this:

Code
<?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.


my board: http://www.dragonclan-forum.de
my hobby: http://www.biker-reise.de
Ich kann bei Fragen zu UBBthreads in Deutsch weiterhelfen oder es zumindest versuchen
Joined: Jun 2006
Posts: 9,242
Likes: 1
R
Former Developer
Former Developer
R Offline
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.


my board: http://www.dragonclan-forum.de
my hobby: http://www.biker-reise.de
Ich kann bei Fragen zu UBBthreads in Deutsch weiterhelfen oder es zumindest versuchen
Joined: Jun 2006
Posts: 9,242
Likes: 1
R
Former Developer
Former Developer
R Offline
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.


my board: http://www.dragonclan-forum.de
my hobby: http://www.biker-reise.de
Ich kann bei Fragen zu UBBthreads in Deutsch weiterhelfen oder es zumindest versuchen
Joined: Jun 2006
Posts: 16,301
Likes: 116
UBB.threads Developer
UBB.threads Developer
Joined: Jun 2006
Posts: 16,301
Likes: 116
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" wink


I am a Web Development Contractor, I do not work for UBBCentral. I have provided free User to User Support since the beginning of these support forums.
Do you need Forum Install or Upgrade Services?
Forums: A Gardeners Forum, Scouters World
UBB.threads: UBBWiki, UBB Styles, UBB.Sitemaps
Longtime Supporter & Resident Post-A-Holic
VNC Web Services: Code Modifications, Upgrades, Styling, Coding Services, Disaster Recovery, and more!

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
Bots
by Outdoorking - 04/13/2024 5:08 PM
Can you add html to language files?
by Baldeagle - 04/07/2024 2:41 PM
Do I need to rebuild my database?
by Baldeagle - 04/07/2024 2:58 AM
This is not a bug, but a suggestion
by Baldeagle - 04/05/2024 11:25 PM
Who's Online Now
2 members (Geoff, 1 invisible), 692 guests, and 171 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)