XF 1.5 Remove Stats from Sidebar

E-Tool

Member
I have tried every option I could find in this community (primarily template editing) to remove "stats" from the sidebar and I have not been successful. I just purchased and installed XF 1.5 and the "Bliss" theme from ThemeHouse. I also completed a trouble ticket with them that resulted in ThemeHouse telling me it is a XF issue, not a theme issue. They did suggest using the Widget Framework add-on; however, I cannot confirm that is compatible with XF 1.5.

The forum is https://barowner.com/forum

All I really want to do is remove the stats module from unregistered users but would like to control it through permissions like all the other sidebar modules.

Thanks you in advance...
 
Thanks for the quick response Brogan, I tried that and it had no effect.

My confusion here is two-fold:

1) I'm not sure I can edit "sidebar_visitor_panel"? The reason I ask is the template is red in color with an "X" as depicted in attachment "Admin Template 1." I went through the steps to test for use of variables in the template and did not receive a "null." To further illustrate, the tabs in the template are red in color as well in the attached screen shot named "Admin Template 2."

2) The "if" statement is already being used in the template (see first line of code in attachment titled: "Admin Template 2. I seem to be caught in a vicious cycle of methods that do not accomplish the task.

I am new to XF so I apologize for the trouble if this is something very obvious...
 

Attachments

  • Admin Template 1.webp
    Admin Template 1.webp
    23.9 KB · Views: 11
  • Admin Template 2.webp
    Admin Template 2.webp
    35.7 KB · Views: 10
I have tried every option I could find in this community (primarily template editing) to remove "stats" from the sidebar and I have not been successful. I just purchased and installed XF 1.5 and the "Bliss" theme from ThemeHouse. I also completed a trouble ticket with them that resulted in ThemeHouse telling me it is a XF issue, not a theme issue. They did suggest using the Widget Framework add-on; however, I cannot confirm that is compatible with XF 1.5.

The forum is https://barowner.com/forum

All I really want to do is remove the stats module from unregistered users but would like to control it through permissions like all the other sidebar modules.

Thanks you in advance...

Maybe I should ask a specific question. If I use the "if statement" method as you propose; where do I actually put the additional conditional statements in the code below? The below code is the "sidebar_visitor_panel" template. I would like to know what the red color represents as well...


Code:
<xen:if is="{$visitor.user_id}">

<div class="section visitorPanel">
    <div class="secondaryContent">

        <xen:avatar user="$visitor" size="m" img="true" />

        <div class="visitorText">
            <h2>{xen:phrase signed_in_as_x_sidebar, 'name={xen:helper username, $visitor, 'NoOverlay'}'}</h2>
            <div class="stats">
            <xen:hook name="sidebar_visitor_panel_stats">
                <dl class="pairsJustified">{xen:if '@uix_visitorStatsIcons', '<i class="uix_icon uix_icon-comment Tooltip" title="{xen:number $visitor.message_count} {xen:phrase messages}"></i>'}<dt>{xen:phrase messages}:</dt><dd>{xen:number $visitor.message_count}</dd></dl>
                <dl class="pairsJustified">{xen:if '@uix_visitorStatsIcons', '<i class="uix_icon uix_icon-thumbsUp Tooltip" title="{xen:number $visitor.like_count} {xen:phrase likes}"></i>'}<dt>{xen:phrase likes}:</dt><dd>{xen:number $visitor.like_count}</dd></dl>
                <xen:if is="{$xenOptions.enableTrophies}"><dl class="pairsJustified">{xen:if '@uix_visitorStatsIcons', '<i class="uix_icon uix_icon-trophy Tooltip" title="{xen:number $visitor.trophy_points} {xen:phrase points}"></i>'}<dt>{xen:phrase points}:</dt><dd>{xen:number $visitor.trophy_points}</dd></dl></xen:if>
            </xen:hook>
            </div>
        </div>

    </div>
</div>

<xen:else />

<xen:comment>
<div class="section loginButton">
    <div class="secondaryContent">
        <label<xen:if is="@uix_loginTriggerStyle == 0 && @uix_loginTriggerStyle != 3"> for="LoginControl"</xen:if> id="SignupButton"><a href="<xen:if is='{$xenOptions.registrationSetup.enabled} && (@uix_loginTriggerStyle == 2 || @uix_loginTriggerStyle == 0)'>{xen:link register}<xen:else />{xen:link login}</xen:if>" class="inner{xen:if '@uix_loginTriggerStyle == 3', ' OverlayTrigger'}"{xen:if '@uix_loginTriggerStyle == 3', ' data-cacheOverlay="false"'}>{xen:if $xenOptions.registrationSetup.enabled, {xen:phrase sign_up_now}, {xen:phrase log_in}}</a></label>
    </div>
</div>
</xen:comment>

<xen:if is="@uix_loginFormSidebar">
<div class="section loginForm">
    <div class="secondaryContent">
        <h3>{xen:phrase log_in}</h3>
        <xen:include template="uix_loginForm">
            <xen:set var="$sidebarLogin">1</xen:set>
        </xen:include>
    </div>
</div>
</xen:if>

</xen:if>

<xen:include template="ad_sidebar_below_visitor_panel" />
 
Around the template code you want to be affected by the conditional statement.
Code:
<xen:if is="{$statement}">
Content
</xen:if>

I put the statements directly before and after the "div" that contains the stats code; however, the stats box remains - I tried multiple "cleared" browsers to ensure it wasn't a cache problem. Please advise...

Code:
<xen:if is="{$visitor.user_id}">

<div class="section visitorPanel">
    <div class="secondaryContent">

        <xen:avatar user="$visitor" size="m" img="true" />

        <div class="visitorText">
            <h2>{xen:phrase signed_in_as_x_sidebar, 'name={xen:helper username, $visitor, 'NoOverlay'}'}</h2>
          
            <xen:if is="{$statement}">
            <div class="stats">
            <xen:hook name="sidebar_visitor_panel_stats">
                <dl class="pairsJustified">{xen:if '@uix_visitorStatsIcons', '<i class="uix_icon uix_icon-comment Tooltip" title="{xen:number $visitor.message_count} {xen:phrase messages}"></i>'}<dt>{xen:phrase messages}:</dt><dd>{xen:number $visitor.message_count}</dd></dl>
                <dl class="pairsJustified">{xen:if '@uix_visitorStatsIcons', '<i class="uix_icon uix_icon-thumbsUp Tooltip" title="{xen:number $visitor.like_count} {xen:phrase likes}"></i>'}<dt>{xen:phrase likes}:</dt><dd>{xen:number $visitor.like_count}</dd></dl>
                <xen:if is="{$xenOptions.enableTrophies}"><dl class="pairsJustified">{xen:if '@uix_visitorStatsIcons', '<i class="uix_icon uix_icon-trophy Tooltip" title="{xen:number $visitor.trophy_points} {xen:phrase points}"></i>'}<dt>{xen:phrase points}:</dt><dd>{xen:number $visitor.trophy_points}</dd></dl></xen:if>
            </xen:hook>
            </div>
            </xen:if>
        </div>

    </div>
</div>

<xen:else />

<xen:comment>
<div class="section loginButton">
    <div class="secondaryContent">
        <label<xen:if is="@uix_loginTriggerStyle == 0 && @uix_loginTriggerStyle != 3"> for="LoginControl"</xen:if> id="SignupButton"><a href="<xen:if is='{$xenOptions.registrationSetup.enabled} && (@uix_loginTriggerStyle == 2 || @uix_loginTriggerStyle == 0)'>{xen:link register}<xen:else />{xen:link login}</xen:if>" class="inner{xen:if '@uix_loginTriggerStyle == 3', ' OverlayTrigger'}"{xen:if '@uix_loginTriggerStyle == 3', ' data-cacheOverlay="false"'}>{xen:if $xenOptions.registrationSetup.enabled, {xen:phrase sign_up_now}, {xen:phrase log_in}}</a></label>
    </div>
</div>
</xen:comment>

<xen:if is="@uix_loginFormSidebar">
<div class="section loginForm">
    <div class="secondaryContent">
        <h3>{xen:phrase log_in}</h3>
        <xen:include template="uix_loginForm">
            <xen:set var="$sidebarLogin">1</xen:set>
        </xen:include>
    </div>
</div>
</xen:if>

</xen:if>

<xen:include template="ad_sidebar_below_visitor_panel" />
 
Wrong template, check forum list:

Screenshot_7.webp

Wrap this conditional:
Code:
<xen:if is="{$visitor.user_id}">codehere</xen:if>

around that red boxed code to show that block only to logged in users.
 
Back
Top Bottom