Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+1 vote
846 views
in Q2A Core by
edited by

My site is: http://nanrenwa.com/qa/

I set QA_EXTERNAL_USERS to true, because i used my owner site user system.

And now i want to use avatar.

How can i do it?

My owner user db have an email field each, i think can use gravatar if i can.

Please help, thank.

 

UPDATE:

i used qa_get_users_html function now. but can't control the size different from answer and comment.

1 Answer

+1 vote
by

It's a good question, and as per your update, qa_get_users_html(...) in qa-external-users.php is the right place to insert the Gravatar (or any other avatar).

As for the size, my recommendation would be to start with a fixed size for the avatar in your HTML, based on what you want to appear in question lists. So the HTML code might include something like: WIDTH="20" HEIGHT="20"

Then, use an advanced theme, and override the post_meta_who($post, $class) function. In your function, check if ($this->template=='question') and if so, check $post['raw']['basetype'] - based on the value of that ('Q' or 'A' or 'C'), you can do a str_replace on the HTML in $post['who']['data'], to replace WIDTH="20" HEIGHT="20" with WIDTH="40" HEIGHT="40" or whatever you want.

Once your own function is done modifying $post, call the default function via qa_html_theme_base::post_meta_who($post, $class);

Sorry there isn't currently an easier way!

by
Cool, i got this works! Thanks very much.
Looks like: http://nanrenwa.com/qa/2/
PS. I make translating Q2A in to Chinese. Check out the feedback.
by
Can't anyone make a plugin to achieve this painlessly? :-)
...