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

i'm trying to show the persons avatar of who made the question in the front page,I tried to add this

$this->output('<DIV CLASS="qa-q-item-stats">');
$this->post_avatar($q_item, 'qa-q-item');
In  function q_item_main($q_item)  but it's not working... can somebody help me?
Q2A version: 1.6.3

1 Answer

+2 votes

in $q_item array you will get user's information. than you can use qa_get_user_avatar_html() function to output the avatar. Something like below

// get require data 
$flags        = $q_item['raw']['flagcount']; 
$email        = $q_item['raw']['email']; 
$handle       = $q_item['raw']['handle']; 
$avatarblobid = $q_item['raw']['avatarblobid']; 
$avatarwidth  = $q_item['raw']['avatarwidth']; 
$avatarheight = $q_item['raw']['avatarheight']; 

// output user avatar 
qa_get_user_avatar_html($flags, $email, $handle, $avatarblobid, $avatarwidth, $avatarheight, 52, false );
I couldn't be able to make it.. :s
Do I put this inside of this??

function q_item_main($q_item)
            $this->output('<DIV CLASS="qa-q-item-main">');
            $this->output('<DIV CLASS="qa-q-item-meta">');
            $this->output('<DIV class="qa-q-item-meta">');
                '<SPAN CLASS="qa-view-count-data">',
            $this->output('<span class="qa-view-count-pad">views</span>');
            $this->post_meta($q_item, 'qa-q-item');
            $this->post_tags($q_item, 'qa-q-item');
it would work there - yes...