PDA

View Full Version : How to use php code in the footer.........


TechTalk
Sat 5th Aug '00, 6:07pm
IC the option for it in the general settings in the cp but every time I try to use it I get a parse error from global.php on line 756.

I guess im a little confused where it says:

Parse header as PHP code. In this case, the footer variable must be specifically set in the footer template. An example would be this:

//--Start footer template--
$footer = "<p>This is a copyright notice</p>";
//--End footer template

The code can be used to dynamically choose adverts, include another file.


How would I simply put an include() call to another file in the footer?

<?php include("/www/extremeforums/include/footer.inc.php");?>


Any help is appreciated

~Chris

Mike Sullivan
Sat 5th Aug '00, 7:11pm
Almost correct, just drop the <?php and ?>:

include("/www/extremeforums/include/footer.inc.php");

Please note one thing though - vB has to parse the header/footer before it echoes out the page. Thus, if your inc just has "echo"/"print" statements, they will be printed out before the actual message board will be.

Change those to be this:

OLD:
echo "this is my footer.";

NEW:
$footer = "this is my footer.";

HTH,