Quote:
Originally Posted by Bundschuh
TI tried to get the custom field with
PHP Code:
$vbulletin->db->query_first('SELECT `field5` AS realname FROM `'.TABLE_PREFIX.'userfield` AS uf LEFT JOIN `'.TABLE_PREFIX.'user` AS u ON u.`userid` = uf.`userid` WHERE u.`userid` = ' . $touser['userid'])
but its pretty slow.
|
If you have the userid and just want field5, you don't really need a join, just SELECT field5 FROM userfield WHERE userid = $touser['userid'].
Quote:
Also I can't simply str_replace the username in the template with the fetched custom field because the template will be rendered after the hook location .
So I have to use the loaded template in array $evalemail[$touser['languageid']] and write back my changes...
|
Hmm..yeah, that's a problem. I was thinking you were just going to edit the phrase and put in $touser['realname'] or something.