Page 1 of 1

[SOLVED] Portal Header (Left Blocks) not on every page

PostPosted: Sun Apr 09, 2006 3:44 pm
Author: Jason Sanborn
I posted this on the other IntegraMOD site a little over a month ago. Bumped it twice, and never received an answer. I'm hoping that someone here might know the answer to this question.

IntegraMOD 1.4.0
phpBB 2.0.19
Forum Wide headers are enabled.

When navigating my site, I always want my board navigation and other left (header) blocks enabled. On most pages, they are enabled, as a result of the Forum Wide headers. The problem I have, though, is on a couple pages of the forum where the user is given "information" such as when no topics are found in a search.

I use the "Posts Since Last Visit" (which I renamed to "New Posts") heavily to see what is new on my site. If there's nothing new, then my board navigation doesn't appear. From what I could tell, it appears that the switch for portal_header isn't being called. Any ideas on why this is happening, or how I can fix it?

PostPosted: Sun Apr 09, 2006 5:33 pm
Author: Simon N
When there are no new posts the search obviously can not find anything so is told to output an error message via the language key of $lang['No_search_match']

this would be something like:
Code: Select all
else                 {                     message_die(GENERAL_MESSAGE, $lang['No_search_match']);                 }


My guess is since this is an information message only there is no need to output the page as usual.

In short this is by design and not an error. So no amount of settings changes can alter this.

However a few edits can sort this for you so]                     message_die(GENERAL_MESSAGE, $lang['No_search_match']);[/code]

BEFORE, ADD
Code: Select all
                // start proper output of page                 include($phpbb_root_path . 'includes/page_header.'.$phpEx);                 // end proper output


As said there are 3 instances and be sure to find them all and add the above code before. SAVE & CLOSE file.

The comments are just to enable deletion of changes if need be. Hope this helps.

PostPosted: Sun Apr 09, 2006 6:29 pm
Author: Jason Sanborn
Ah. Its so nice having the left panel in place even when there are "No topics or posts met your search criteria" 8)

Re: [SOLVED] Portal Header (Left Blocks) not on every page

PostPosted: Tue Apr 11, 2006 7:57 pm
Author: Helter
this would be a good addition to 141, because the error page breaks many templates with images that span from header to footer

PostPosted: Wed Apr 12, 2006 3:05 am
Author: Simon N
Did I do somethign right <img> yay for me!!! LOL

PostPosted: Wed Apr 12, 2006 9:44 am
Author: Jason Sanborn
Just a thought I had. This modification added the code to one specific area. Isn't there a code page that handles error generation? Instead of including the include before calling the error, what if the include for page_header.php and page_footer.php were included in the php page that generates the error message itself? Would that be possible, and easier to implement?

PostPosted: Wed Apr 12, 2006 10:00 am
Author: Eon
Yeah, cause when you mark all forums read, the left blocks are not there either..

PostPosted: Wed Apr 12, 2006 10:27 am
Author: Simon N
The error handling is not on one page...but its easy to add that code into all error handling sequences.

Half asleep at moment but will look at this later.

PostPosted: Sat Apr 29, 2006 9:33 pm
Author: Jason Sanborn
I found the solution to show the "header" on every page, including when message_die() is called. This is preferred over Simon's solution, as it only requires editing one file to handle all message_die() calls.

OPEN: includes/functions.php

FIND:
Code: Select all
    if(defined('HAS_DIED'))     {//+MOD]
BEFORE, ADD:[code]// Enable header variables to be used in the message_die() callinclude($phpbb_root_path . 'includes/page_header.'.$phpEx);


I've tested this locally, and am going to add it to my test site, but so far it appears to work without problem.

PostPosted: Sat Apr 29, 2006 9:44 pm
Author: Jason Sanborn
Hmmm. I actually made a mistake, the code to add should be:

Code: Select all
// Enable header variables to be used in the message_die() callif (!defined('IN_ADMIN')) {     include($phpbb_root_path . 'includes/page_header.'.$phpEx);}


Otherwise it will distort things in the ACP, which I found out after implemented on my test site. <img>

PostPosted: Mon May 01, 2006 10:22 am
Author: Jason Sanborn
<img>

This still doesn't work, and caused an error in the knowledge base. If you've added the code in either of the two previous posts, remove them. Simon's is still the best solution.