PDA

View Full Version : $template_hook[postbit_start]


leenster
11-22-2009, 02:58 PM
question about :$template_hook[postbit_start]

Hey guys, if i wanted to add something (a database call) to that hook, where would i do that...

keep in mind that i am not a vbulletin modder, but i do know php.....

please point me in the right direction...

thanks

Lynne
11-22-2009, 03:21 PM
A template_hook is just for adding html into a template. You would actually want to use the plugin system to put in the database call and then spit the output into the $template_hook.

If you are just starting out, I'd recommended looking through the mods and finding one that is kinda like what you want (that adds something to the postbit) and looking at the code for that product.

leenster
11-22-2009, 03:36 PM
Thanks for the quick reply Lynne

im not sure where to look for something i want :)

this is what i am trying to do...

I have a table in our db that gets updated with info from battletracker.com...

in the postbit i would like to show player stats from that table....

Lynne
11-22-2009, 04:03 PM
Most likely, you would want to hook into the $post query and grab that information right then by doing a JOIN to your table.

hook location - showthread_query:
$hook_query_fields .= ",yourtable.field as field";
$hook_query_joins .= "LEFT JOIN " . TABLE_PREFIX . "yourtable ON(whatever)";And then in the postbit_display_start hook, something like:
$template_hook[postbit_start] .= 'This field:' .$post[field];Something like that. Play with it cuz I haven't tested it (obviously, since I don't have your tables).

leenster
11-22-2009, 04:28 PM
Great, thanks for your help. i will give this a try..

your the bestestest, lol