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

Having "titles based on user points" I see these titles in user meta even in comments that offer not much space.

It looks like that:

As you see the title "Experte VII" covers the edit button ("Bearbeiten").

I suggest - as it is done in stackoverflow - to output no user meta for comments.

 

I wanted to hack this in qa-theme-base.php, about line 1576:

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

 

but as this line outputs for Q+A+C I don't know how to check for comment.

I tried that:

if (isset($post['who']['title']) && ($post['basetype']!='C') ) // added: only output for A+Q
    $this->output('<SPAN CLASS="'.$class.'-who-title">'.$post['who']['title'].'</SPAN>');


but got:

PHP Notice: Undefined index: basetype in qa-theme-base.php on line 1576


How to check for comment?

 

Q2A version: 1.5.4

1 Answer

0 votes
by

Okay, I check against the passed CSS class now. But this might not be working in the future if classes will be changed.

For 1.5.4 this works:

                if (isset($post['who']['title']) && ($class!='qa-c-item') )
                    $this->output('<SPAN CLASS="'.$class.'-who-title">'.$post['who']['title'].'</SPAN>');

 

Maybe gidgreen can implement a better way in the next q2a-version...

...