Hello , how to test if a user is expert or more ?
I want to add a verified badge if the user is expert or more and I'm looking at this function now:
function qa_get_one_user_html($handle, $microformats=false, $favorited=false){ .... return '<a href="'.$url.'" class="qa-user-link'.$favclass.$mfclass.'">'.qa_html($handle).'</a>'; }
function qa_get_one_user_html($handle, $microformats=false, $favorited=false){
....
return '<a href="'.$url.'" class="qa-user-link'.$favclass.$mfclass.'">'.qa_html($handle).'</a>';
}
You could do something like this before the return:
// For qa_db_select_with_pending, qa_db_user_account_selectspec require_once QA_INCLUDE_DIR . 'db/selects.php'; $account = qa_db_select_with_pending(qa_db_user_account_selectspec($handle, false)); if (isset($account) && $account['level'] >= QA_USER_LEVEL_EXPERT) { $handle .= ' (expert+)'; }
The appended text is just for a quick and visual reference. You should add whatever HTML you need.
Welcome to the Q&A site for Question2Answer.
If you have a question about Q2A, please ask here, in English.
To report a bug, please create a new issue on Github or ask a question here with the bug tag.
If you just want to try Q2A, please use the demo site.