Tutorial 2x Liên kết đến bài viết của người dùng tìm kiếm trong chủ đề và bài viết đầy đủ trong tìm kiếm XenForo 2

PVS

Super Moderator
Thành viên BQT
Tham gia
28/02/2015
Bài viết
16,829
Được Like
12,687
Liên kết đến bài viết của người dùng tìm kiếm trong chủ đề và bài viết đầy đủ trong tìm kiếm XenForo 2

Liên kết tìm kiếm ISO


Bước 1: Tạo phrase iso_link_title và tạo văn bản của phrase là "ISO" (hoặc bất kỳ thứ gì khác bạn muốn làm văn bản liên kết của mình).

Bước 2: Tìm trong post_macros:

Mã:
<![CDATA[<div class="message-attribution-opposite">]]>

và thay thế nó bằng:

Mã:
<![CDATA[<div class="message-attribution-opposite">
<a href="{{ link('search/search', $thread, {'title_only': 0, 'keywords': '', 'search_type': 'post', 'c': {'thread': $thread.thread_id, 'users': $post.User.username}}) }}">{{ phrase('iso_link_title') }}</a>]]>

Bước 3: Tìm trong post_macros:

Mã:
<![CDATA[<ul class="message-attribution-opposite message-attribution-opposite--list">]]>

và thay thế nó bằng:

Mã:
<![CDATA[<ul class="message-attribution-opposite message-attribution-opposite--list">
<li>
    <a href="/index.php?search/search&title_only=0&keywords=&search_type=post&c[thread]={$thread.thread_id}&c[users]={$post.User.username}">{{ phrase('iso_link_title') }}</a>
</li>]]>

Kết quả sẽ trông như thế này:

Screen Shot 2021-01-18 at 9.26.05 PM.png

Bài viết đầy đủ trong Tìm kiếm

Bước 1: Tìm trong search_result_post:

Mã:
<![CDATA[<div class="contentRow-snippet">{{ snippet($post.message, 300, {'term': $options.term, 'stripQuote': true}) }}</div>]]>

và thay thế nó bằng:

Mã:
<![CDATA[<div class="contentRow">{{ bb_code($post.message, 'post', $post) }}</div>]]>

Bước 2: Tìm trong search_result_thread:

Mã:
<![CDATA[<div class="contentRow-snippet">{{ snippet($thread.FirstPost.message, 300, {'term': $options.term, 'stripQuote': true}) }}</div>]]>

và thay thế nó bằng:

Mã:
<![CDATA[<div class="contentRow">{{ bb_code($thread.FirstPost.message, 'post', $thread.FirstPost) }}</div>]]>

Kết quả sẽ trông như thế này:

Screen Shot 2021-01-18 at 9.27.05 PM.png

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


Nguồn: xenforo.com​
 

Hướng dẫn sử dụng

XenForo 1 XenForo 2
Translate by PVS

Dịch vụ XenForo của VNXF

Mobile/Zalo: 0906081284

Telegram: anhanhxf

Chỉ nhận web nội dung lành mạnh

Nhà Tài Trợ

Mút Xốp Không Gian
Mút Sofa Không Gian
Top Bottom