The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Using Template hook for plugin development vb5
Hello,
I am trying to develop a plugin compatible with vBulletin5. Since vb5 allows template hooks, I am not able to use php script. Can someone tell me as to how should I execute a SQL query. And also I am trying to do the following to store the value of current loggedin user's usergroupid in 'groupid'. But I am not able to retrieve the value in it. Please provide your assistance. Code Snippet: <vb:if condition="!empty($vboptions['testing'])"> {vb:set groupid, {vb:raw bbuserinfo.usergroupid}} {vb:raw groupid} </vb:if> |
#2
|
||||
|
||||
You can use php. It just needs to be in a vb5 product and you call it with a vb:data call in the templates. You can then display info from the data array using vb:raw. Depending on simplicity of the plugin, a php module may be in order without the need for custom templates.
Here is a tutorial on developing a simple vb5 product http://www.vbulletin.com/forum/blogs/joe-d/3932614- |
#3
|
|||
|
|||
And is there any way where i can run sql queries within the template hook.
and Thank You for the reply..will try this as per the tutorials. |
#4
|
||||
|
||||
Yes there is. You have to write an extension api, then call that api from the template using {vb:data} in the template. It's fairly involved but once you understand the process, it gets really simple. I'm in the process of getting all this info together in one place but work has kicked up and I don't have much time. Maybe in a week or two, I'll get the info posted. If you're trying to do something fairly simple and specific, shoot me a PM and I'll look at writing an example code for you this evening.
|
#5
|
|||
|
|||
I was just trying to get the membergroup ids from the db of a logged in user. It would be a great help if I get a example code snippet to fire a sql query within the template hook.
Thanks for the reply..:-) |
#6
|
||||
|
||||
Quote:
Quote:
Here is an example of how to use it. This is used to get profile data for a user {vb:data postInfo, user, fetchProfileInfo, 6} postInfo is the variable the data is returned to. user is the api. fetchProfileInfo is the method being called. 6 is the userid. once this is called, you can display the data by using vb:raw. {vb:raw postInfo.usergroupid} would display the usergroup id of userid 6 |
#7
|
|||
|
|||
Ohhk...I have overcome this...Thanx a lot for the help!!
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|