View Full Version : Using PHP within VB Templates
TMR Bac
03-10-2009, 09:44 PM
I looked around for answer and didn't see one so figured I'd ask.
I've updated my vbulletin postbit template to include a custom html link under a username next to their post easy enough.
What I want to do is calculate a count value from non-VB tables and have that number appear next to the link. I know the php code to make this happen but I have no idea where to put it. Any ideas?
Thanks!
Dan
BigJohnny
03-10-2009, 11:24 PM
you would need to put it in a plugin, at a hook near where you want the code to fire.
probably in the hook postbit_start ..... maybe postbit_complete. im not sure of which one exactly, but you can always change it if it doesnt work.
Go to your Plugins & Products > Plugin Manager > Add New Plugin - Stick your code in there.
TMR Bac
03-11-2009, 12:33 AM
Thx, I'll give that a go and see what happens.
--------------- Added 1236787619 at 1236787619 ---------------
Followup:
I created the plugin in postbit_start and called it Collection Numbers.
What code do I put in the template postbit to make the plugin appear?
--------------- Added 1236788910 at 1236788910 ---------------
Followup:
I created the plugin in postbit_start and called it collection.
What code do I put in the template postbit to make the plugin appear?
RLShare
03-11-2009, 09:02 PM
Within the plugin you would need to store any data that you want to appear in a php variable such as $myvariable, and then you would need to edit the template, in this case postbit, and place that variable name wherever you want the data to show up at.
BigJohnny
03-11-2009, 09:15 PM
what he said :) ... he got here first, but probably makes more sense than i would have lol.
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.