Site Links
Home
Features
Documentation
Pricing & Order
Members Area
Support Options
UBBDev.com
UBBWiki.com
Who's Online
0 registered (), 41 Guests and 12 Spiders online.
Key: Admin, Global Mod, Mod
Featured Member
Registered: 05/13/08
Posts: 596
Top Posters (30 Days)
Ruben 51
Gizmo 24
DennyP 24
Dunny 15
SteveS 14
AllenAyres 12
dbremer 10
SD 10
drkknght00 9
doug 8
Latest Photos
OK Corral Shoot Out
Testing
Basildon Train Station
Basildon Town Centre looking from the rounderbout
Basildon Town Square
Page 1 of 2 1 2 >
Topic Options
#195233 - 08/26/07 06:07 AM Wrapper in header include
Zarzal Offline
old hand
Registered: 06/05/06
Posts: 1142
Loc: Berlin, Germany
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.dragon-clan.de
my hobby: http://www.biker-reise.de
Ich kann bei Fragen zu UBBthreads in Deutsch weiterhelfen oder es zumindest versuchen
Top
Express Hosting
Express Hosting "We are the official hosting company of UBB.threads. Ask us about our free migration services to migrate your UBB.threads installation."
#195243 - 08/26/07 11:58 AM Re: Wrapper in header include [Re: Zarzal]
Rick Offline
Post-a-holic
Registered: 06/04/06
Posts: 10164
Loc: Aberdeen, WA
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'];
?>
Top
#195259 - 08/26/07 02:17 PM Re: Wrapper in header include [Re: Rick]
Zarzal Offline
old hand
Registered: 06/05/06
Posts: 1142
Loc: Berlin, Germany
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.


Edited by Zarzal (08/26/07 02:34 PM)
_________________________
my board: http://www.dragon-clan.de
my hobby: http://www.biker-reise.de
Ich kann bei Fragen zu UBBthreads in Deutsch weiterhelfen oder es zumindest versuchen
Top
#195261 - 08/26/07 02:31 PM Re: Wrapper in header include [Re: Zarzal]
Rick Offline
Post-a-holic
Registered: 06/04/06
Posts: 10164
Loc: Aberdeen, WA
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.
Top
#195263 - 08/26/07 02:42 PM Re: Wrapper in header include [Re: Rick]
Zarzal Offline
old hand
Registered: 06/05/06
Posts: 1142
Loc: Berlin, Germany
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.dragon-clan.de
my hobby: http://www.biker-reise.de
Ich kann bei Fragen zu UBBthreads in Deutsch weiterhelfen oder es zumindest versuchen
Top
#195269 - 08/26/07 02:57 PM Re: Wrapper in header include [Re: Zarzal]
Rick Offline
Post-a-holic
Registered: 06/04/06
Posts: 10164
Loc: Aberdeen, WA
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;

?>
Top
#195273 - 08/26/07 03:14 PM Re: Wrapper in header include [Re: Rick]
Zarzal Offline
old hand
Registered: 06/05/06
Posts: 1142
Loc: Berlin, Germany
I try your example but it dont work (for me). There must be something else missing.
_________________________
my board: http://www.dragon-clan.de
my hobby: http://www.biker-reise.de
Ich kann bei Fragen zu UBBthreads in Deutsch weiterhelfen oder es zumindest versuchen
Top
#195274 - 08/26/07 03:19 PM Re: Wrapper in header include [Re: Zarzal]
Rick Offline
Post-a-holic
Registered: 06/04/06
Posts: 10164
Loc: Aberdeen, WA
Hmm, I'll see if I can figure it out.
Top
#195275 - 08/26/07 03:22 PM Re: Wrapper in header include [Re: Rick]
Zarzal Offline
old hand
Registered: 06/05/06
Posts: 1142
Loc: Berlin, Germany
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.dragon-clan.de
my hobby: http://www.biker-reise.de
Ich kann bei Fragen zu UBBthreads in Deutsch weiterhelfen oder es zumindest versuchen
Top
#195276 - 08/26/07 03:24 PM Re: Wrapper in header include [Re: Rick]
Rick Offline
Post-a-holic
Registered: 06/04/06
Posts: 10164
Loc: Aberdeen, WA
Ah, forgot one line in your header include.

Before $tbopen and $tbclose are defined you need to add this:

$wrapper_id = $style_array['wrappers'];
Top
Page 1 of 2 1 2 >



Moderator:  AllenAyres, Harold, Ian, Ron M 
Shout Box

Today's Birthdays
No Birthdays
Recent Topics
Temporary Password email not being received
by
Yesterday at 10:02 PM
Ability to "like" individual posts (not Facebook "likes)
by doug
05/23/12 09:03 AM
Island Permissions
by ThreadsUser
05/22/12 03:03 PM
streaming video
by prkrgrp
05/20/12 07:02 PM
New Posts Corrupted? Can someone help?
by PianoWorld
05/19/12 09:41 AM
Forum Stats
10489 Members
36 Forums
33841 Topics
181707 Posts

Max Online: 978 @ 06/24/07 11:19 PM
Random Image