php forum
php mysql forum
php mysql smarty
 
Topic Options
#312045 - 11/18/06 05:45 AM 2 different headers in UBB Threads 6.x.x
arentzen Offline
Newbie

Registered: 10/05/06
Posts: 19
Loc: Denmark
If you wish to use 2 different generic header files, without using $fheader (headerfiles for each forums),heres how to do:

Note! Its provided that your default header is named "header.php"

1. Create a new headerfile and name it: "newheader.php", and upload it into your /includes directory.

2. Open your ubbt.inc.php file and find the following lines:
Php Code:
 // ------------------------------------------------
	// Let's see if we need to print out the nav menu
	   $What = find_environmental("PHP_SELF");
	   $script['0'] = "";
	   preg_match ("/(.*)\/(.*).php/",$What,$script);
	   $What	 = $script['2'];
	   if ( ($script['2'] == 'top') || (!preg_match("/\/admin$/",$script['1']) ) ) {

	   // ----------------------------
	   // require the header.php file
		 if ($script['2'] != "top") {
			if ($fheader) {
			   $header = "header_$Board.php";
			}else {
			   $header = "header.php";
			}
			@include "$thispath/includes/$header";
		 }
 


3. Edit the code to:
Php Code:
 // Let's see if we need to print out the nav menu
	   $What = find_environmental("PHP_SELF");
	   $script['0'] = "";
	   preg_match ("/(.*)\/(.*).php/",$What,$script);
	   $What	 = $script['2'];
	   if ( ($script['2'] == 'top') || (!preg_match("/\/admin$/",$script['1']) ) ) {

	   // ----------------------------
	   // require the header.php file
		 if ($script['2'] != "top") {
			if ($fheader) {
			   $header = "header_$Board.php";
			}else {
			   $header = "header.php";
			}
			if($config['newheader']){ @include "$thispath/includes/newheader.php";
		 }		 else { @include "$thispath/includes/$header";
   }
	  }
  


4. Open the program php file where you want the new header, e.g.faq_english.php and add the following code somewhere in the top of the file:
Code:
$config['newheader'] = 1; 
so the top of the file looks similiar like this
Php Code:

<?
/*
# UBB.threads, Version 6
# Official Release Date for UBB.threads Version6: 06/05/2002

# First version of UBB.threads created July 30, 1996 (by Rick Baker).
# This entire program is copyright Infopop Corporation, 2002.
# For more info on the UBB.threads and other Infopop
# Products/Services, visit: http://www.infopop.com

# Program Author: Rick Baker.

# You may not distribute this program in any manner, modified or otherwise,
# without the express, written written consent from Infopop Corporation.

# Note: if you modify ANY code within UBB.threads, we at Infopop Corporation
# cannot offer you support-- thus modify at your own peril :)
# ---------------------------------------------------------------------------
*/

$config['newheader'] = 1;
// Require the library
   require ("main.inc.php");
   

// ---------------------
// Send the page to them
  $html = new html; 
  $html -> send_header("Ofte stillede spørgsmål",$Cat,0,$user);
  $html -> table_header("Ofte stillede spørgsmål");
 



And voila! your new header file should take action, when clicking on faq. If want the new header on more pages, simply open your php files and add the code as described.
_________________________
Peter Arentzen
trosfrihed.dk

Top
#312086 - 11/24/06 07:48 PM Re: 2 different headers in UBB Threads 6.x.x [Re: arentzen]
AllenAyres Administrator Offline
I type Like navaho

Registered: 03/10/00
Posts: 25373
Loc: Texas
Thanks for sharing Peter smile
_________________________
- Allen wavey
- What Drives You?

Top


Moderator:  Ian_W 
Top Posters Last 30 Days
AllenAyres 58
Gizmo 25
sirdude 25
Zarzal 17
blaaskaak 10
willing 3
tackaberry 3
Who's Online
0 Registered (), 32 Guests and 7 Spiders online.
Key: Admin, Global Mod, Mod
Shout Box

Latest Posts
Auto repair table
by blaaskaak
Yesterday at 06:16 PM
User Authentication Class
by swebs
07/18/08 06:19 PM
[7.3.x] ubb.links
by AllenAyres
07/18/08 05:09 PM
Team UBBDev Rides Again!
by AllenAyres
07/18/08 05:08 PM
ubb.social
by willing
07/17/08 06:29 PM
Multiple Identity Detector
by Detangler
07/16/08 05:59 AM
how do I change textcolor in shoutbox
by sirdude
07/14/08 05:14 PM
New Mods
[7.3+] CustomTag - Photobucket Slideshow
by Gizmo
07/12/08 11:14 AM
[7.3.x] Copy forum permissions
by blaaskaak
07/09/08 02:37 PM
Protect users emails
by Basil Fawlty
06/29/08 08:44 AM
[7.3.x] Scheduled board close for backup
by blaaskaak
06/26/08 04:01 AM
[7.3+] CustomTag - Audo Embedding
by Gizmo
06/24/08 07:52 PM
Newest Members
Stanley, NazzaN, mmem700, Tyler, nunny
13309 Registered Users

 

 

 
fusionbb message board php hacks