SoloX
03-23-2007, 02:59 PM
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
Sarcoth
03-23-2007, 07:27 PM
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.
$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)
");
Your loop probably looks something like this.
while ($userinfo = $vbulletin->db->fetch_array($users))
Take note of your first variable there, $userinfo in this case.
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 (https://vborg.vbsupport.ru/showthread.php?t=141311) if you want more idea's on this. I'm using a lot of extra fields in that.
Good luck.
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.