PDA

View Full Version : PHP-Parsed (Adv Headers) don't work for forum-specific headers???


kontrabass
Sat 16th Sep '00, 1:17pm
I'm trying to set a different header for each forum, so that I can have multiple advert "zones" - one for each forum.

My PHP ad script works great when it's in the global (board-wide) header:

$dotBanner_file_directory = "/home/talkbass/web/dotbanner/";
include("/home/talkbass/web/dotbanner/ads-fAll.php");
$header=dotBanner_PickBanner("fAll");
srand((double)microtime()*389675);

But, when I edit a particular forum and tell it to use the "header2" template, and parse it for php (using the EXACT same code as above), I get errors up the wazzu.

I've tried changing the $header in the code above to $header2 but still no luck. It spits out a couple parsing errors, and then spits out the GLOBAL header (which it should not be doing at all...).

Thanks for your thoughts on this -

Paul

kontrabass
Sat 16th Sep '00, 1:22pm
Hmm... I'm no expert (or even a novice) at PHP, but the following in global.php looks suspicious:

// parse header ##################
if ($useadvheader==1) {
eval(gettemplate("header",0));
} else {
eval("\$header = \"".gettemplate("header")."\";");


It looks to me like if you've got the advheader turned on in the main options, your screwed if you're trying to use anything but the main $header for specific forums....

kontrabass
Thu 21st Sep '00, 3:52pm
John just sent me a message regarding this bug. Here's his solution:

This appears to be a bug. To fix it, you should search through the PHP files showthread.php, newreply.php, newthread.php, postings.php, forumdisplay.php, and editpost.php for this code:

// parse header ##################
if ($foruminfo[headertemplate]!="") {
if ($foruminfo[useadvheader]==1) {


** this is the important line: **

eval(gettemplate("$foruminfo[headertemplate]").";");

** that was the important line **


} else {
eval("\$header = \"".gettemplate("$foruminfo[headertemplate]")."\";");
}
}
if ($foruminfo[footertemplate]!="") {
if ($foruminfo[useadvfooter]==1) {


** this is the important line: **

eval(gettemplate("$foruminfo[footertemplate]").";");

** that was the important line **


} else {
eval("\$footer = \"".gettemplate("$foruminfo[footertemplate]")."\";");
}
}


Replace the two lines with:
eval(gettemplate("$foruminfo[headertemplate]"));
and
eval(gettemplate("$foruminfo[footertemplate]"));
respectively.

Thanks for letting us know about that problem.

John