Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+4 votes
1.4k views
in Plugins by

I've installed the badge plugin and it only show the badges in users page all the way at the bottom.

And everytime I check Show badge widget beside points in user meta it throws an error!!!

Notice: Undefined index: who in ............/qa-include/qa-app-format.php(1466) : eval()'d code on line 186

Does this plugin suppose to show the badge pointer next to username like in stackoverflow?

Like so:

Thanks

 

I use latest versions.

6 Answers

+1 vote
by

Yes this plugin show the badge pointer next to username like in stackoverflow 

unfortunately this plugin have an error

@gidgreen answer this quesion on 

http://www.question2answer.org/qa/22674/one-another-error-in-q2a-version-1-6-dev?show=22813#a22813

by
I know this error comes up whenever this "Show badge widget beside points in user meta" is checked.
But even when it's not checked the badge pointer doesn't show. The only place I see badges is in users page at the bottom.
+1 vote
by
Yes, it does show badges if you check that option.  Should be fixed now, but I don't think there should have been a problem with most lists, only the ones where there was no user meta.
by
thanks naohy
+3 votes
by

Ok, now the error is gone, thanks. Now it shows badge pointer on users favorite page. You have used this function to display in users page.

        function ranking($ranking) {
            
            if(@$ranking['type']=='users' && qa_opt('badge_show_users_badges')) {
                foreach($ranking['items'] as $idx => $item) {
                    $handle = preg_replace('/ *<[^>]+> */', '', $item['label']);
                    
                    if(isset($ranking['items'][$idx]['score'])) $ranking['items'][$idx]['score'] .= '</td><td class="qa-top-users-score">'.qa_badge_plugin_user_widget($handle);
                }
            }
            qa_html_theme_base::ranking($ranking);
        }

 

I want to display the badge pointer next to username. Like if a user asked a question it shows the name of the user and the time posted. How to add the badge pointer to that?

I don't know if this plugin already comes with that, but I couldn't get it display that. Even I checked everything..

0 votes
by
I also installed this plugin and shows nothing next to usernames! I checked all the options in the admin yet nothing except at user panel!
+2 votes
by

 

Find this peace of code in q2a-badges / qa-badge-layer.php

 

function post_meta_who($post, $class)
{
if (@$post['who'] && @$post['who']['data'] && qa_opt('badge_active') && (bool)qa_opt('badge_admin_user_widget') && ($class != 'qa-q-item' || qa_opt('badge_admin_user_widget_q_item')) ) {
$handle = preg_replace('|.+qa-user-link" title="@([^"]+)".+|','$1',$post['who']['data']);
$post['who']['suffix'] = (@$post['who']['suffix']).'&nbsp;'.qa_badge_plugin_user_widget($handle);
}
 
qa_html_theme_base::post_meta_who($post, $class);
}
 
Change it with this:
 

function post_meta_who($post, $class)
{
if (@$post['who'] && @$post['who']['data'] && qa_opt('badge_active') && (bool)qa_opt('badge_admin_user_widget') && ($class != 'qa-q-item' || qa_opt('badge_admin_user_widget_q_item')) ) {
$handle = preg_replace('/ *<[^>]+> */', '',$post['who']['data']);
$post['who']['suffix'] = (@$post['who']['suffix']).'&nbsp;'.qa_badge_plugin_user_widget($handle);
}

qa_html_theme_base::post_meta_who($post, $class);
}

 

0 votes
by

Hi, I get HTML raw output when this function: function ranking($ranking) {  is run... See below screen capture. 

 

I was unable to correct this bug line 257 of qa-badge-layer.php

...