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

I have this function in qa-theme.php to override the main function in qa-base-theme.php.

    function post_meta_who($post, $class)
        {

                
            if (isset($post['who'])) {
                $this->output('<SPAN CLASS="'.$class.'-who"><br />');
                
        
                                    
                                    if (isset($post['avatar'])) {
                if (isset($prefix))
                    $this->output($prefix);

                $this->output('<SPAN CLASS="'.$class.'-avatar">', $post['avatar'], '</SPAN>');
            }
                
                if (isset($post['who']['data']))
                    $this->output('<SPAN CLASS="'.$class.'-who-data">'.$post['who']['data'].'</SPAN>');
                
                if (isset($post['who']['title']))
                    $this->output('<SPAN CLASS="'.$class.'-who-title">'.$post['who']['title'].'</SPAN>');
                    
                // You can also use $post['level'] to get the author's privilege level (as a string)
    
                if (isset($post['who']['points'])) {
                    $post['who']['points']['prefix']=''.$post['who']['points']['prefix'];
                    $post['who']['points']['suffix'].='';
                    $this->output_split($post['who']['points'], $class.'-who-points');
                }
                
                if (strlen(@$post['who']['suffix']))
                    $this->output('<SPAN CLASS="'.$class.'-who-pad">'.$post['who']['suffix'].'</SPAN>');
    
                $this->output('</SPAN>');
            }
            
   }

After I installed the badge plugin I saw this function

        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);
        }

 

does this function suppose to add badge pointer next to username? Because it's not working for me.

 

1 Answer

0 votes
by
I guess you are using Badge plugin. If that's the case than this may can happen by adding badge pluing's point function to your function or may be directly into the plugin layer.
by
I am using the badge plugin. The problem is it's not showing the badge pointer where I want it to be.
For example  I could be able to add it next to username.
answered 2 hours ago by jatin.soni [badge pointer here]
...