• This forum has been archived. New threads and replies may not be made. All add-ons/resources that are active should be migrated to the Resource Manager. See this thread for more information.

Stats, Staff & Users at Forums End

  • Thread starter Thread starter bogus
  • Start date Start date
B

bogus

Guest
I made ​​this Modification because some of my users have complained about the overcrowded Sidebar :rolleyes:

Changed Locations for
  • Staff Online Now
  • Users Online Now
  • Forum Statistics
Unbenannt.webp

You can see it Live at my Site
Staff Online Now is just for registered Users

I am sure that i have not done everything correctly but a least it works. If any of you find some Error please post them here.

It would be great to have this as an addon where you just have to check some Boxes ;)
If you are using [bd] Widget Framework you just need to disable the corresponding widgets. Same for xenPorta.

Credits are going to Brogan for his Help. Much appreciated as always ;) and to Floris for a part of an Addon i was using.

If you are not using The Widget Framework log into your ACP, if you are not done yet.
Head to Appearance -> Styles -> Default Style (if not the default one change to the Style you want to work with) ->Templates

Search for forum_list and change the whole content of this Template with the following Code
Code:
<xen:h1>{$xenOptions.boardTitle}</xen:h1>

<xen:container var="$head.canonical"><link rel="canonical" href="{xen:link 'canonical:index'}" /></xen:container>
<xen:if is="{$xenOptions.boardDescription}"><xen:container var="$head.description">
    <meta name="description" content="{$xenOptions.boardDescription}" /></xen:container></xen:if>
<xen:container var="$head.openGraph">
    <xen:include template="open_graph_meta">
        <xen:set var="$url">{xen:link 'canonical:index'}</xen:set>
        <xen:set var="$title">{$xenOptions.boardTitle}</xen:set>
    </xen:include></xen:container>

<xen:hook name="forum_list_nodes">
    <xen:if is="{$renderedNodes}"><xen:include template="node_list" /></xen:if>
</xen:hook>

<xen:sidebar>
    <xen:edithint template="sidebar.css" />

    <xen:hook name="forum_list_sidebar">

        <xen:include template="sidebar_share_page">
            <xen:set var="$url">{xen:link canonical:index}</xen:set>
        </xen:include>

    </xen:hook>
</xen:sidebar>
Save and Exit

Now search for node_list and add before <xen:edithint template="node_category.css" />
Code:
<xen:include template="forum_stats" />
Save and Exit

Now click to Template in the ACP´s Menu and press the Button Create New Template

In Template Name: Must be unique add forum_stats and copy/paste the following into the empty Template´s Field
Code:
<xen:require css="forum_stats.css" />

<div class="borderwrapper">
    <div class="stats_block">
        <h3 class="blockhead">What's Going On?</h3>
        <div class="blockbody">
            <div class="stats_body">
                <h2 class="stats_title_left">{xen:phrase forum_statistics}</h2>
                <div class="pairsJustified" id="stats_content">
                <dl class="discussionCount"><dt>{xen:phrase discussions}:</dt>
                        <dd>{xen:number $boardTotals.discussions}</dd></dl>
                    <dl class="messageCount"><dt>{xen:phrase messages}:</dt>
                        <dd>{xen:number $boardTotals.messages}</dd></dl>
                    <dl class="memberCount"><dt>{xen:phrase members}:</dt>
                        <dd>{xen:number $boardTotals.users}</dd></dl>
                    <dl><dt>{xen:phrase latest_member}:</dt>
                        <dd><xen:username user="$boardTotals.latestUser" /></dd></dl>
                </div>
            </div>

<div class="stats_body">
    <xen:if is="!{$visitor.user_id}">
        <h3 class="stats_title_center"><b>Welcome to {$xenOptions.boardTitle}</b></h3>
            <div class="xenfans_font"><p class="importantMessage" style="line-height: 1.3em;">
                You're currently viewing our site as a Guest. Having an account grants you additional privileges.
                <span class="xenfans_welcome"><label for="LoginControl"><a href="{xen:link login}" class="concealed">Sign up</a></label></span> or <span class="xenfans_welcome"><label for="LoginControl"><a href="{xen:link login}" class="concealed">Login</a></label></span>
            </p></div>
    <xen:else />
        <h3 class="stats_title_center">{xen:phrase staff_online_now}</h3>
        <div id="stats_content">
            <ul>
                    <xen:foreach loop="$onlineUsers.records" value="$user">
                        <xen:if  is="{$user.is_moderator} OR {$user.is_admin} OR {$user.user_group_id} == 13 OR {$user.user_group_id} == 12">
                        <li>
                            <xen:username user="$user" class="Tooltip" title="{$user.username}, {xen:helper userTitle, $user}" />
                        </li>
                        </xen:if>
                    </xen:foreach>
            </ul>
        </div>
    </xen:if>
</div>

<div class="stats_body">
    <h3 class="stats_title_right"><a href="{xen:link online}" class="Tooltip" title="{xen:phrase see_all_online_users}">{xen:phrase members_online_now}</a></h3>
        <div id="stats_content">
            <xen:if is="{$onlineUsers.records}">
                <xen:if is="{$visitor.user_id}">
                    <xen:if hascontent="true">
                    <h4 class="minorHeading"><a href="{xen:link account/following}">{xen:phrase people_you_follow}:</a></h4>
                        <ul class="followedOnline">
                        <xen:contentcheck>
                            <xen:foreach loop="$onlineUsers.records" value="$user">
                                <xen:if is="{$user.followed}">
                                    <li title="{$user.username}" class="Tooltip"><xen:avatar user="$user" size="s" img="true" class="_plainImage" /></li>
                                </xen:if>
                            </xen:foreach>
                        </xen:contentcheck>
                        </ul>
                    <h4 class="minorHeading"><a href="{xen:link members}">{xen:phrase members}:</a></h4>
                    </xen:if>
                </xen:if>
            <ol class="listInline">
            <xen:foreach loop="$onlineUsers.records" value="$user" i="$i">
                <xen:if is="{$i} <= {$onlineUsers.limit}">
                    <li>
                        <xen:if is="{$user.user_id}">
                            <a href="{xen:link members, $user}"
                                class="username{xen:if '!{$user.visible}', ' invisible'}{xen:if {$user.followed}, ' followed'}">{$user.username}</a><xen:if is="{$i} < {$onlineUsers.limit}">,</xen:if>
                        <xen:else />
                            {xen:phrase guest}<xen:if is="{$i} < {$onlineUsers.limit}">,</xen:if>
                        </xen:if>
                    </li>
                </xen:if>
            </xen:foreach>
            <xen:if is="{$onlineUsers.recordsUnseen}">
                <li class="moreLink">... <a href="{xen:link online}" title="{xen:phrase see_all_visitors}">{xen:phrase and_x_more, 'count={xen:number $onlineUsers.recordsUnseen}'}</a></li>
            </xen:if>
            </ol>
            </xen:if>
            {xen:phrase online_now_x_members_y_guests_z, 'total={xen:number $onlineUsers.total}', 'members={xen:number $onlineUsers.members}', 'guests={xen:number $onlineUsers.guests}'}
        </div>
</div>

        </div>
    </div>
</div>

Save & Exit

Create another Template called forum_stats.css and fill it with the following Code
Code:
.borderwrapper {
  overflow: hidden;
  border: 1px solid @primaryLighter;
  border-radius: 10px;
  padding: 5px;
}
.stats_block {
    display: block;
    margin: 5px;
}
.blockhead {
    background: url('path_where_you/want_the_image_to_be/newbtn_middle.png') repeat-x @dimmedTextColor;
    border: 1px solid #606060;
    color: #FFFFFF;
    font-size: 13px;
    font-weight: bold;
    padding: 2px 5px 2px 10px;
    border-top-left-radius: 5px;
    border-top-right-radius: 5px;
}
.blockbody {
    background: url('path_where_you/want_the_image_to_be/grey_down.png') repeat-x bottom;
    border: 1px solid #C4C4C4;
    border-bottom-right-radius: 5px;
    border-bottom-left-radius: 5px;
    overflow: hidden;
}
#stats_content { font-size:11px; padding: 5px 10px; }
.xenfans_font { font-size: 10px }
.stats_body { width: 33.3%; float: left; }

.stats_title_left, .stats_title_center, .stats_title_right{
  background: url('path_where_you/want_the_image_to_be/newbtn_middle.png') repeat-x #E9E9E9;
  border-bottom: 1px solid #E0E0E0;
  color: @dimmedTextColor;
  text-align:center;
  margin: 0px;
  font-size: 11px;
  padding: 3px 10px;
}
.xenfans_welcome {
    padding: 1px 4px 2px;
    border: 1px solid @primaryLight;
    border-radius: 3px;
    background: @primaryLighterStill url('@imagePath/xenforo/gradients/tab-unselected-25px-light.png') repeat-x top;
    text-align: center;
    font: 10px verdana,sans-serif;
    color: @primaryMedium;
    outline: 0;
}
Save & Exit

Don´t forget to upload the images too. You can of course use your own ;)

Edit: You can change the Whats going on? Text to what you want, also adding it as a Phrase is possible. Useful if you run a multilanguage Board. If you have Problems just PC me

Everyone is allowed to post this Modification at his Board as long as you dont forget to post Credits for XenForo.com and myself. Please respect this.
 

Attachments

  • grey_down.webp
    grey_down.webp
    126 bytes · Views: 538
  • newbtn_middle.webp
    newbtn_middle.webp
    108 bytes · Views: 508
grey_down.png isnt empty ;) The Other one is a gradient too (just highlight them) which gives an Effect only with a Color ;)
Just as i wrote.. if you know a better Way just post it. Every Idea ist very Welcome. Also if someone is willing to Code an Addon ;)
 
this may help:
PHP:
<xen:include template="forum_stats" />
to
PHP:
<xen:if is="{$controllerName} == 'XenForo_ControllerPublic_Index' AND {$controllerAction} == 'Index'">
<xen:include template="forum_stats" />
</xen:if>
 
Would it be possible to take out the staff online section in the what's going on box and just have the statistics and the users online?

Thanks.
 
Would it be possible to take out the staff online section in the what's going on box and just have the statistics and the users online?

Thanks.

At the sidebar_online_users templates, find the following code and remove it.

HTML:
<!-- block: sidebar_online_staff -->
 
<xen:if hascontent="true">
    <div class="section staffOnline avatarList">
        <div class="secondaryContent">
            <h3>{xen:phrase staff_online_now}</h3>
            <ul>
                <xen:contentcheck>
                    <xen:foreach loop="$onlineUsers.records" value="$user">
                        <xen:if is="{$user.is_moderator} OR {$user.is_admin}">
                            <li>
                                <xen:avatar user="$user" size="s" img="true" />
                                <xen:username user="$user" rich="true" />
                                <div class="userTitle">{xen:helper userTitle, $user}</div>
                            </li>
                        </xen:if>
                    </xen:foreach>
                </xen:contentcheck>
            </ul>
        </div>
    </div>
</xen:if>
 
<!-- end block: sidebar_online_staff -->
 
At the sidebar_online_users templates, find the following code and remove it.

HTML:
<!-- block: sidebar_online_staff -->
 
<xen:if hascontent="true">
    <div class="section staffOnline avatarList">
        <div class="secondaryContent">
            <h3>{xen:phrase staff_online_now}</h3>
            <ul>
                <xen:contentcheck>
                    <xen:foreach loop="$onlineUsers.records" value="$user">
                        <xen:if is="{$user.is_moderator} OR {$user.is_admin}">
                            <li>
                                <xen:avatar user="$user" size="s" img="true" />
                                <xen:username user="$user" rich="true" />
                                <div class="userTitle">{xen:helper userTitle, $user}</div>
                            </li>
                        </xen:if>
                    </xen:foreach>
                </xen:contentcheck>
            </ul>
        </div>
    </div>
</xen:if>
 
<!-- end block: sidebar_online_staff -->

Thanks for this unforunately however it hasn't worked to take the staff online out of the stats at forums end.

I am also having another problem where it is now showing members whom I follow in the stats at the end of the forums with the avatar thumbnail. Is there anyway I can removed this also?

Thanks.
 
Top Bottom