Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+1 vote
609 views
in Q2A Core by
I was wondering, how can I remove the brackets from the category counts?

I have categorymenu in the sidepanel, but I dont like the brackets that are around the numbers...

I have pinpointed the following piece of code:

___________

            if (strlen(@$navlink['note']))
                $this->output('<SPAN CLASS="qa-'.$class.'-note">'.$navlink['note'].'</SPAN>');

___________

 

the counts are given by $navlink['note']

but this isn't raw data, it includes also the brackets... I don't want that...

1 Answer

0 votes
by

The best way is to use an advanced theme which overrides the appropriate function and uses strtr(...) on $navlink['note'] to remove the brackets. It can then call through to the default function using PHP's :: notation.

by
Oh well, in the end I have used something similiar:

_____________________________

$catcount = substr(@$navlink['note'], 1); //remove first character or bracket
$catcount = substr($catcount, 0, -1);  //remove last character or bracket

if (strlen(@$navlink['note']))
    $this->output('<SPAN CLASS="qa-'.$class.'-note">'.$catcount.'</SPAN>');
}
_____________________________


This removed the brackets.

That code has to be placed just after the else statement in function nav_link in the advanced theme.
...