1 (edited by Bold Soul 2003-11-22 21:22)

Topic: Displaying forms without forums header.

I could use an assist if someone has the time...

1. What must I modify to display the forms for registration, profile and login without the forum header?  I would like the forms to appear as if they stand alone from the forums.

Thanks!

Re: Displaying forms without forums header.

Hmm, that will be a little tricky. One way of solving it is to set a variable in those scripts and then check that variable in header.php to see if the header should be displayed. The file header.php must be executed regardless of whether the header is displayed or not.

"Programming is like sex: one mistake and you have to support it for the rest of your life."

3 (edited by Bold Soul 2003-11-24 01:31)

Re: Displaying forms without forums header.

Ah...now I see...here's where my logic is off...

The forum name, description and navigation is loaded in main.tpl.  Main.tpl is loaded by header.php:

// Load the main template
$fp = fopen('include/template/main.tpl', 'r');
$tpl_main = trim(fread($fp, filesize('include/template/main.tpl')));
fclose($fp);

Now here's where I'm curious.  Say I created a main.tpl without the forum name, description and navigation and called it main_forms.tpl and used IF/ELSE.

if [filename] = register.php, login.php or profile.php, load main_forms.tpl, else load main.tpl.

I'm so not used to coding PHP (stopped coding around when ASP was new), but wouldn't this work?  A free BOLD SOUL t-shirt to anyone who can toss me an assist!

Thx!

Re: Displaying forms without forums header.

Ah...figured out a simple fix last night...

The template structure is very logical, therefore I modded the forms to use a different main template that omits the board title and navigation and named it main_forms.tpl.  I then modified header.php to load main_forms.tpl and renamed it header_forms.tpl.  Afterward, I modified register.php to require header_forms.php and the rest was simple.

Thanks Rickard!  Great code, man!!!

Re: Displaying forms without forums header.

Hehe, I'm glad it worked out :)

"Programming is like sex: one mistake and you have to support it for the rest of your life."

6 (edited by Bold Soul 2003-11-25 17:06)

Re: Displaying forms without forums header.

Kennel wrote:

Hehe, I'm glad it worked out smile

What?  You knew the answer and didn't tell me? wink  Or am I going to break something later. smile

Re: Displaying forms without forums header.

Well, we'll see :D

"Programming is like sex: one mistake and you have to support it for the rest of your life."