• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Remove Zero Count in Moderator Bar?

DRE

Well-known member
#3
Editing the moderator_bar template and adding something like <xen:if is="{$session.moderationCounts.total} !=0"> should do it.
Okay thanks man! It was both moderationCounts and reportcounts I needed. Looks like this now:

Code:
<xen:if is="{$session.moderationCounts.total} !=0">
            <xen:if is="{$visitor.is_moderator}">
                <a href="{xen:link moderation-queue}" class="moderationQueue modLink">
                    <span class="itemLabel">{xen:phrase moderation_queue}:</span>
                    <span class="itemCount {xen:if {$session.moderationCounts.total}, 'alert'}">{$session.moderationCounts.total}</span>
                </a></xen:if></a></xen:if>
<xen:if is="{$session.reportCounts.total} !=0">                
                <a href="{xen:link reports}" class="reportedItems modLink">
                    <span class="itemLabel">{xen:phrase reported_items}:</span>
                    <span class="itemCount {xen:if {$session.reportCounts.total}, 'alert'}">{$session.reportCounts.total}</span>
                </a>
            </xen:if>
Works great!
 

DRE

Well-known member
#4
Woops. My code above does not remove the zero count, but removes the entire link.

Oh well I was getting tired of looking at it when there were no items reported anyway.
 

Trombones13

Well-known member
#5
I think moving your <xen:if> conditional in front of each "itemCount" line should do the trick.
Code:
<xen:if is="{$visitor.is_moderator}">
                <a href="{xen:link moderation-queue}" class="moderationQueue modLink">
                    <span class="itemLabel">{xen:phrase moderation_queue}:</span>
                  <xen:if is="{$session.moderationCounts.total} !=0"> <span class="itemCount {xen:if {$session.moderationCounts.total}, 'alert'}">{$session.moderationCounts.total}</span></xen:if>
</a></xen:if></a>
(Also, I think you have an extra </a> tag in there.)
 

DRE

Well-known member
#6
I think moving your <xen:if> conditional in front of each "itemCount" line should do the trick.
Code:
<xen:if is="{$visitor.is_moderator}">
                <a href="{xen:link moderation-queue}" class="moderationQueue modLink">
                    <span class="itemLabel">{xen:phrase moderation_queue}:</span>
                  <xen:if is="{$session.moderationCounts.total} !=0"> <span class="itemCount {xen:if {$session.moderationCounts.total}, 'alert'}">{$session.moderationCounts.total}</span></xen:if>
</a></xen:if></a>
(Also, I think you have an extra </a> tag in there.)
No extra </a>
I think moving your <xen:if> conditional in front of each "itemCount" line should do the trick.
Code:
<xen:if is="{$visitor.is_moderator}">
                <a href="{xen:link moderation-queue}" class="moderationQueue modLink">
                    <span class="itemLabel">{xen:phrase moderation_queue}:</span>
                  <xen:if is="{$session.moderationCounts.total} !=0"> <span class="itemCount {xen:if {$session.moderationCounts.total}, 'alert'}">{$session.moderationCounts.total}</span></xen:if>
</a></xen:if></a>
(Also, I think you have an extra </a> tag in there.)
Yup. Was gonna do that but changed my mind since I filled up the bar with some links from this edit: http://xenforo.com/community/resources/moving-visitor-tabs-to-the-moderator-bar.470/ Took away the extra </a> thanks