php include()?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • polira
    Member
    • Sep 2003
    • 62
    • 3.5.x

    php include()?

    i want to include my own header for the forums. i tried putting it in phpinclude_start and phpinclude_end but they draw before the <html> tags for vbulletin are drawn. is there a way to put the includes in the "header" template or a place that would make more sense and create well-formed HTML?

    thanks!
  • merk
    Senior Member
    • Jul 2001
    • 4149

    #2
    Using output buffering (as in the example of the default phpinclude_start) for both header and footer, to evaluate them to like, $yoursite_footer, $yoursite_header, and put them in the header template.

    Comment

    • Alex Older
      Senior Member
      • Sep 2003
      • 274
      • 3.0.3

      #3
      can you not just edit the header in the style?
      Problems with vB4? Try This Thread for answers!

      Comment

      • tubedogg
        Senior Member
        • Feb 2001
        • 13602

        #4
        You can't use PHP in the normal templates, only phpinclude_start and _end. As merk said, use output buffering to assign the output to a variable, then use the variable where you want it to show up.

        Comment

        • merk
          Senior Member
          • Jul 2001
          • 4149

          #5
          I think hunter was talking about why not just put whatever header you output from the php file into the header template, instead of my method.

          Which doesnt always work if you generate the header on the fly

          Comment

          • Alex Older
            Senior Member
            • Sep 2003
            • 274
            • 3.0.3

            #6
            Originally posted by merk
            I think hunter was talking about why not just put whatever header you output from the php file into the header template, instead of my method.

            Which doesnt always work if you generate the header on the fly

            true, but it's a lot easier than trying to work with php includes
            Problems with vB4? Try This Thread for answers!

            Comment

            • merk
              Senior Member
              • Jul 2001
              • 4149

              #7
              Not if you have code that already generates complex header and footer code.

              Comment

              • PinFX
                New Member
                • Oct 2004
                • 7

                #8
                Sorry, could you guys put an example of how to use output buffering for me?

                Comment

                widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
                Working...