Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.

how can we display user's email domain next to his name

+1 vote
426 views
asked Sep 2, 2014 in Q2A Core by Waterfr Villa
I wanna show the user's email domain next to his name. How can i do that?
E.g. if the users emsil is john.morgan@sympatica.com i wanna didplay "sympatica.com" next to his name
Thank you in advance
commented Sep 2, 2014 by pupi1985
You mean in the same way as in http://www.question2answer.org/qa/37875 ? Or somewhere else?
commented Sep 4, 2014 by Waterfr Villa
Hello,
To display the email same location as depicted in that question's image mockup

1 Answer

0 votes
answered Sep 4, 2014 by pupi1985
selected Sep 4, 2014 by Waterfr Villa
 
Best answer

The answer is similar to the one in the comment. Edit file qa-include/qa-app-format.php and change:

if (isset($postuserid) && isset($usershtml[$postuserid])) {
    $whohtml=$usershtml[$postuserid];
    if ($microformats)
        $whohtml='<span class="vcard author">'.$whohtml.'</span>';
    $userinfo = qa_db_select_with_pending(qa_db_user_account_selectspec($postuserid, true));
    $domain = array_pop(explode('@', $userinfo['email']));
    $whohtml .= ' ' . $domain;
} else {
 
Note this will work only if external users is disabled.
...