Help Xin hỏi về cách lấy tên user như này

KienVHT

Private
Chào các bác, em thấy ở cái post này có bác lấy ra cái Name hay quá. Mà hồi trc ở vbb là code [you], ko biết ở xenforo mình là gì vậy ạ. Em cảm ơn các bác
photo_2018-06-19_10-51-08.jpg
 
@KienVHT Xen 2 thì bạn tìm template message_macros, sau đó tìm đoạn:
PHP:
<xf:macro name="signature" arg-user="!">
    <xf:if is="$xf.visitor.Option.content_show_signature AND $user.Profile.signature">
        <xf:if contentcheck="true">
            <aside class="message-signature">
            <xf:contentcheck>
                {{ bb_code($user.Profile.signature, 'user:signature', $user) }}
            </xf:contentcheck>
            </aside>
        </xf:if>
    </xf:if>
</xf:macro>
Sửa lại thành:
PHP:
<xf:macro name="signature" arg-user="!">
    <xf:if is="$xf.visitor.Option.content_show_signature">
        <xf:if contentcheck="true">
            <aside class="message-signature">
            <xf:contentcheck>
                Xin chào <xf:username user="$user"defaultname="{$fallbackName}" />
            </xf:contentcheck>
            </aside>
        </xf:if>
    </xf:if>
</xf:macro>

Có thể sửa chữ "Xin chào" bằng câu bạn muốn. Lưu ý 1 tí:
1./ Dòng này nghĩa là "Khách có thể xem chữ ký" và user có thiết lập chữ ký
Mã:
    <xf:if is="$xf.visitor.Option.content_show_signature AND $user.Profile.signature">
Nên nếu bạn thiết lập ko cho khách xem chữ ký thì nó cũng ko hiện
2./ Code mình sửa đã bỏ tùy chọn hiển thị khi user đặt chữ ký, nên nếu user đặt chữ ký thì nó ra 2 dòng :D
 
@KienVHT Xen 2 thì bạn tìm template message_macros, sau đó tìm đoạn:
PHP:
<xf:macro name="signature" arg-user="!">
    <xf:if is="$xf.visitor.Option.content_show_signature AND $user.Profile.signature">
        <xf:if contentcheck="true">
            <aside class="message-signature">
            <xf:contentcheck>
                {{ bb_code($user.Profile.signature, 'user:signature', $user) }}
            </xf:contentcheck>
            </aside>
        </xf:if>
    </xf:if>
</xf:macro>
Sửa lại thành:
PHP:
<xf:macro name="signature" arg-user="!">
    <xf:if is="$xf.visitor.Option.content_show_signature">
        <xf:if contentcheck="true">
            <aside class="message-signature">
            <xf:contentcheck>
                Xin chào <xf:username user="$user"defaultname="{$fallbackName}" />
            </xf:contentcheck>
            </aside>
        </xf:if>
    </xf:if>
</xf:macro>

Có thể sửa chữ "Xin chào" bằng câu bạn muốn. Lưu ý 1 tí:
1./ Dòng này nghĩa là "Khách có thể xem chữ ký" và user có thiết lập chữ ký
Mã:
    <xf:if is="$xf.visitor.Option.content_show_signature AND $user.Profile.signature">
Nên nếu bạn thiết lập ko cho khách xem chữ ký thì nó cũng ko hiện
2./ Code mình sửa đã bỏ tùy chọn hiển thị khi user đặt chữ ký, nên nếu user đặt chữ ký thì nó ra 2 dòng :D
Cám ơn bác nhiều ạ. để em thử
 
@KienVHT Xen 2 thì bạn tìm template message_macros, sau đó tìm đoạn:
PHP:
<xf:macro name="signature" arg-user="!">
    <xf:if is="$xf.visitor.Option.content_show_signature AND $user.Profile.signature">
        <xf:if contentcheck="true">
            <aside class="message-signature">
            <xf:contentcheck>
                {{ bb_code($user.Profile.signature, 'user:signature', $user) }}
            </xf:contentcheck>
            </aside>
        </xf:if>
    </xf:if>
</xf:macro>
Sửa lại thành:
PHP:
<xf:macro name="signature" arg-user="!">
    <xf:if is="$xf.visitor.Option.content_show_signature">
        <xf:if contentcheck="true">
            <aside class="message-signature">
            <xf:contentcheck>
                Xin chào <xf:username user="$user"defaultname="{$fallbackName}" />
            </xf:contentcheck>
            </aside>
        </xf:if>
    </xf:if>
</xf:macro>

Có thể sửa chữ "Xin chào" bằng câu bạn muốn. Lưu ý 1 tí:
1./ Dòng này nghĩa là "Khách có thể xem chữ ký" và user có thiết lập chữ ký
Mã:
    <xf:if is="$xf.visitor.Option.content_show_signature AND $user.Profile.signature">
Nên nếu bạn thiết lập ko cho khách xem chữ ký thì nó cũng ko hiện
2./ Code mình sửa đã bỏ tùy chọn hiển thị khi user đặt chữ ký, nên nếu user đặt chữ ký thì nó ra 2 dòng :D
à, Cái này hình như bác NDK hiểu sai ý em rồi ạ.
Cái ảnh kia em lấy ở otofun.
ý em định hỏi là như này.
Giả sử em login với username KienVHT,
thì khi em vào cái bài của ông kia đăng, nó sẽ hiện là: "KienVHT có nhu cầu đi đâu thì SMS ....."
Nghĩa là cái name nó lấy đích xác đc cái account mình nhìn ấy ạ.
Emlogin nick NDK thì nó sẽ hiện là " NDK có nhu cầu đi đâu thì SMS ...."
Cái này là do ông ấy đặt signature như thế. Ngày xưa ở VBB có cái thẻ code [you] cũng làm y như vậy
 
à, Cái này hình như bác NDK hiểu sai ý em rồi ạ.
Cái ảnh kia em lấy ở otofun.
ý em định hỏi là như này.
Giả sử em login với username KienVHT,
thì khi em vào cái bài của ông kia đăng, nó sẽ hiện là: "KienVHT có nhu cầu đi đâu thì SMS ....."
Nghĩa là cái name nó lấy đích xác đc cái account mình nhìn ấy ạ.
Emlogin nick NDK thì nó sẽ hiện là " NDK có nhu cầu đi đâu thì SMS ...."
Cái này là do ông ấy đặt signature như thế. Ngày xưa ở VBB có cái thẻ code [you] cũng làm y như vậy
ờ, chời đụ, làm sai dồi. XIn lỗi bạn nhé :D
 
Vào template message_macros, tìm
Mã:
{{ bb_code($user.Profile.signature, 'user:signature', $user) }}
Thay bằng
Mã:
{{ bb_code({$user.Profile.signature|replace("[you]", $xf.visitor.username)}, 'user:signature', $user) }}
Khi tạo chữ ký thì dùng thẻ [you]

Giải quyết nhanh thì là vậy, nhưng thực sự thì không thích cách này.
 
ý chủ thớt là khi user nào xem chữ ký thì chỗ mã [you] kia được thay = tên của user đang xem đúng hok ? trước có vọc vbb nên có ấn tượng. Xen thì chưa thử :D
 
Back
Top