Previous Thread
Next Thread
Print Thread
Rate Thread
Joined: Oct 2006
Posts: 18
Newbie
Newbie
Joined: Oct 2006
Posts: 18
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.


trosfrihed.dk
Custom Ubb 7.5.2
Sponsored Links
Joined: Mar 2000
Posts: 21,079
Likes: 3
I type Like navaho
I type Like navaho
Joined: Mar 2000
Posts: 21,079
Likes: 3
Thanks for sharing Peter smile


- Allen wavey
- What Drives You?

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
Gizmo
Gizmo
Portland, OR, USA
Posts: 5,833
Joined: January 2000
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
WebGuy 2
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 20221218)