MOZ
Well-known member
I've extended the user model to join some columns from another column. Issue is the value from these columns is only accessed when $visitor is used.
Eg, If I use this: {$visitor.HUN_username_styling} it shows the value
but if I use this: {$user.HUN_username_styling} it doesn't show anything
And yes the $user variable is available.
Here is how I am extending the user model:
Eg, If I use this: {$visitor.HUN_username_styling} it shows the value
but if I use this: {$user.HUN_username_styling} it doesn't show anything
And yes the $user variable is available.
Here is how I am extending the user model:
PHP:
<?php
class HtmlUserNames_Model_User extends XFCP_HtmlUserNames_Model_User
{
public function prepareUserFetchOptions(array $fetchOptions)
{
$parent = parent::prepareUserFetchOptions($fetchOptions);
$parent['selectFields'] .= ',
xf_user_hun.*';
$parent['joinTables'] .= '
LEFT JOIN xf_user_hun ON (user.user_id = xf_user_hun.user_id)';
return $parent;
}
}