Global_Start, Header & Footer?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Marula
    Senior Member
    • Nov 2002
    • 329
    • 3.0.0 Gamma

    Global_Start, Header & Footer?

    Hi,

    I have searched through this forum and found one or two threads that refer to my querie, but I still don't get it.

    Here's what I want to do:

    Website header: root/header.php
    VB forums
    Website footer: root/footer.php

    I want to insert the forums inbetween my website header and footer in order to keep it in my template.

    I tried to do a hook and it failed as I have a included "menu.php" in the header part of my header.php that is located in root/pages/menu.php.

    Can anyone help me out please.

    Many Thanks

    P.s. I read these and am still confused:

    http://www.vbulletin.com/docs/html/t...pinclude_start (I know it's changed to global_start) - but it was worth a look any way.
    Last edited by Marula; Tue 27 Sep '05, 2:43pm.
  • Marula
    Senior Member
    • Nov 2002
    • 329
    • 3.0.0 Gamma

    #2
    bump

    Comment

    • Incendium
      Senior Member
      • Apr 2004
      • 321
      • 3.8.x

      #3
      As far as I know, the global_start plugin executes before the templates are outputted which may result in errors. From what I have seen in previous versions, you need to use the PHP buffer to assign the included file contents to a variable and place that variable name in the appropriate template where you want it shown.

      Try this code:

      PHP Code:
      ob_start();
      include(
      './root/header.php');
      $cust_header ob_get_contents();
      ob_end_clean();

      ob_start();
      include(
      './root/footer.php');
      $cust_footer ob_get_contents();
      ob_end_clean(); 
      That assumes that you have the file in a folder named root inside your vBulletin directory. To output this info, place the variable names ($cust_header or $cust_footer) inside the template where you want the content to appear.

      Hope this helped.

      Comment

      • Marula
        Senior Member
        • Nov 2002
        • 329
        • 3.0.0 Gamma

        #4
        Absolutly - That helped big time!

        So to clarify for this part, I need to put $cust_header or $cust_footer inside which templates (VB or my own templates) and if I need to put them inside my VB templates which ones are they?:

        That assumes that you have the file in a folder named root inside your vBulletin directory. To output this info, place the variable names ($cust_header or $cust_footer) inside the template where you want the content to appear.


        Originally posted by Incendium
        As far as I know, the global_start plugin executes before the templates are outputted which may result in errors. From what I have seen in previous versions, you need to use the PHP buffer to assign the included file contents to a variable and place that variable name in the appropriate template where you want it shown.

        Try this code:

        PHP Code:
        ob_start();
        include(
        './root/header.php');
        $cust_header ob_get_contents();
        ob_end_clean();

        ob_start();
        include(
        './root/footer.php');
        $cust_footer ob_get_contents();
        ob_end_clean(); 
        That assumes that you have the file in a folder named root inside your vBulletin directory. To output this info, place the variable names ($cust_header or $cust_footer) inside the template where you want the content to appear.

        Hope this helped.

        Comment

        • Incendium
          Senior Member
          • Apr 2004
          • 321
          • 3.8.x

          #5
          It doesn't really matter; Put them wherever you want the content to appear.

          Comment

          • Marula
            Senior Member
            • Nov 2002
            • 329
            • 3.0.0 Gamma

            #6
            put what where what content should appear? Put the $ tags in my personal homepage templates or in the VB templates?

            Comment

            • Wayne Luke
              vBulletin Technical Support Lead
              • Aug 2000
              • 74123

              #7
              You would put them in the vB templates. vBulletin has nothing to do with your personal homepage templates and any recommendations should be inferred that you will be adding them to vBulletin.
              Translations provided by Google.

              Wayne Luke
              The Rabid Badger - a vBulletin Cloud demonstration site.
              vBulletin 5 API

              Comment

              • Marula
                Senior Member
                • Nov 2002
                • 329
                • 3.0.0 Gamma

                #8
                Thank you very much all!!! one last thing which template would you recomend I put the $ tag variables into?

                Comment

                • Marula
                  Senior Member
                  • Nov 2002
                  • 329
                  • 3.0.0 Gamma

                  #9
                  bump

                  Comment

                  • Marula
                    Senior Member
                    • Nov 2002
                    • 329
                    • 3.0.0 Gamma

                    #10
                    bump

                    Can't I justn put in as an "include" in my main "root" website?

                    Comment

                    • Colin F
                      Senior Member
                      • May 2004
                      • 17689

                      #11
                      It depends where you want to display this information.
                      If you want to display it at the bottom of every page, place the variable in the $footer template.

                      Not sure what you mean in your last sentance.
                      Best Regards
                      Colin Frei

                      Please don't contact me per PM.

                      Comment

                      • Marula
                        Senior Member
                        • Nov 2002
                        • 329
                        • 3.0.0 Gamma

                        #12
                        here you go, I want to wrap my non-VB header and footer around my VB3.5 forum - see attached screenshot:
                        Attached Files

                        Comment

                        • TCM
                          Senior Member
                          • Dec 2004
                          • 477
                          • 3.0.7

                          #13
                          Just put what would come before vB in the HTML in the header template, and whatever would come after in the footer template.

                          Comment

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