Previous Thread
Next Thread
Print Thread
Rate Thread
Joined: Apr 2002
Posts: 34
User
User
Offline
Joined: Apr 2002
Posts: 34
I searched and couldn't find the answer, so sorry if this has been answered before.
I would like to include the forum menu that is under my header on the forums on the other non-forum pages of my site.
What do I need to put on those pages to make the menu show? I do want to make sure it shows the logged in/not logged in menu like it does in the forums.
I already have cookies set for site-wide.

Sponsored Links
Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369

Joined: Apr 2002
Posts: 34
User
User
Offline
Joined: Apr 2002
Posts: 34
Not quite Josh. I am looking for a few lines of code I can use to put on my pages I already have to include the menu. I don't want to have to re-make all of my existing pages.
I was hoping there was a simple include I could use.
I want the menu without the header part.

Last edited by FlamingoWorld; 08/17/2003 11:44 PM.
Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
Ah - the menu bar is part of the "send_header" function in threads... so you'd have to send threads headers to use it.

Including the template for the menu bar wouldnt' work, as most of the stuff is defined in the send_header function.

That hack is pretty much what you need....

in essence requiring the main.inc.php file and using send_header

But that'll get you the whole threads header.

Joined: Apr 2002
Posts: 34
User
User
Offline
Joined: Apr 2002
Posts: 34
Thanks Josh, Maybe I will have to modify the forum headers to make it work sitewide and replace just my page headers on my site instead of changing the whole set of pages.

Sponsored Links
Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
This is a bit complicated....

But you could add some "ifs" to the ubbt.inc.php send_header function so it won't output the header template etc.....

I think this would work.


Code
<br />In ubbt.inc.php Find this:<br /><br /><br />       if (!$debug) {<br />	       include("$thispath/templates/$tempstyle/ubbt_header.tmpl");<br />       }<br /><br /><br /><br />and change to this:<br /><br />       if ((!$debug) && (!$config['navonly'])) {<br />	       include("$thispath/templates/$tempstyle/ubbt_header.tmpl");<br />       }<br /><br />




Then in your generic page (which has to be PHP) you'd require main, and call the header, but we'll pass the 'navonly' variable so it skips the regular header template.

Like this



Code
<br /><br /><br />require("/whatever/path/ubbthreads/main.inc.php");<br />$config['navonly'] = 1;<br />$html = new html;<br />$html -> send_header("Title of Your Page");<br /><br />



I think that'll do the trick.

Joined: Apr 2002
Posts: 34
User
User
Offline
Joined: Apr 2002
Posts: 34
Didn't work Josh, I checked for mistakes but I did It just like you said.

Here is the result I got.
http://www.flamingoworld.com/testing.php

Is it possible changes need to be made further down where you find this:

// Let's see if we need to print out the nav menu
$What = find_environmental("SCRIPT_NAME");
$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 (!$debug) {
@include "$thispath/includes/$header";
}
}

I know that if you don't have anything in your includes/header.php file you just get the nav, so is there anyway to make a header2.php file and have it call that instead for what I want to use it for?

Last edited by FlamingoWorld; 08/18/2003 12:52 AM.
Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
Sounds like we just need to exclude that as well.

Change this:

Code
<br /> if (!$debug) {<br />@include "$thispath/includes/$header";<br />} 



To this:
Code
<br /> if ((!$debug) && (!$config['navonly'])) {<br />@include "$thispath/includes/$header";<br />}<br />


I think that'll do it.

Joined: Apr 2002
Posts: 34
User
User
Offline
Joined: Apr 2002
Posts: 34
Thanks Josh, so very, very, very much! That did it! Thanks more than words can say! You are the greatest!

Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
he he

Thought it would be more complicated.... then I wrapped my head around it and it was actually kinda simple.

Glad it worked for you.

Sponsored Links
Joined: Apr 2002
Posts: 34
User
User
Offline
Joined: Apr 2002
Posts: 34
I am sure there will be other people that could use this too, maybe you should put it in the mods forum.

Wish I could be able to think about technical things more clearly this late at night! You are great!


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
Ruben Rocha
Ruben Rocha
Lutz,FL,USA
Posts: 254
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)