1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Anyone able to use phpincludes for a header?

Discussion in 'Forum Management' started by Roze, Jan 22, 2006.

  1. #1
    Hi all,

    Just upgraded to VB 3.5 and I am completely lost with the hook things.

    With VB 3.0.8, I was able to put my includes in the phpinclude_start template in the format below and just pull the variables into the appropriate templates. Now I understand I'm supposed to create a hook in the global_start but how do I pull these variables into the templates?

    Thanks in advance and green rep for your help!

    ob_start();
    include('../newtheme/forums.php');
    $cssoff = ob_get_contents();
    ob_end_clean();

    ob_start();
    include('../newtheme/head.php');
    $myhead = ob_get_contents();
    ob_end_clean();

    ob_start();
    include('../newtheme/outsideheader.php');
    $myside = ob_get_contents();
    ob_end_clean();

    ob_start();
    include('../newtheme/selectdb.php');
    $killdb = ob_get_contents();
    ob_end_clean();

    ob_start();
    require('../newtheme/footermessage.php');
    $footermessage = ob_get_contents();
    ob_end_clean();

    ob_start();
    require('../newtheme/feeds.php');
    $announcement = ob_get_contents();
    ob_end_clean();
     
    Roze, Jan 22, 2006 IP
  2. nevetS

    nevetS Evolving Dragon

    Messages:
    2,544
    Likes Received:
    211
    Best Answers:
    0
    Trophy Points:
    135
    #2
    global start sounds like the right place. the ob_start() and ob_get_contents() lines are a little confusing to me - there's nowhere that's executing code, so ob_get_contents should be null - maybe I'm missing something here, but just a thought as I peruse the forums... maybe you want to use eval() to execute the php includes prior to ob_get_contents.
     
    nevetS, Jan 22, 2006 IP