UBB.Dev
Posted By: JoshPet Custom Page without Nav Menu? - 09/29/2002 5:13 AM
I've made a custom page where I authenticate and send the threads headers and footers....

But how can I do this WITHOUT the menu bar at all?

I know those are sent from ubbt.inc.php.... but the process of how those get sent still baffles me. Is there a way to not send those for specific pages?

Help is appreciated.
Posted By: Lisa_P Re: Custom Page without Nav Menu? - 09/29/2002 6:13 AM
What are you using? I have a few pages coded that recognize the cookie and pull the stylesheet, but they don't have the menu. But I don't know if I did mine right.
Posted By: JustDave Re: Custom Page without Nav Menu? - 09/29/2002 6:18 AM
I've wanted to do this a number of times and the only way I can see getting around it is to use a global variable to toggle it on or off. You would put a variable in your config.inc.php file with the value of 1 and then when you didn't want the navigation bar displayed you would set the value to 0 before calling the send_header function. In that function you would check the variable's value and decide if the navigation bar needs to be included into the display.


In your config.inc.php file add this:

$config['navbar'] = 1; // 1 = on, 0 = off.


In your ubbt.inc.php file change this:

if (!$debug) {
include("$thispath/templates/$tempstyle/ubbt_unregisterednav.tmpl");
}

to this:

if (!$debug && $config['navbar']) {
include("$thispath/templates/$tempstyle/ubbt_unregisterednav.tmpl");
}

Then find this:

if (!$debug) {
include("$thispath/templates/$tempstyle/ubbt_registerednav.tmpl");
}

to this:

if (!$debug && $config['navbar']) {
include("$thispath/templates/$tempstyle/ubbt_registerednav.tmpl");
}





Now before you call the send_header function set the navbar value to 0 so it doesn't get displayed:

$config['navbar'] = 0;




I think this will work. Haven't tried it but need to. Was one of them things I been meaning to look into just hadn't gotten around to it... lol

Posted By: JoshPet Re: Custom Page without Nav Menu? - 09/29/2002 6:21 AM
It's a glorified "newspal" sorta thing.... basically setting up some pages that can be edited (in threads) by a novice.

It's probably not pretty... I'm new at this. LOL

code:

$seaadvpath = "/home/mypaths/seaadventures";
include "{$seaadvpath}/main.inc.php";


// authenticate user
$userob = new user;
$user = $userob -> authenticate("");

$user = $userob -> authenticate("U_Username,U_Status");
list($Uusername,$Status) = $user;

$html = new html;
$date = $html -> get_date();

$query = "
SELECT B_Number,B_Posted,B_Subject,B_Body,B_Main,B_Board,B_File
FROM {$config['tbprefix']}Posts
WHERE B_Board = 'groupcruise'
AND B_Number = B_Main
AND B_Approved = 'yes'
ORDER BY B_Posted DESC
";
$sth = $dbh -> do_query($query);
$html = new html;
$pcount = 0;
$pastdate = "";
while ( list($Number,$Posted,$Subject,$Body,$Main,$Keyword,$File) = $dbh -> fetch_array($sth)) {
$pcount++;
$output .= "edited all my output out of here to save space";
}
$dbh -> finish_sth($sth);

// send the header
$html = new html;
$html -> send_header($config['title'],$Cat,0,$user);
echo $output;

// send the footer
$html -> send_footer();


Posted By: JoshPet Re: Custom Page without Nav Menu? - 09/29/2002 6:26 AM
Oh I see.

So if I don't want it on just a few pages....

Would I be better off not to send the threads header.... but still authenticate like Lisa says she's got?

OR..... could you set that on/off variable on the page that I want to send....

in other words..... could I do your thing.... using a $navbar variable.....then define it as either 0 or 1 in each script????????? so that it would be on or off based on what script loads.. or would the ubbt.inc.php file not read a variable defined in the page that calls it. Probably not.

Hmmmmmmm......
Posted By: JustDave Re: Custom Page without Nav Menu? - 09/29/2002 6:29 AM
I think if you follow the steps I outlined your code will not display the nav bar. \


It will still benifit from the rest of the send header function as far as adding the encoding and whatnot.
Posted By: JustDave Re: Custom Page without Nav Menu? - 09/29/2002 6:32 AM
If you place that variable into the config.inc.php script it is always available to any .threads script and it is always in the "on" position so the navigation bar is displayed by default.

When you call the send_header function from a page that you do not wish to have the nav bar displayed on you can toggle that variable "off" before calling the send_header function so it is not displayed.
Posted By: JoshPet Re: Custom Page without Nav Menu? - 09/29/2002 6:41 AM

LIKE A CHARM!!!


Thanks Dave. Did exactly what you said.... and sent the
$config['navbar'] = 0
right before I sent the header for the pages I didn't want it on .... and it works!!!

Thanks Lisa and Dave for your help! I love this site.
Posted By: JustDave Re: Custom Page without Nav Menu? - 09/29/2002 6:50 AM
hehehe thanks for testing it out.

I'm going to be using this myself for IIP. I been wanting to place the nav bar links into the menu box as an option and not display the nav bar. This will do the trick quite nicely.
Posted By: Lisa_P Re: Custom Page without Nav Menu? - 09/29/2002 6:53 AM
[]Thanks Lisa[/]

For what, filling space until someone who knew the answer came along? You're welcome!
Posted By: JoshPet Re: Custom Page without Nav Menu? - 09/29/2002 6:54 AM
So kaspar asked a question in the templates forum....
he wanted to move the nav bar to a side bar sorta thing.

I didn't know how to do it.....
could he switch them off in the header...and call a custom template elsewhere in his site? I guess you've still got to figure out what nav bar... and if there's a PM link etc....

Guess I'm not ready to tackle that one after all.

I'm still learning lots... but lots is starting to make sense too.
Posted By: JoshPet Re: Custom Page without Nav Menu? - 09/29/2002 6:56 AM
[]For what, filling space until someone who knew the answer came along?[/]

I tried to do that for you earlier and broke your mod. LOL

But trying to help earns points too.
Posted By: JustDave Re: Custom Page without Nav Menu? - 09/29/2002 7:03 AM
kaspar could just use the table trick Allen used to place the .threads display inside another table.

In the navigation template start a table:

<table>
<tr>
<td>

all nav links go here

</td>
<td>








Then in the footer close the navigation table first before doing anything else.

</td>
</table>

rest of footer here.




This will throw the navigation menu into a table cell on the left hand side.
Posted By: JoshPet Re: Custom Page without Nav Menu? - 09/29/2002 7:10 AM
Cool!

You are a genius.

I'll make sure he sees this. I was clueless to help him with that when he asked me. The nav menus (used to LOL) baffle me.
Posted By: JustDave Re: Custom Page without Nav Menu? - 09/29/2002 7:18 AM
Glad I could help
Posted By: kaspar Re: Custom Page without Nav Menu? - 10/01/2002 7:33 PM
Oooh! Cool, lemme try this out
© UBB.Developers