Announcement

Collapse
No announcement yet.

How to add PHP code with plugins or hooks

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

  • How to add PHP code with plugins or hooks

    I've been trying to figure this out for hours and hours when it should be so simple. I just want to include some php files in the template.

    The manual for vbulletin 5 refers to "Plug Ins" but there is no use of that word in the admincp. The only thing I can find in the admincp is to disable or enable hooks. I can't find anywhere to add custom hooks or how to do it. The manual has this text:

    "
    Including a PHP file:
    1. Create a Plug-in for global_start with these contents:


    ob_start();
    include('path/to/this/file/myfile.php');
    $includedphp = ob_get_contents();
    ob_end_clean();


    Replace the path and filename with the correct path and filename of the PHP file you want to include. The code in myfile.php will execute and any output generated by this script will be stored in $includedphp.

    2. Place {vb:raw includedphp} in one of your templates, such as header, navbar, FORUMHOME, depending upon where you want the contents of your PHP file to appear.
    "


    It's hard to tell if this is even the manual for vBulletin 5 connect. There is also no way to link to the page because of the way it's designed. However, it does say "
    Next: Introduction to vBulletin 5 Connect" at the bottom of the page, so I'm pretty sure it's a vb5 connect guide.

    So after I right that code to call the php file. Where do I put it? How do I add it as a hook/plugin?

    I tried adding php code in the template, but that doesn't work. I just want to call some php files. How can I do this? Where is documentation on adding hooks with include php files? I can't find any information on this related to vbulletin 5 connect.
    Last edited by intocake; Sun 16th Nov '14, 6:38pm.

  • #2
    Those instructions are for vBulletin 4.

    vBulletin 5 has no php plugin system in that sense.
    MARK.B | vBULLETIN SUPPORT

    TalkNewsUK - My vBulletin 5.5.2 Demo
    AdminAmmo - My Cloud Demo

    Comment


    • #3
      Originally posted by Mark.B View Post
      Those instructions are for vBulletin 4.

      vBulletin 5 has no php plugin system in that sense.

      So there is no way to do it? I wasn't looking for vb4 support. I plan on using vb5. I spent hundreds of dollars on this; I expect to be able to add my own code. Please direct me to a resource on how to do this. Or at least give me a resource so I can edit the actual vb5 files and insert my own php code.

      Comment


      • #4
        This should give you a idea, http://www.vbulletin.com/forum/blogs/joe-d/3932614-

        But it is waaay different than vB4, so there is alot you can not do in vB5 like you could in vB4.
        My Mods also available at OzzModz.com

        New vBulletin Spider Definitions, vBulletin Spiders List Hits 1000 Spiders!
        Stop Spam Now The era of Big Spam is over.

        Vote to bring back hooks in vB5, http://tracker.vbulletin.com/browse/VBV-10333

        Comment


        • #5
          If you're planning heavy customisation you would be better with vB4. It has a fully fledged system for doing that and a huge resource for customisations over at vbulletin.org.

          You really don't want to be editing vB5 php files anyhow, there are upgraded versions every couple of months and upgrading would become a first class (and completely unsupported) nightmare.

          vB4 is still a current product with full support, and has recently been made compatible with the latest versions of php.
          MARK.B | vBULLETIN SUPPORT

          TalkNewsUK - My vBulletin 5.5.2 Demo
          AdminAmmo - My Cloud Demo

          Comment


          • #6
            Originally posted by Mark.B View Post
            If you're planning heavy customisation you would be better with vB4. It has a fully fledged system for doing that and a huge resource for customisations over at vbulletin.org.

            You really don't want to be editing vB5 php files anyhow, there are upgraded versions every couple of months and upgrading would become a first class (and completely unsupported) nightmare.

            vB4 is still a current product with full support, and has recently been made compatible with the latest versions of php.

            Here's the problem. I didn't put the money down to use vb4. I wanted to use vb5 connect. All I want to to is insert a couple of lines in the header and footer to wrap the board up in my site's template. Even if I edit the core files, it's such a minimal amount of changes that I could just redo it after an upgrade. I'm literally just talking about making a couple includes.

            I'm not interested in using the vb4 system. On a side note. Is there some reason why making trivial additions was excluded in vb5? The system is good, but it's so limiting. I would have never paid money for this if I knew plugins and custom code couldn't be added easily like the older versions.

            Comment


            • #7
              Originally posted by ozzy47 View Post
              This should give you a idea, http://www.vbulletin.com/forum/blogs/joe-d/3932614-

              But it is waaay different than vB4, so there is alot you can not do in vB5 like you could in vB4.

              Thanks for that link. I will start reading it now.

              Btw to all. I'm sorry if I sound rude or bitter. I'm just upset about this whole thing. The impex didn't work as stated and all I want to do is add a couple include files. My apologies for any snide comments.

              Comment


              • #8
                Originally posted by intocake View Post


                Here's the problem. I didn't put the money down to use vb4. I wanted to use vb5 connect. All I want to to is insert a couple of lines in the header and footer to wrap the board up in my site's template. Even if I edit the core files, it's such a minimal amount of changes that I could just redo it after an upgrade. I'm literally just talking about making a couple includes.

                I'm not interested in using the vb4 system. On a side note. Is there some reason why making trivial additions was excluded in vb5? The system is good, but it's so limiting. I would have never paid money for this if I knew plugins and custom code couldn't be added easily like the older versions.
                Honestly, for what you want, vB4 is the better platform. It is highly customisable.
                vB5 is a different product, I don't know the reasons but it was not built with heavy external customisation in mind.
                MARK.B | vBULLETIN SUPPORT

                TalkNewsUK - My vBulletin 5.5.2 Demo
                AdminAmmo - My Cloud Demo

                Comment


                • #9
                  Originally posted by Mark.B View Post

                  Honestly, for what you want, vB4 is the better platform. It is highly customisable.
                  vB5 is a different product, I don't know the reasons but it was not built with heavy external customisation in mind.

                  I don't think adding a custom header and footer is "heavy". It's almost entirely a style addition with the exception of a few aspect that need php (but it's just in my own header). Hopefully the link that ozzy47 provided will work for me.

                  Comment


                  • #10
                    Originally posted by intocake View Post


                    I don't think adding a custom header and footer is "heavy". It's almost entirely a style addition with the exception of a few aspect that need php (but it's just in my own header). Hopefully the link that ozzy47 provided will work for me.
                    Ultimately the choice is yours. I've given you my view based on over a decade's experience with the software.
                    Other than the link Ozzy posted there isn't much documentation for customising vB5 at the moment, so you need to bear that in mind as well. We are generally unable to provide answers on this site for the reasons already given.
                    MARK.B | vBULLETIN SUPPORT

                    TalkNewsUK - My vBulletin 5.5.2 Demo
                    AdminAmmo - My Cloud Demo

                    Comment


                    • #11
                      Originally posted by intocake View Post
                      All I want to to is insert a couple of lines in the header and footer to wrap the board up in my site's template.
                      Can you provide more detailed info on what you want to do? I may be able to help you.

                      GIPHY for vB5 AutoLinker Auto-Create Flag Report Topic Social Icons in Postbit Clear Cache Cron DragDrop Upload Topic AJAX AutoUpdate Custom Avatars Selector Stop Links in Posts...and more!

                      Comment

                      Related Topics

                      Collapse

                      Working...
                      X