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

   2 different headers in UBB Threads 6.x.x to Del.icio.us Add to del.icio.us
  Digg 2 different headers in UBB Threads 6.x.x Digg it
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: 25427
Loc: Texas
Thanks for sharing Peter smile
_________________________
- Allen wavey
- What Drives You?

Top


Moderator:  Ian_W 
Who's Online
1 Registered (blaaskaak), 31 Guests and 6 Spiders online.
Key: Admin, Global Mod, Mod
Shout Box

Latest Posts
Blogs, love em or hate em?
by Ian_W
Yesterday at 03:47 PM
What do you use to edit the files
by Ian_W
Yesterday at 03:33 PM
BeyondCompare v3.00
by Ian_W
Yesterday at 03:32 PM
Glossy Black Theme with Image Reflection
by Gizmo
Yesterday at 02:17 PM
ShareThis
by Gizmo
09/28/08 05:06 AM
[7.3] Viewing MySQL logfiles made easier
by AllenAyres
09/27/08 09:57 PM
Looking for a simple upload script
by Murphdog
09/26/08 08:45 PM
New Mods
[7.3] Viewing MySQL logfiles made easier
by blaaskaak
09/24/08 05:39 PM
[7.3] Language file checker
by blaaskaak
09/09/08 12:56 AM
[7.3.1] add search to showmembers page
by blaaskaak
09/07/08 04:50 AM
Multiple Identity Detector
by
12/30/06 06:39 PM
Newest Members
ghengis317, NitroX, Dogan, EliYah-, W-D
13344 Registered Users
Top Posters Last 30 Days
AllenAyres 16
blaaskaak 13
FREAK1 7
Mike L_dup1 4
Chris Bale 4
Ian_W 4
tackaberry 3

 

 

 
fusionbb message board php hacks