PDA

View Full Version : Postbit - PHP


neo1211
11-25-2008, 11:28 PM
How would I go about adding dynamic PHP code into the postbit? I don't think I can do it through the style manager.

Thanks in advanced.

Edit: Also, vBulletin 3.6.5.

SEOvB
11-25-2008, 11:50 PM
You need to use the plugin system, http://vbulletin.com/docs has more information for you about how to do it.

neo1211
11-25-2008, 11:54 PM
Hate to be a pain, but where in the manual might I find it? A search for "postbit" reveals nothing interesting.

Edit: I found it, but can you point me into the right direction as to what to add in the beginning of the file so that it knows that it's a plugin for the postbit template?

SEOvB
11-26-2008, 12:07 AM
Hate to be a pain, but where in the manual might I find it? A search for "postbit" reveals nothing interesting.

Edit: I found it, but can you point me into the right direction as to what to add in the beginning of the file so that it knows that it's a plugin for the postbit template?

You just need to choose the correct hook location global_start usually always works, but you can probably find a better one be using the other locations and some testing.

neo1211
11-26-2008, 12:10 AM
You just need to choose the correct hook location global_start usually always works, but you can probably find a better one be using the other locations and some testing.
Err.
Honestly, I've never worked with plugins or anything with vBulletin, all I know is what I want to add, and where I want it (I can do the php, it's just the plugin part that messes me up)

Edit: I can't seem to get it to work, I've tried postbit_factory, postbit_start, and postbit_complete hooks, with the code: echo "Test"; - it doesn't work with any of them.
Edit2: My bad ;). The plugin system was disabled. Anyway, I can only seem to get the text to appear at the top of the page, how do I fix this?

Lynne
11-26-2008, 12:54 AM
You 'fix' it by putting the text in a variable in the plugin ($myVar = 'Test'; ) and then putting the variable in your template where you want it.