Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
0 votes
881 views
in Q2A Core by
I'm struggling to add the user's avatar (or default if they have that selected) alongside the question slist. Adding:

$this->post_avatar($question, 'qa-q-item');

..inside the function q_list_item($question) doesn't appear to work :-/
by
When inside the question ($q-view), it displays the default avatar for the user who asked the question. How can I get this same functionality on the questions list?

1 Answer

0 votes
by

I did this before, but users complained it was cluttering up the lists... I think I just called the function qa_get_user_avatar_html() from qa-app-users.php (you need to include that file, I think)

by
Did some digging for you, looks like there are two options:

qa_get_points_to_titles()

or

global $qa_points_title_cache;

The latter is probably the way to go.  Remember, grep is your friend.
by
Recon solved doing this:

            require_once QA_INCLUDE_DIR.'qa-app-format.php';
            require_once QA_INCLUDE_DIR.'qa-app-options.php';
            $authortitle = qa_get_points_title_html($question['raw']['points'], qa_get_points_to_titles());

Thanks again! :)
by
Welcome.  I think if you use:

global $qa_points_title_cache;
$authortitle = qa_get_points_title_html($question['raw']['points'], $qa_points_title_cache);

you will save resources, since there is then no need to call external files.
by
Ahh I see. Big improvement!!
...