Hướng dẫn Tạo thống kê Xenforo ở Footer với phong cách màu mè xì teen

NDK

MasterSergeant
Tham gia
16/03/2015
Bài viết
830
Được Like
743
Trước có bạn hỏi mà giờ mình tìm lại không thấy post đó đâu cả, tìm bài hướng dẫn cũ cũng không thấy nên mình tạo post mới. Bài viết này sẽ hướng dẫn các bạn tạo thống kê dưới Footer cho diễn đàn, có cả tùy chỉnh màu nick cho từng group user khác nhau theo ý thích của các bạn
DEMO ( sợ lâu nên tạo mới cái xen rỗng làm demo, cái bộ code cũ của mình up chưa kịp, hí hí giggle~~)
Screenshot (93).png


1./ Vào ACP-->Templates--> Tạo template mới footer_stats, copy toàn bộ nội dung dưới
PHP:
<xen:require css="footer_stats.css" />
<div id="board_stats" class="breadBoxBottom">
    <ul class="ipsType_small ipsList_inline">
        <span class="value">{xen:number $boardTotals.discussions}</span>{xen:phrase discussions}
        <span class="value">{xen:number $boardTotals.messages}</span>{xen:phrase messages}
        <span class="value">{xen:number $boardTotals.users}</span>{xen:phrase members_count}
        <span class="value"><xen:username user="$boardTotals.latestUser" /></a></span>{xen:phrase latest_member}
    </ul>
</div>
<div class="borderwrapper">
    <div class="stats_body">
        <h3 class="stats_title_right"><a href="online/" class="Tooltip" title="See all online users">{xen:phrase online_now_x_members_y_guests_z_robots_a, 'total={xen:number $onlineUsers.total}', 'members={xen:number $onlineUsers.members}', 'guests={xen:number $onlineUsers.guests}', 'robots={xen:number $onlineUsers.robots}'}</a></h3>
            <div id="stats_content"> 
            <xen:if is="{$onlineUsers.records}">
            <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'}">{xen:helper richUserName, $user}</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>
        <br />
        <ul>
            <li>
<marquee onmouseout="this.start()" onmouseover="this.stop()" scrolldelay="25" truespeed="" loop="true" direction="left" scrollamount="2">
                <span style="font-weight: bold; color: yellow; text-shadow: 0px 0px 0px rgb(17, 17, 17), 0px 0px 0.5em red, 0px 0px 0.4em red;">Quản Trị Viên</span></a> |
                <span style="font-weight: bold; color: white; text-shadow: 0px 0px 0px rgb(17, 17, 17), 0px 0px 0.5em red, 0px 0px 0.4em red;">Trợ Lý Quản Trị</span></a> |       
                <span style="font-weight: bold; color: yellow; text-shadow: 0px 0px 0px rgb(17, 17, 17), 0px 0px 0.5em green, 0px 0px 0.4em green;">Điều Hành Cấp Cao</span> |
                <span style="font-weight: bold; color: white; text-shadow: 0px 0px 0px rgb(17, 17, 17), 0px 0px 0.5em green, 0px 0px 0.4em green;">Điều Hành Viên</span> |
                <span style="color: white; text-shadow: 0px 0px 0px rgb(17, 17, 17), 0px 0px 0.5em blue, 0px 0px 0.4em blue; font-weight: bold;">Thành Viên</span> |
                <span style="color: violet; font-weight: bold;">Bots</span>
            </marquee>
</li>
        </ul>
        </div>
    </div>
</div>

2./ Tạo mới template với tên footer_stats.css, copy nội dung bên dưới:
PHP:
#board_stats ul {
   text-align: center;
}
#board_stats li {
    margin-right: 20px;
}
#board_stats .value {
    background: none repeat scroll 0 0 url(rgba.php?r=0&g=0&b=0&a=25); background: none repeat scroll 0 0 rgba(0, 0, 0, 0.1); _filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#19000000,endColorstr=#19000000);
    border-radius: 3px 3px 3px 3px; -webkit-border-radius: 3px 3px 3px 3px; -moz-border-radius: 3px 3px 3px 3px; -khtml-border-radius: 3px 3px 3px 3px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3) inset, 0 1px 0 #FFFFFF; -webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3) inset, 0 1px 0 #FFFFFF; -moz-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3) inset, 0 1px 0 #FFFFFF; -khtml-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3) inset, 0 1px 0 #FFFFFF;
    color: #222222;
    display: inline-block;
    font-weight: bold;
    margin-right: 3px;
    padding: 3px 7px;
    text-shadow: 0 0 0 transparent, 0 1px 0 rgba(255, 255, 255, 0.6);
}
.borderwrapper {
    overflow: hidden;
    border: 1px solid
    rgb(215, 215, 215);
    border-radius: 10px;
    -webkit-border-radius: 10px;
    -moz-border-radius: 10px;
    -khtml-border-radius: 10px;
    padding: 5px;
}
.stats_body {
    width: 100%;
    float: left;
}
.stats_title_left, .stats_title_center, .stats_title_right {
    overflow: hidden;
    background:
    #F7F7F7;
    border-bottom: 1px solid
    #E0E0E0;
    color:
    rgb(100,100,100);
    text-align: left;
    margin: 0px;
    font-size: 11px;
    font-weight: bold;
    padding: 3px 10px;
}
#stats_content {
    font-size: 11px;
    padding: 5px 10px;
}

3./ Mở template forum_list, tìm đoạn :
PHP:
<xen:hook name="forum_list_nodes">
   <xen:if is="{$renderedNodes}"><xen:include template="node_list" /></xen:if>
</xen:hook>
Thêm vào dưới đó đoạn code:
PHP:
<xen:include template="footer_stats" />

Chúc thành công ! mọi thắc mắc xin để lại comment ạ :D
 

Hướng dẫn sử dụng

XenForo 1 XenForo 2
Translate by PVS

Dịch vụ XenForo của VNXF

Mr. Tuấn

Mobile/Zalo: 0988 488 096

Telegram: bluekpro

Email: [email protected]

Nhà Tài Trợ

Mút Xốp Không Gian
pallet Thịnh Phát
Top Bottom