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

XF 1.4 When no reports, remove 0 bubble - styling issue

Discussion in 'Styling and Customization Questions' started by adaaamb, Oct 15, 2014.

  1. adaaamb

    adaaamb Member

    Hey,

    I'm wanting the "0" in the Report Count to be removed when there's no reports. I followed this thread: https://xenforo.com/community/threads/remove-zero-count-in-moderator-bar.29082/ - which works, but removes styling from the bubble when there's a report. I'm using a theme.

    This is what it should look like:
    [​IMG]

    This is what it looks like when I add <xen:if is="{$session.moderationCounts.total} !=0">
    [​IMG]

    It's okay, but it doesn't really catch your eye and let you know that there's a report. I wanted to remove the bubble when there's no reports, because my theme always shows the red bubble, even when there's 0 reports.

    This is my full code:
    Code:
    <xen:if is="{$session.moderationCounts.total} !=0"><strong class="itemCount {xen:if '({$session.reportCounts.total} AND {$session.reportCounts.lastUpdate} > {$session.reportLastRead}) OR {$session.reportCounts.assigned}', 'alert'}" title="{xen:if $session.reportCounts.lastUpdate, '{xen:phrase last_report_update}: {xen:datetime $session.reportCounts.lastUpdate}'}"></xen:if>
    I've tried changing it to a span and moving the if statement around, but I can't get the itemCount styling to stay visible.

    Any help appreciated :)
     
  2. Brogan

    Brogan XenForo Moderator Staff Member

    Try this:
    Code:
    <xen:if is="{$session.reportCounts.total}">
        <span class="itemCount {xen:if '({$session.reportCounts.total} AND {$session.reportCounts.lastUpdate} > {$session.reportLastRead}) OR {$session.reportCounts.assigned}', 'alert'}" title="{xen:if $session.reportCounts.lastUpdate, '{xen:phrase last_report_update}: {xen:datetime $session.reportCounts.lastUpdate}'}"><xen:if is="{$session.reportCounts.assigned}">{$session.reportCounts.assigned} / {$session.reportCounts.total}<xen:else />{$session.reportCounts.total}</xen:if></span>
    </xen:if>
    Untested so I can't guarantee how it will work in all scenarios.
     
    adaaamb likes this.
  3. adaaamb

    adaaamb Member

    Now it's displaying this:
    [​IMG]
    I also tried including the "Total" code in the if statement, but returned the same style
     
  4. Brogan

    Brogan XenForo Moderator Staff Member

    It works on my local so it's more than likely a custom style issue.
     
  5. adaaamb

    adaaamb Member

    I had a quick play with the code you provided, included the "Total" code and changed one of the the if statements and it works perfectly. Thanks!

    For anyone else having this issue with their theme:
    Code:
    <xen:if is="{$session.reportCounts.total}">
                            <strong class="itemCount {xen:if '({$session.reportCounts.total} AND {$session.reportCounts.lastUpdate} > {$session.reportLastRead}) OR {$session.reportCounts.assigned}', 'alert'}" title="{xen:if $session.reportCounts.lastUpdate, '{xen:phrase last_report_update}: {xen:datetime $session.reportCounts.lastUpdate}'}">
                       
                            <span class="Total">
                                <xen:if is="{$session.reportCounts.assigned}">
                                    {$session.reportCounts.assigned} / {$session.reportCounts.total}
                                <xen:else />
                                    {$session.reportCounts.total}
                                </xen:if>
                            </span>
                            <span class="arrow"></span>
                        </strong>
                        </xen:if>
     

Share This Page