Previous Thread
Next Thread
Print Thread
Rate Thread
Joined: Feb 2001
Posts: 2,268
Junior Member
Junior Member
Offline
Joined: Feb 2001
Posts: 2,268
What does it do? It allows you to use a "Threads like" template for you generic header.

Why would you care?: Because you can take advantage of the new $tbopen and $tbclose variables in Threads 6.2...

Who gets the props?: Me (But I also have to give a nod to JustDave )

Here is the script for your Generic Header:

Code
 <br /> <br /> <? <br /> <br />$html = new html; <br /> <br />// Grab the tablewrapper <br />list($tbopen,$tbclose) = $html -> table_wrapper(); <br /> <br />// Send the template <br />include("$thispath/templates/$tempstyle/header.tmpl"); <br /> <br />?> <br /> <br /> 


You also have to create a header.tmpl file and copy it to your ubbthreads/templates/default/ directory. Here is a simplified version of my header.tmpl file:

Code
 <br /> <? <br />echo <<<template <br /> <br />$tbopen <br /> <br /><tr> <br /><td class="darktable"> <br /><table border="0" cellpadding="0" cellspacing="0"> <br /> <br /><tr> <br />  <td class="logo-left"><img border="0" src="http://www.yourdomain.com/logo-clear.gif" width="250" height="60" /> <br /></td> <br /> <br /><td class="logo" width="100%" align="right"> <br /></td> <br /> <br /></tr> <br /> <br /></table> <br /></td> <br /></tr> <br /> <br />$tbclose <br /> <br /><br /> <br /> <br />template; <br />?> <br /> <br /> 


Since the last html tag in the tbopen.tmpl file is a table, all you have to do in your header.tmpl file after $tbopen is start out with a tr and a td tag.

The benefit to doing your header this way: If you ever change the tbopen or tbclose template files your header will automatically change...

P.S. Try this out on a forum header first. I have a test forum that I use to test new designs that only admins and mods can see.

Last edited by Dalantech; 01/21/2003 8:29 AM.
Sponsored Links
Joined: Jun 2001
Posts: 3,273
That 70's Guy
That 70's Guy
Offline
Joined: Jun 2001
Posts: 3,273
Sweet!

I got to playing and did things this way... (figures huh?)

In your ubbt.inc.php file around line 377 find this:

Code
<br />         // -------------------------------------------<br />         // Now require the registerednav.php template<br />            $html = new html;<br />            list($tbopen,$tbclose) = $this -> table_wrapper();<br />


and change it to this:

Code
<br />         // -------------------------------------------<br />         // Now require the registerednav.php template<br />



Around line 200 find this:

Code
<br />      if (isset($user['loggedout'])) {<br />         $loggedout = $user['loggedout'];<br />      }<br />


and change it to this:

Code
<br />      if (isset($user['loggedout'])) {<br />         $loggedout = $user['loggedout'];<br />      }<br />	  <br />      $html = new html;<br />      list($tbopen,$tbclose) = $this -> table_wrapper();<br />




Change your header.php file located in your includes directory to something like this:

Code
<br /><?<br />echo <<<UBBTPRINT<br />$tbopen<br /><tr><br /><td align="left" class="welcome"><br /><br />Your Logo Here. (or what ever)<br /></td><br /></tr><br />$tbclose<br />UBBTPRINT;<br />?><br />




Either way should work but this way will allow for forum specific headers to be used easily.

Joined: Feb 2001
Posts: 2,268
Junior Member
Junior Member
Offline
Joined: Feb 2001
Posts: 2,268
Very !

Joined: Feb 2001
Posts: 2,268
Junior Member
Junior Member
Offline
Joined: Feb 2001
Posts: 2,268
JustDave,

I can't edit my original file. Would you please add [6.2] to the title of the first post? I forgot to do it, and this mod is Threads version specific. Thanks!

Joined: Apr 2001
Posts: 3,266
Member
Member
Offline
Joined: Apr 2001
Posts: 3,266
Nice work Dalantech love it!

However just a quick note to users who would download this hack. If you have software programs like Photopost integrated with Threads make sure to copy your header.php file over into the photopost directory and rename it something like header.html and call it from there. External programs will not read the $tbopen and $tbclose variables. I found out the hard way when I was scratching my head wondering why photopost was not working and remembered I applied this hack a day earlier. I think it worthwhile to go the extra step and do this hack as everything is going to templates eventually. Most programs will separate the code and html so in the future you will be able to integrate them directly again. It is nothing to copy the contents to a file named header.html when you have to make one names header.tmpl anyway.

Sponsored Links
Joined: Feb 2001
Posts: 2,268
Junior Member
Junior Member
Offline
Joined: Feb 2001
Posts: 2,268
Did you try requiring the Threads library from within the photo posts php file? Not sure if it would work, but it might be worth a try.

Joined: Jun 2001
Posts: 3,273
That 70's Guy
That 70's Guy
Offline
Joined: Jun 2001
Posts: 3,273
I added this forum to the list of forums with unlimited edit time. You should be able to edit now.

Joined: Feb 2001
Posts: 2,268
Junior Member
Junior Member
Offline
Joined: Feb 2001
Posts: 2,268


Done

Joined: Feb 2001
Posts: 2,268
Junior Member
Junior Member
Offline
Joined: Feb 2001
Posts: 2,268
I got to turning this whole thing over in my head, and as usual I was doing site design / scripting while I was driving home. This was one of theose days when I'm realy glad the car knew how to get home...

Since Threads alows for forum specific headers why not create a header for each forum using the php script that I put in the first post of this thread, but set it up so that it includes a different template for each forum. Since the graphics are set by CSS properties it would be a piece of cake to define different logos per forum (it would only require one new class per forum in every style sheet). Style sheet selection checking isn't needed in the header (it's obviously checked before the header includes).

So it's possible to have forum specific logos without any additional script hacking

When I get some more of that thing called time I'll set it up and show you what I mean

Joined: Apr 2001
Posts: 3,266
Member
Member
Offline
Joined: Apr 2001
Posts: 3,266
Photopost is actually outside of Threads. I tried calling the threads library and it lets Photopost load without hanging like it did before. However it just bypasses the header. Until Photopost can read templates it is just as easy to make a html file.

Thought I would bring this up so people who run photopost know they need to hard code the header if they want to run this mod.


Sponsored Links
Joined: Feb 2001
Posts: 2,268
Junior Member
Junior Member
Offline
Joined: Feb 2001
Posts: 2,268
Bummer, cause I hate having to re-invent the wheel when I'm scripting a web site.

The custom error page that I have uses the table wrappers, calls the library, etc. and it is outside of Threads (I have it in web root on my server). Do you want a copy of my file?

Joined: Aug 2002
Posts: 111
Journeyman
Journeyman
Offline
Joined: Aug 2002
Posts: 111
How do I make my header image centered? I notice the example template references "td class="logo-left">" and "<td class="logo" width="100%" align="right">", but I'm not exactly sure how to modify these things to center my image. I've tried different combinations of code I think *might* work, but they don't.

Thanks for the hand-holding

Joined: Feb 2001
Posts: 2,268
Junior Member
Junior Member
Offline
Joined: Feb 2001
Posts: 2,268
I included a simplified version of my logo just so you could see how the templates work. The easiest way to get started is just to strip the opening and closing table tags from your current logo html and then cut and paste what's left into this template:

Code
<? <br />echo <<<template<br />$tbopen   <br /> <br />//Put your logo html minus the first<br />//and last table tags after this line<br />//________________________________<br /><br /><br />//Now let's finish the template<br /><br />$tbclose<br /><br /><br /><br /><br />template;<br />?><br />


That should get you started

Joined: Mar 2003
Posts: 215
Junior Member
Junior Member
Offline
Joined: Mar 2003
Posts: 215
Great.

I just added the template code that would be in the tmpl into the header itself instead.

Joined: Feb 2001
Posts: 2,268
Junior Member
Junior Member
Offline
Joined: Feb 2001
Posts: 2,268
That also works provided you include

Code
 <br />// Grab the tablewrapper<br />$html = new html;<br />list($tbopen,$tbclose) = $html -> table_wrapper();<br /> 


before you try to use $tbopen and $tbclose

Joined: Feb 2001
Posts: 2,268
Junior Member
Junior Member
Offline
Joined: Feb 2001
Posts: 2,268
This mod works for UBB Threads 6.3


Link Copied to Clipboard
Donate Today!
Donate via PayPal

Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.

Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.
Recommended Hosts
We have personally worked with and recommend the following Web Hosts:
Stable Host
bluehost
InterServer
Visit us on Facebook
Member Spotlight
Bill B
Bill B
Issaquah, WA
Posts: 87
Joined: December 2001
Forum Statistics
Forums63
Topics37,573
Posts293,925
Members13,849
Most Online5,166
Sep 15th, 2019
Today's Statistics
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
Top Posters
AllenAyres 21,079
JoshPet 10,369
LK 7,394
Lord Dexter 6,708
Gizmo 5,833
Greg Hard 4,625
Top Posters(30 Days)
Top Likes Received
isaac 82
Gizmo 20
Brett 7
Morgan 2
Top Likes Received (30 Days)
None yet
The UBB.Developers Network (UBB.Dev/Threads.Dev) is ©2000-2024 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 8.0.0
(Preview build 20240506)