Hiển Thị Icon Poll, Resource trong threadlist

Kun

LOLLLLLLLLLLL
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
2 icon poll, resource sẽ được hiển thị trong danh sách bài viết của thread_list_item

Đầu tiên, bật chế độ DEBUG XENFORO dành cho nhà phát triển
Tạo 1 Template Modifications
Template: thread_list_item
Modification Key: tliicon
Description: Xau Trai Thi Sao =)) ( mún ghi gì thì ghi tùy ý các bạn)
Search Type: Simple Replacement
Find:
Mã:
<xen:hook name="thread_list_item_icon_key" params="{xen:array 'thread={$thread}'}">
Replace:
Mã:
<xen:hook name="thread_list_item_icon_key" params="{xen:array 'thread={$thread}'}">
                <xen:if is="{$xenOptions.plugin_status_icon_1} != 0">
                    <xen:if is="{$thread.discussion_type} == 'poll'"><span class="poll" <xen:if is="!{$xenOptions.title_icon_poll}"><xen:else />title="{$xenOptions.title_icon_poll}"</xen:if>>{$xenOptions.title_icon_poll}</span></xen:if>
                    <xen:if is="{$thread.discussion_type} == 'resource'"><span class="resource" <xen:if is="!{$xenOptions.title_icon_resource}"><xen:else />title="{$xenOptions.title_icon_resource}"</xen:if>>{$xenOptions.title_icon_resource}</span></xen:if>
                    <xen:else />
                </xen:if>
Add-on: XenForo

Xong rồi làm tiếp nè
Tạo 1 Template Modifications
Template: discussion_list.css
Modification Key: tlicss
Description: Xau Trai Thi Sao =)) ( mún ghi gì thì ghi tùy ý các bạn)
Search Type: Simple Replacement
Find:
Mã:
.discussionListItem .iconKey .new       { background-position: -64px -16px; }
Replace:
Mã:
.discussionListItem .iconKey .new       { background-position: -64px -16px; }
         .discussionListItem .iconKey .poll      { background: url('styles/xautrai/poll.png') no-repeat;}
         .discussionListItem .iconKey .resource  { background: url('styles/xautrai/resource.png') no-repeat;}
Add-on: XenForo

DEMO thì không có nha, làm xong tự tận hưởng :D.. Ở không quá mà nên viết TUT, gạch đá xin nhận, sửa lại đường dẫn icon tùy ý bạn

iamoQnj.png
Nu8saFZ.png
 
bạn ơi cho mình hỏi mình muốn tạo hook chỉ hiện thị trên trang chủ không hiển thị trong bài viết với mấy trang khác thì làm thế nào vậy? Tks
 
Back
Top