Nút xác thực đăng nhập Social Network trên Sidebar

Admin

Administrator
Thành viên BQT
#1
Nút xác thực đăng nhập Social Network trên Sidebar

Vào template Open sidebar_visitor_panel tìm:
Mã:
<xen:include template="ad_sidebar_below_visitor_panel" />

Thêm đoạn code dưới vào trước nó:
Mã:
<xen:include template="sidebar_custom_login_form" />
Tạo một template mới có tên là: sidebar_custom_login_form
Mã:
<xen:if is="!{$visitor.user_id}">
<div class="section">
<div class="secondaryContent">
<h3>Quick Login</h3>
<xen:container var="$hideLoginBar">1</xen:container>
<form action="{xen:link 'login/login'}" method="post" id="pageLogin">
    <xen:if hascontent="true">
        <div class="errorPanel"><span class="errors">
            <xen:contentcheck>{xen:raw $text}</xen:contentcheck>
        </span></div>
    </xen:if>
    <dl class="ctrlUnit">
  
        <dd><label for="ctrl_pageLogin_login">{xen:phrase your_name_or_email_address}:</label></dd>
        <dd><input type="text" name="login" value="{$defaultLogin}" id="ctrl_pageLogin_login" class="textCtrl" /></dd>
    </dl>
<xen:if is="{$xenOptions.registrationSetup.enabled}">
    <dl class="ctrlUnit">
  
        <dd><label for="ctrl_pageLogin_password">{xen:phrase do_you_already_have_account}</label></dd>
        <dd>
            <ul>
                <li><label for="ctrl_pageLogin_not_registered"><input type="radio" name="register" value="1" id="ctrl_pageLogin_not_registered" />
                    {xen:phrase no_create_account_now}</label></li>
                <li><label for="ctrl_pageLogin_registered"><input type="radio" name="register" value="0" id="ctrl_pageLogin_registered" checked="checked" class="Disabler" />
                    {xen:phrase yes_my_password_is}:</label></li>
                <li id="ctrl_pageLogin_registered_Disabler">
                    <input type="password" name="password" class="textCtrl" id="ctrl_pageLogin_password" />        
                    <div><label for="ctrl_pageLogin_remember" class="rememberPassword"><input type="checkbox" name="remember" value="1" id="ctrl_pageLogin_remember" /> {xen:phrase stay_logged_in}</label></div>
                </li>
            </ul>
        </dd>
    </dl>
<xen:else />
    <dl class="ctrlUnit">
        <dt><label for="ctrl_pageLogin_password">{xen:phrase password}:</label></dt>
        <dd>
            <input type="password" name="password" class="textCtrl" id="ctrl_pageLogin_password" />        
            <div><label for="ctrl_pageLogin_remember" class="rememberPassword"><input type="checkbox" name="remember" value="1" id="ctrl_pageLogin_remember" /> {xen:phrase stay_logged_in}</label></div>
        </dd>
    </dl>
</xen:if>
    <xen:if is="{$captcha}">
        <dl class="ctrlUnit">
            <dt>{xen:phrase verification}:</dt>
            <dd>{xen:raw $captcha}</dd>
        </dl>
    </xen:if>
    <dl class="ctrlUnit submitUnit">
        <dd>
            <input type="submit" class="button primary" value="{xen:phrase log_in}" data-loginPhrase="{xen:phrase log_in}" data-signupPhrase="{xen:phrase sign_up}" />
            <br><a href="{xen:link lost-password}" class="OverlayTrigger OverlayCloser">{xen:phrase forgot_your_password}</a>
        </dd>
    </dl>
    <input type="hidden" name="cookie_check" value="1" />
    <input type="hidden" name="redirect" value="{xen:if $redirect, $redirect, $requestPaths.requestUri}" />
    <input type="hidden" name="_xfToken" value="{$visitor.csrf_token_page}" />
</form>
<script>
    $(function()
    {
        var $button = $('#pageLogin input.button.primary');
        $('#pageLogin input[name="register"]').click(function()
        {
            $button.val(
                $('#pageLogin input[name="register"]:checked').val() == '1'
                ? $button.data('signupPhrase')
                : $button.data('loginPhrase')
            );
        });
    });
</script>
</div></div>
</xen:if>
Chúc các bạn thành công.


Nguồn: xenforo.com​
 

Từ khóa phổ biến

You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an alternative browser.

Top