The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Display a field value from user table
hi all,
I have added a column (fieldx) to the user table. The values are populated by an external script. What do I have to do in order to display this value (fieldx) in VB templates. Thanks |
#2
|
|||
|
|||
You need to make sure you call userfield.* in the .php file. You would do that in the same array you are calling for other user info. The array would look similiar to this.
Code:
$users = $db->query_read_slave(" SELECT user.*, usergroup.usergroupid, usergroup.title, user.options, usertextfield.*, userfield.*, IF(displaygroupid=0, user.usergroupid, displaygroupid) AS displaygroupid, infractiongroupid FROM " . TABLE_PREFIX . "usergroup AS usergroup LEFT JOIN " . TABLE_PREFIX . "user AS user ON(user.usergroupid = usergroup.usergroupid OR FIND_IN_SET(usergroup.usergroupid, user.membergroupids)) LEFT JOIN " . TABLE_PREFIX . "userfield AS userfield ON(userfield.userid = user.userid) LEFT JOIN " . TABLE_PREFIX . "usertextfield AS usertextfield ON(usertextfield.userid=user.userid) "); Code:
while ($userinfo = $vbulletin->db->fetch_array($users)) In your template, you would put $userinfo['fieldX'] where you want to display the data. Take a look at the code I have for my Showroster Hack if you want more idea's on this. I'm using a lot of extra fields in that. Good luck. |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|