View Single Post
Old 03-18-2004, 07:59 PM   #4
vinyl-junkie
Purple Mole
 
Join Date: Jan 2004
Posts: 694
Perhaps I had some customized code that I forgot about. I downloaded a fresh copy of 1.8.0, set it up and configured it in a different directory on my site to test all this out, so here is a step-by-step explanation of how to do it.

Make a file called makeheadfoot.php which calls the PHP class that creates your header and footer. Here is the way I've done it.

Here is a very oversimplified example of my header/footer PHP classes.

Make a file called header.php with the following:
PHP Code:
<?php 
echo $Navigation->getHeader(); 
?>
Make a file called footer.php with the following:
PHP Code:
<?php 
echo $Navigation->getFooter(); 
?>
In search_function.php, add the following code right after the function statement:
PHP Code:
require("/path/to/makeheadfoot.php");

ob_start(); 
require(
"/path/to/header.php"); 
$my_header_file ob_get_contents(); 
ob_end_clean(); 

ob_start(); 
require(
"/path/to/footer.php"); 
$my_footer_file ob_get_contents(); 
ob_end_clean(); 
Also, find the following code in search_function.php:
PHP Code:
$t_mstrings compact('powered_by_link','title_message','phpdig_version','result_message','nav_bar','ignore_message','ignore_commess','pages_bar','previous_link','next_link','templates_links'); 
Replace it with the following code:
PHP Code:
$t_mstrings =   compact('my_header_file','my_footer_file','powered_by_link','title_message','phpdig_version','result_message','nav_bar','ignore_message','ignore_commess','pages_bar','previous_link','next_link','templates_links'); 
Be sure you remove any word wrapping in the above code.

Here is a text version of my search_function.php file so you can take a look at exactly how I did it.

In your template file, replace everything at the top, through the <body> tag with the following:
PHP Code:
<phpdig:my_header_file/> 
Replace the following code at the bottom of your template:
PHP Code:
</body>
</
html
with the following code:
PHP Code:
<phpdig:my_footer_file/> 
Here is my template with the old code commented out and the new code inserted.

Let me know if I've missed anything, and if you still have problems. I'll be glad to help.

Last edited by vinyl-junkie; 03-18-2004 at 08:02 PM.
vinyl-junkie is offline   Reply With Quote