Add usergroups to Staff online now - Thêm các usergroup vào Staff online now

PVS

Super Moderator
Thành viên BQT
Code hoặc hướng dẫn này được sử dụng trên phiên bản Xenforo cũ đã quá hạn sử dụng. Bạn hãy click để tìm bản mới hơn
Add usergroups to Staff online now - Thêm các usergroup vào Staff online now

Mô tả: Bạn có thể thêm vào nhóm người dùng đến sidebar "staff online now" mà không cho họ permissions hoặc quyền quản trị.

!!!CHÚ Ý!!!:

Nó hoạt động với các nhóm người dùng primary và secondary

Hướng dẫn:
  1. Vào template "sidebar_online_users"
  2. Tìm:
    Mã:
    <xen:if is="{$user.is_moderator} OR {$user.is_admin}">
  3. Thêm ngay vào sau:
    Mã:
     OR {$user.user_group_id} == 7 OR {$user.user_group_id} == 15 OR {$user.user_group_id} == 5
  4. Thay id group thành id group trên trang của bạn.
Khi bạn đã hoàn thành, nó sẽ như thế này:
Mã:
<xen:if is="{$user.is_moderator} OR {$user.is_admin} OR {$user.user_group_id} == 7 OR {$user.user_group_id} == 15 OR {$user.user_group_id} == 5">

Cho secondary user groups:
Làm lại các bước 1-4, nhưng bạn phải sử dụng mã này:
Mã:
{$user.secondary_group_ids} == 19

Chúc các bạn thành công.


Nguồn: xenforo.com​
 
cho mình hỏi code của mình thế này tìm hoài ko đc
bạn code fix dùm mình đc ko

Mã:
/* sidebar structural elements */

.mainContainer
{
     float: left;
     margin-right: -{xen:calc 'intval(@sidebar.width) + 10'}px;
     width: 100%;
}

    .mainContent
    {
        margin-right: {xen:calc 'intval(@sidebar.width) + 10'}px;
    }

.sidebar
{
    float: right;
    @property "sidebar";
    font-size: 11px;
    width: 250px;
    @property "/sidebar";
}







/* visitor panel */

.sidebar .visitorPanel
{
    overflow: hidden; zoom: 1;
}

    .sidebar .visitorPanel h2 .muted
    {
        display: none;
    }

    .sidebar .visitorPanel .avatar
    {
        @property "visitorPanelAvatar";
        margin-right: 5px;
        float: left;
        @property "/visitorPanelAvatar";
        
        width: auto;
        height: auto;
    }
    
        .sidebar .visitorPanel .avatar img
        {
            width: @visitorPanelAvatar.width;
            height: @visitorPanelAvatar.height;
        }
    
    .sidebar .visitorPanel .username
    {
        @property "visitorPanelUsername";
        font-weight: bold;
        font-size: 11pt;
        @property "/visitorPanelUsername";
    }
    
    .sidebar .visitorPanel .stats
    {
        @property "visitorPanelStats";
        margin-top: 2px;
        @property "/visitorPanelStats";
    }
    
    .sidebar .visitorPanel .stats .pairsJustified
    {
        line-height: normal;
    }













    
/* generic sidebar blocks */
        
.sidebar .section .primaryContent   h3,
.sidebar .section .secondaryContent h3,
.profilePage .mast .section.infoBlock h3
{
    @property "sidebarBlockHeading";
    font-size: 12pt;
    color: @primaryLight;
    padding-bottom: 2px;
    margin-bottom: 5px;
    border-bottom: 1px solid @primaryLighterStill;
    @property "/sidebarBlockHeading";
}

.sidebar .section .primaryContent   h3 a,
.sidebar .section .secondaryContent h3 a
{
    @property "sidebarBlockHeading.font";
    font-size: 12pt;
    color: @primaryLight;
    @property "/sidebarBlockHeading.font";
}

.sidebar .section .secondaryContent .footnote,
.sidebar .section .secondaryContent .minorHeading
{
    @property "sidebarBlockFootnote";
    color: @primaryLight;
    margin-top: 5px;
    @property "/sidebarBlockFootnote";
}

    .sidebar .section .secondaryContent .minorHeading a
    {
        color: @sidebarBlockFootnote.color;
    }












/* list of users with 32px avatars, username and user title */

.sidebar .avatarList li
{
    @property "sidebarAvatarListItem";
    margin: 5px 0;
    overflow: hidden;
    zoom: 1;
    @property "/sidebarAvatarListItem";
}

    .sidebar .avatarList .avatar
    {
        @property "sidebarAvatarListAvatar";
        margin-right: 5px;
        float: left;
        width: 32px;
        height: 32px;
        @property "/sidebarAvatarListAvatar";
        
        width: auto;
        height: auto;
    }
        
    .sidebar .avatarList .avatar img
    {
        width: @sidebarAvatarListAvatar.width;
        height: @sidebarAvatarListAvatar.height;
    }
    
    .sidebar .avatarList .username
    {
        @property "sidebarAvatarListUsername";
        font-size: 11pt;
        margin-top: 2px;
        display: block;
        @property "/sidebarAvatarListUsername";
    }
    
    .sidebar .avatarList .userTitle
    {
        @property "sidebarAvatarListUserTitle";
        color: @mutedTextColor;
        @property "/sidebarAvatarListUserTitle";
    }









/* list of users */

.sidebar .userList
{
}

    .sidebar .userList .username
    {
        @property "sidebarUserListUsername";
        font-size: 11px;
        @property "/sidebarUserListUsername";
    }

    .sidebar .userList .username.invisible
    {
        @property "sidebarUserListUsernameInvisible";
        color: @primaryLightish;
        @property "/sidebarUserListUsernameInvisible";
    }
    
    .sidebar .userList .username.followed
    {
        @property "sidebarUserListUsernameFollowed";

        @property "/sidebarUserListUsernameFollowed";
    }

    .sidebar .userList .moreLink
    {
        display: block;
    }
    
    
    
    
/* people you follow online now */

.followedOnline
{
    @property "sidebarFollowedUsers";
    margin-top: 3px;
    margin-bottom: -5px;
    overflow: hidden;
    zoom: 1;
    @property "/sidebarFollowedUsers";
}

.followedOnline li
{
    @property "sidebarFollowedUsersItem";
    margin-right: 5px;
    margin-bottom: 5px;
    float: left;
    @property "/sidebarFollowedUsersItem";
}

    .followedOnline .avatar
    {
        @property "sidebarFollowedUsersAvatar";
        width: 32px;
        height: 32px;
        @property "/sidebarFollowedUsersAvatar";
        
        width: auto;
        height: auto;
    }
    
        .followedOnline .avatar img
        {
            width: @sidebarFollowedUsersAvatar.width;
            height: @sidebarFollowedUsersAvatar.height;
        }
    
    
    

    
    
/* call to action */

#SignupButton
{
    @property "signupButton";
    background-color: white;
    padding: 3px;
    margin: 10px 30px;
    border: 1px solid @secondaryLight;
    border-radius: 8px;
    text-align: center;
    line-height: 30px;
    box-shadow: 0px 2px 5px rgba(0,0,0, 0.2);
    display: block;
    cursor: pointer;
    height: 30px;
    @property "/signupButton";
}

    #SignupButton .inner
    {
        @property "signupButtonInner";
        font-weight: bold;
        font-size: 12pt;
        font-family: @button.font-family;
        color: @textCtrlBackground;
        background: @secondaryMedium url('@imagePath/xenforo/gradients/form-button-white-25px.png') repeat-x center -7px;
        border-radius: 4px;
        display: block;
        text-shadow: 0px 0px 3px rgba(0,0,0, 0.5);
        @property "/signupButtonInner";
    }
    
    #SignupButton:hover .inner
    {
        @property "signupButtonHover";
        text-decoration: none;
        background-color: @secondaryLight;
        @property "/signupButtonHover";
    }
    
    #SignupButton:active
    {
        @property "signupButtonActive";
        box-shadow: 0 0 3px rgba(0,0,0, 0.2);
        /*position: relative;
        top: 2px;*/
        @property "/signupButtonActive";
    }

<xen:if is="@enableResponsive">
@media (max-width:@maxResponsiveWideWidth)
{
    .Responsive .mainContainer
    {
         float: none;
         margin-right: 0;
         width: auto;
    }

        .Responsive .mainContent
        {
            margin-right: 0;
        }
    
    .Responsive .sidebar
    {
        float: none;
        margin: 0 auto;
    }

        .Responsive .sidebar .visitorPanel
        {
            display: none;
        }
}

@media (max-width:340px)
{
    .Responsive .sidebar
    {
        width: 100%;
    }
}
</xen:if>
 
Back
Top