No announcement yet.

Is it possible to use includes in the templates?

  • Filter
  • Time
  • Show
Clear All
new posts

  • Is it possible to use includes in the templates?


    I need to use a php include to show some ads on my forum. So I tried to just put the include in the footer template, but it won't show up on the site.

    The include looks like this:

    <? include ("display.php"); ?>

    Isn't it possible to use these kind of includes in the templates?

  • #2
    No, it is not possible to use an include directly inside of templates.

    You will need to make use of the plugin system. I suggest visiting for help.


    • #3
      Read this also:



      • #4
        Jusy FYI, to the dev team, I expect to see <include x.php> to be a viable addition to templates in the Editing manager by the next release, its obviously needed.


        • #5
          Don't expect it.
          And it is not "obviously" needed.

          Templates are for displaying HTML and conditionals are for filtering what is displayed.

          For adding PHP code, there is the Plugin system. Please see my tutorial that Bob Isaac pointed to.

          I think if it is made really easy to include PHP files, then the number of headaches for vBulletin tech support are going to go through the roof. Imagine inexperienced site administrators including such files as the core function files of other scripts. The variables will write over top of vBulletin and cause a host of problems including data loss. It is not currently possible to cause data loss by pasting something into a template and I think it would be a bad move to change that. Think of a new site administrator that downloads a PHP file that performs powerful MySQL queries that alter the structure of the database or provide access to outsiders. It should give a site administrator pause before they include any PHP file they stumble upon.

          Including PHP files should be a rare thing where someone has specifically written an add-on file for vBulletin that is both aware and mindful of vBulletin's functions, variables, and global scope.
          Last edited by feldon23; Wed 15 Mar '06, 8:23am.


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