Results 1 to 3 of 3

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

  1. #1
    Senior Member kontrabass is on a distinguished road
    Join Date
    Jul 2000
    Location
    Austin, TX
    Posts
    285
    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
     

  2. #2
    Senior Member kontrabass is on a distinguished road
    Join Date
    Jul 2000
    Location
    Austin, TX
    Posts
    285
    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....
     

  3. #3
    Senior Member kontrabass is on a distinguished road
    Join Date
    Jul 2000
    Location
    Austin, TX
    Posts
    285

    Solution

    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
     

Similar Threads

  1. PHP-Include headers
    By Agent Richard in forum vBulletin 3.0 How Do I and Troubleshooting Forum
    Replies: 4
    Last Post: Fri 12th Mar '04, 8:20pm
  2. Replies: 2
    Last Post: Thu 22nd Mar '01, 12:34pm
  3. [fixed] DON'T use headers-settings in the control-panel!
    By Mas*Mind in forum Pre beta 4.1 bugs
    Replies: 5
    Last Post: Fri 23rd Feb '01, 8:39am
  4. PHP Headers on main page while having specific headers for forums
    By plsoucy in forum vBulletin 1.1.x Questions
    Replies: 2
    Last Post: Fri 1st Dec '00, 9:50pm
  5. Is anyone able to implement forum-specific parsed headers???
    By kontrabass in forum vBulletin 1.1.x Bug Reports
    Replies: 2
    Last Post: Thu 21st Sep '00, 6:37pm

Bookmarks

Posting Permissions

Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts