Announcement

Collapse
No announcement yet.

How to add PHP code with plugins or hooks

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
    Glenn Vergara
    Former vBulletin Developer

  • Glenn Vergara
    replied
    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.

    Leave a comment:

  • Mark.B
    vBulletin Support

  • Mark.B
    replied
    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.

    Leave a comment:

  • intocake
    Member

  • intocake
    replied
    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.

    Leave a comment:

  • Mark.B
    vBulletin Support

  • Mark.B
    replied
    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.

    Leave a comment:

  • intocake
    Member

  • intocake
    replied
    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.

    Leave a comment:

  • intocake
    Member

  • intocake
    replied
    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.

    Leave a comment:

  • Mark.B
    vBulletin Support

  • Mark.B
    replied
    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.

    Leave a comment:

  • ozzy47
    Senior Member

  • ozzy47
    replied
    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.

    Leave a comment:

  • intocake
    Member

  • intocake
    replied
    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.

    Leave a comment:

  • Mark.B
    vBulletin Support

  • Mark.B
    replied
    Those instructions are for vBulletin 4.

    vBulletin 5 has no php plugin system in that sense.

    Leave a comment:

  • intocake
    Member

  • intocake
    started a topic How to add PHP code with plugins or hooks

    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.
    intocake
    Member
    Last edited by intocake; Sun 16 Nov '14, 7:38pm.

Related Topics

Collapse

Working...
X