Thứ Bảy, 24 tháng 11, 2012

Show user is online Tạo ribbon hiển thị online/offline



Điều kiện là phải cài Online Status rồi mới làm
Demo cho cái Classic ribbon
[IMG]

Classic ribbon
Open 'message_user_online' template and replace the string there with:

<span class="{$userStatus.class}"><span></span>{$userStatus.text}</span>
Open 'extra.css' and add these lines:
.UserOnline, .UserOffline, .UserOnlineInvisible
    {
        font-weight: bold;
        font-size: 10px;
        color: @contentBackground;
        background: @primaryLight url('@imagePath/xenforo/gradients/category-23px-light.png') repeat-x top;
        padding: 1px 5px;
        margin: -5px -5px 5px 5px;
        border: 1px solid @primaryLight;
        border-radius: 3px;
        border-top-right-radius: 0px;
        display: block;
        float: right;
        position: relative;
        box-shadow: 1px 1px 3px rgba(0,0,0, 0.25);

        margin-left: -{xen:calc '@content.padding-right + 5'}px;
    }

        .UserOnline span, .UserOffline span, .UserOnlineInvisible span
        {
            background-color: @primaryLight;
            border-top-right-radius: 3px;
            position: absolute;
            top: -4px;
            right: -1px;
            width: 5px;
            height: 4px;
        }
If you don't want to display Offline status then you should also add this:
.UserOffline {display: none !important;}

Long ribbon
Open 'message_user_online' template and replace the string there with:

<span class="{$userStatus.class}"><span></span>{$userStatus.text}</span>
Open 'extra.css' and add these lines:
.UserOnline, .UserOffline, .UserOnlineInvisible
    {
        font-weight: bold;
        font-size: 10px;
        color: @contentBackground;
        background: @primaryLight url('@imagePath/xenforo/gradients/category-23px-light.png') repeat-x top;
        padding: 1px 5px;
        margin: -5px;
        border: 1px solid @primaryLight;
        border-radius: 3px;
        border-top-right-radius: 0px;
        display: block;
        float: inherit;
        position: relative;
        box-shadow: 1px 1px 3px rgba(0,0,0, 0.25);
    }

        .UserOnline span, .UserOffline span, .UserOnlineInvisible span
        {
            background-color: @primaryLight;
            border-top-right-radius: 3px;
            position: absolute;
            top: -4px;
            right: -1px;
            width: 5px;
            height: 4px;
        }
If you don't want to display Offline status then you should also add this:

.UserOffline {display: none !important;}


Covering ribbon
Open 'message_user_online' template and replace the string there with:

<span class="{$userStatus.class}"><span class="firstSpan"></span><span class="secondSpan"></span>{$userStatus.text}</span>
Open 'extra.css' and add these lines:
.UserOnline, .UserOffline, .UserOnlineInvisible
{
font-weight: bold;
font-size: 10px;
color: @contentBackground;
background: @primaryLight url('@imagePath/xenforo/gradients/category-23px-light.png') repeat-x top;
padding: 1px 5px;
margin: -5px;
border: 1px solid @primaryLight;
border-radius: 3px;
border-top-right-radius: 0px;
border-top-left-radius: 0px;
display: block;
float: inherit;
position: relative;
box-shadow: 0px 1px 3px rgba(0,0,0, 0.25);
}
.UserOnline .firstSpan, .UserOffline .firstSpan, .UserOnlineInvisible .firstSpan
{
background-color: @primaryLight;
border-top-right-radius: 3px;
position: absolute;
top: -4px;
right: -1px;
width: 4px;
height: 4px;
}

.UserOnline .secondSpan, .UserOffline .secondSpan, .UserOnlineInvisible .secondSpan
{
background-color: @primaryLight;
border-top-left-radius: 3px;
position: absolute;
top: -4px;
left: -1px;
width: 4px;
height: 4px;
}
If you don't want to display Offline status then you should also add this:

.UserOffline {display: none !important;}

Thay đổi nút đăng ký mặc định bằng bảng đăng ký popup





Để thay đổi nút đăng ký mặc định của XenForo và khi bấm vào nút Đăng ký thì hiện popup bảng đăng ký thành viên các bạn làm như sau:
Bước 1: Tìm đoạn code sau trong template sidebar_visitor_panel

<div class="section loginButton">
    <div class="secondaryContent">
        <label for="LoginControl" id="SignupButton"><a href="{xen:link login}" class="inner">{xen:if $xenOptions.registrationSetup.enabled, {xen:phrase sign_up_now}, {xen:phrase log_in}}</a></label>
    </div>
</div>
Thay bằng đoạn code sau:

<div style="margin-top:10px;">
  <li>
      <a class="OverlayTrigger" data-overlayOptions="{&quot;fixed&quot;:false}" href="{xen:link 'register'}"><img src="http://vietxf.org/styles/default/xenforo/dangky.png"/></a>
  </li>
</div>
Bước 2: Tìm đoạn code sau trong template form.css

.xenOverlay .xenForm
    {
        width: @overlayFormWidth;
    }
Thay bằng đoạn code sau:

.xenOverlay .xenForm
    {
        width: @overlayFormWidth;
        background: #eff6fc;
    }
Với #eff6fc là mã màu nền của bảng popup được hiện ra.

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

Tiêu đề forum thụt ra thụt vào khi di chuột

Như tiêu đề bài viết. Để tiêu đề forum thụt ra thụt vào khi di chuột qua các bạn làm như sau:
indenting.png
Vào template header thêm đoạn code sau:
<script type="text/javascript">
$(document).ready(function(){
$("h3 a").hover(function(){
    $(this).stop().animate({marginLeft:"10px"},300);}
  ,function(){
    $(this).stop().animate({marginLeft:"0px"},300);
});
});
</script>
Save lại -> done !

Stay logged in" (Duy trì trạng thái đăng nhập của thành viên)

Đây là 1 mod rất đơn giản nhưng lại hữu ích. Tác dụng của mod này là tự động tick vào "Stay logged in" (Duy trì trạng thái đăng nhập của thành viên). Các bạn làm như sau:
Bước 1: Tìm trong template: login_bar_form:
 
<label for="ctrl_remember" class="rememberPassword"><input type="checkbox" name="remember" value="1" id="ctrl_remember" tabindex="104" /> {xen:phrase stay_logged_in}</label>
Thay bằng code sau:
 
<label for="ctrl_remember" class="rememberPassword"><input type="checkbox" name="remember" value="1" checked="checked" id="ctrl_remember" tabindex="104" /> {xen:phrase stay_logged_in}</label>
Bước 2: Tìm trong template: helper_login_form:
 
<label for="ctrl_pageLogin_remember" class="rememberPassword"><input type="checkbox" name="remember" value="1" id="ctrl_pageLogin_remember" /> {xen:phrase stay_logged_in}</label>
Thay bằng code sau:
 
<label for="ctrl_pageLogin_remember" class="rememberPassword"><input type="checkbox" name="remember" value="1" checked="checked" id="ctrl_pageLogin_remember" /> {xen:phrase stay_logged_in}</label>

SubCategories in Columns - Hiển thị forum con ra ngoài trang chính


Để hiển thị forum con trong các chuyên mục thành các cột các bạn làm như sau:

Tìm đoạn code sau trong template: node_forum_level_2

<xen:if is="{$renderedChildren} AND {$level} == 2">
    <div class="Popup subForumsPopup">
        <a href="{xen:link forums, $forum}" rel="Menu" class="cloaked" data-closemenu="true"><span class="dt">{xen:phrase sub_forums}:</span> {xen:number $forum.childCount}</a>

        <div class="Menu JsOnly subForumsMenu">
            <div class="primaryContent menuHeader">
                <h3>{$forum.title}</h3>
                <div class="muted">{xen:phrase sub_forums}</div>
            </div>
            <ol class="secondaryContent blockLinksList">
            <xen:foreach loop="$renderedChildren" value="$child">
                {xen:raw $child}
            </xen:foreach>
            </ol>
        </div>
    </div>
</xen:if>
Thay bằng đoạn code sau:

<xen:if is="{$renderedChildren} AND {$level} == 2">
    <div class="subForumsPopup">
        <div class="subForumsMenu">
            <ol class="secondaryContent blockLinksList">
            <xen:foreach loop="$renderedChildren" value="$child">
                {xen:raw $child}
            </xen:foreach>
            </ol>
        </div>
    </div>
</xen:if>
Tìm đoạn code sau trong template: node_category_level_2

<xen:if is="{$renderedChildren} AND {$level} == 2">
    <div class="Popup subForumsPopup">
        <a href="{xen:link categories, $category}" rel="Menu" class="concealed" data-closemenu="true"><span class="dt">{xen:phrase sub_forums}:</span> {xen:number $category.childCount}</a>

        <div class="Menu JsOnly subForumsMenu">
            <div class="primaryContent menuHeader">
                <h3>{$category.title}</h3>
                <div class="muted">{xen:phrase sub_forums}</div>
            </div>
            <ol class="secondaryContent blockLinksList">
                <xen:foreach loop="$renderedChildren" value="$child">
                    {xen:raw $child}
                </xen:foreach>
            </ol>
        </div>
    </div>
</xen:if>
Thay bằng đoạn code sau:

<xen:if is="{$renderedChildren} AND {$level} == 2">
    <div class="subForumsPopup">

        <div class="subForumsMenu">
            <ol class="secondaryContent blockLinksList">
            <xen:foreach loop="$renderedChildren" value="$child">
                {xen:raw $child}
            </xen:foreach>
            </ol>
        </div>
    </div>
</xen:if>
Mở template: node_forum_level_n. Thay thế tất cả nội dung trong template này bằng:

<li class="node forum level-n node_{$forum.node_id}">
    <span class="dot"><span></span></span>
    <div {xen:if $forum.hasNew, 'class="unread"'}>
        <h4 class="nodeTitle"><a href="{xen:link forums, $forum}" class="menuRow">{$forum.title}</a></h4>
    </div>
    <xen:if is="{$renderedChildren}">
        <ol>
            <xen:foreach loop="$renderedChildren" value="$child">
                {xen:raw $child}
            </xen:foreach>
        </ol>
    </xen:if>
</li>
Mở template: node_category_level_n. Thay thế tất cả nội dung template trên bằng:

<li class="node category level-n node_{$category.node_id}">
    <span class="dot"><span></span></span>
    <div {xen:if $category.hasNew, 'class="unread"'}>
        <h4 class="nodeTitle"><a href="{xen:link categories, $category}" class="menuRow">{$category.title}</a></h4>
    </div>
    <xen:if is="{$renderedChildren}">
        <ol>
            <xen:foreach loop="$renderedChildren" value="$child">
                {xen:raw $child}
            </xen:foreach>
        </ol>
    </xen:if>
</li>
Mở template EXTRA.css. Thêm vào đoạn code sau:

.subForumsPopup,
.subForumsPopup .blockLinksList,
.subForumsPopup ol,
.subForumsMenu ol li ol li
{
    width: 100%;
}

.subForumsPopup .blockLinksList
{
    float: left;
}

.subForumsPopup .dot
{
    position: relative;
    float: left; /* firefox fix */
}
.subForumsPopup .dot span
{
    height: 0px;
    left: 6px;
    top: 10px !important;
    position: absolute;
    width: 0px;
    border: 2px solid @primaryLight;
    border-radius: 6px;
}

.subForumsMenu ol li
{
    width: 25%;
    float: left;
}

.subForumsMenu .node .nodeTitle a
{
    padding-left: 16px;
}

.subForumsMenu .node .node.level-n
{
    display: none;
}
Nếu muốn hiển thị Subforum thành nhiều hơn hoặc ít cột hơn. Các bạn sửa giá trị: 20% trong code:

.subForumsGrid .node { width: 20%; float: left; }
Thành giá trị tương ứng sau:

  • 20% = 5 cột
  • 25% = 4 cột
  • 33% = 3 cột
  • 50% = 2 cột

Thứ Năm, 22 tháng 11, 2012

Cài thêm ngôn ngữ bản địa cho xenforo

Tiếng Việt Nam (vietnam)Language Tiếng Việt Xenforo 1.1.2
http://www.mediafire.com/file/i4bu0kz5pybx5pc/language-Tieng-Viet-xenforo-1.1.2.zip
(Thanks xenforo.biz)
Tác giả: VIETXF.ORG
Bản dịch:
Bản dịch này đã được trích từ các bản dịch trước nên khá đầy đủ.
Gần như đã hoàn chỉnh tầm 98%
Ngôn từ dùng trong bản dịch này hay, ngắn gọn, xúc tích và dễ hiểu.
Bản dịch này chỉ dịch phần bên ngoài Forum. Không dịch Admin Control Panel đâu nhé!
Demo: http://Vietxf.org
Tải về http://vietxf.org/attachments/language-tieng-viet-1-1-3-vietxf-rar.1622/
(Thanks vietxf.org)

Tiếng Nga :Tác giả: Romchik®
Ngôn ngữ: tiếng Nga
Phiên bản: 1.1.3
http://vietxf.org/attachments/xenforo_113_rus_xfr_121-zip.1633/