PDA

View Full Version : custom table variable in postbit


zoro
02-22-2012, 10:34 PM
Hello,

i looked everywhere for it but just cant find it.
i got an custom table in my database called info there i got two fields:
1. userid
2. points

i want to show the points in the postbit...

i need to find a way to display every users points in the postbit below his name.

and yes i know how can i add and custom field, but its not just custom field its an custom table.

so i be glad if anyone can show me how can i get that points variable and register it in the postbit template for every user.

thanks :)

kh99
02-22-2012, 10:58 PM
Create a new plugin using hook location showthread_query and this code:

$hook_query_fields .= ", info.points";
$hook_query_joins .= " LEFT JOIN " . TABLE_PREFIX . "info AS info ON (info.userid = post.userid) ";


Then in the postbit template you should be able to use {vb:raw post.points}.

zoro
02-22-2012, 11:34 PM
thanks man!!! you are great :P
works like a charm!