Announcement

Collapse
No announcement yet.

Includes in vbull templates

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Includes in vbull templates

    Ok so im trying to integrate vbulletin with my layout... Why cant i include other files through the pages??

  • #2
    How are you trying to include them?

    Comment


    • #3
      <? include("includes/menu.php") ?>

      Comment


      • #4
        In which templates?

        You cant use PHP in vBulletin's templates.

        the 2 phpinclude templates are the only ones that will use it.

        You do not need <? ?>.

        You shouldnt echo out files like that either, There should be an example in your phpinclude_start on how to include files.

        Comment


        • #5
          well where would i find phpinclude_start??

          Comment


          • #6
            Originally posted by kaff213
            well where would i find phpinclude_start??
            In the template editor, "PHP Include Templates"

            Comment


            • #7
              ok i see the phpinclude template but cant find "php include templates" no what im trying to do is incorporate the menu off my home page which is menu.php into all of my forums pages.

              Comment


              • #8
                Originally posted by kaff213
                ok i see the phpinclude template but cant find "php include templates" no what im trying to do is incorporate the menu off my home page which is menu.php into all of my forums pages.
                I cant understand how you could not see "PHP Include Templates" listed in the template editor ? "phpinclude_start" is a template underneath the heading.

                Edit: Its called "PHP Include Code Templates".

                You need to put this in your phpinclude_start template:

                PHP Code:
                ob_start(); 
                require_once(
                "./menu.php"); 
                $custom_menu ob_get_contents(); 
                ob_end_clean(); 
                This assumes menu.php is in the same directory as your forum is. If it isnt, you would use ./../menu.php to get it from the directory below.

                You then put $custom_menu wherever you want the menu in the HEADER template.

                Comment


                • #9
                  thanks alot for you help man.

                  Comment


                  • #10
                    Originally posted by merk
                    I cant understand how you could not see "PHP Include Templates" listed in the template editor ? "phpinclude_start" is a template underneath the heading.

                    Edit: Its called "PHP Include Code Templates".

                    You need to put this in your phpinclude_start template:
                    I see a template called "phpinclude" but not "phpinclude_start template" is this the same thing?

                    Here is what I entered:

                    ob_start();
                    require("../library/includes/copyright.php");
                    $footer_clock = ob_get_contents();
                    ob_end_clean();

                    And then I tried to call the footer clock like this:

                    $footer_clock

                    But it didn't do anything.

                    If I am in the correct template, is it safe to assume you could define multiple varibales here? Or does this allow for only one template?

                    Thank you...

                    Comment


                    • #11
                      FYI I am running 2.2.6

                      Comment


                      • #12
                        I just found a posted FAQ discussion on this topic. Moving my queries there:

                        http://www.vbulletin.com/forum/showthread.php?t=30257

                        Comment


                        • #13
                          You are correct in assuimg phpinclude is the same as phpinclude_start (it was changed in vB3).

                          As for not working i am not sure why, it seems to look correct.

                          Comment


                          • #14
                            id suggest migrating to a newer version of vbulletin if possible

                            Comment


                            • #15
                              Originally posted by Faranth
                              id suggest migrating to a newer version of vbulletin if possible
                              I plan on it once version 3.0 final is released.

                              FWIW, I couldnt make it work with the template, but we inserted the code into the PHP parsed code section of the site styles and its working groovy now.

                              Thanks to my admin dude and PHP yoda Rusty for coming up with the solution.

                              Thanks

                              JW

                              Comment

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