Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+3 votes
463 views
in Q2A Core by

I am trying in vain to add user location ( custom field) below  name on users page to the following code from "qa-page-users.php"

if (count($users)) {
foreach ($users as $userid => $user)
$qa_content['ranking']['items'][]=array(
'label' =>
(QA_FINAL_EXTERNAL_USERS
? qa_get_external_avatar_html($user['userid'], qa_opt('avatar_users_size'), true)
: qa_get_user_avatar_html($user['flags'], $user['email'], $user['handle'],
$user['avatarblobid'], $user['avatarwidth'], $user['avatarheight'], qa_opt('avatar_users_size'), true)
),
'score' => qa_html(number_format($user['points'])),
 
'name'=> $usershtml[$user['userid']],
 
'title' => qa_get_points_title_html($user['points'], qa_get_points_to_titles()),
'location'=> qa_html($user['title']['location']),
);

 

i have tried to add the line above ( red color) but didn't work it keeps showing me undefined variable error. should i retrieve custom user fields differently ? what am i doing wrong ?

Thousand thanks !

Q2A version: latest
by
Did you solve this problem? if so, please share your knowledge. Thx

Please log in or register to answer this question.

...