No announcement yet.

Adding PHP in template

  • Time
  • Show
Clear All
new posts

  • Adding PHP in template

    How can I add some custom PHP into one of my templates? I've taken a look at but it seems out of date. Where do I create the plugin file? There is no global_bootstrap_init_start in the hooks list either.

  • #2
    You cannot use PHP within the templates. You've never been able to use PHP in templates. What is stated in vBulletin 4's manual does not apply to vBulletin 5. You need to review the appropriate manual version.
    • vBulletin 5 doesn't support external files in the methods you're used to.
    • All hooks in vBulletin 4 are no longer valid in vBulletin 5.
    • vBulletin 5 only has template hooks. Thought these are more powerful than those in previous versions.
    • vBulletin 5 does not support PHP Plugins.
    • PHP Extension is done via API Classes in vBulletin 5.

    If you want to include external files, you'll need to use either HTML or PHP modules on the page. Include the HTML directly in the module or encapsulate it in an iframe element. For PHP modules, you'll need to use output buffering and assign it to the $output variable. If you need more information on these, please visit
    Translations provided by Google.

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


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