[hướngdẫn] Tích hợp Facebook Comment vào Xenforo

ptvinhdtk

MasterCorporal
Tham gia
21/07/2015
Bài viết
202
Được Like
122
code của thớt sao thừa 1 thẻ đóng </li> vậy
Dùng code này để comment chỉ hiện ở bài đầu tiên (giảm load trang) và responsive trên mobile
Mã:
<xen:if is="{$message.isFirst}">
<li id="{$messageId}" class="message {xen:if $message.isDeleted, 'deleted'} {xen:if '{$message.is_admin} OR {$message.is_moderator}', 'staff'} {xen:if $message.isIgnored, ignored}" data-author="{$message.username}"> <div class="comment_fbdiv" ></div> <div id="fb-root"></div> <div class="fb-comments" data-href="{xen:link full:threads, $thread}"  data-num-posts="10" data-width="100%"></div> </li>
</xen:if>
Chuẩn nhất
 
  • Like
Reactions: THB

minhvv

Private
Tham gia
14/07/2016
Bài viết
5
Được Like
1
Tại sao cái fb comment mình cài nó cứ reload liên tục thế nhỉ, có bạn nào biết cách xử lý ko?
 
  • Like
Reactions: THB

ptvinhdtk

MasterCorporal
Tham gia
21/07/2015
Bài viết
202
Được Like
122
:&:& ko có ai biết sao...
Thử thay cài này vào message xem đc ko
<xen:if is="{$message.isFirst}">
<div class="fb-comments" data-href="{xen:link full:threads, $thread}" data-width="760" data-numposts="5">
</div>
</xen:if>
 

lamtraumvn

Private
Tham gia
12/04/2016
Bài viết
22
Được Like
16
em không biết sao 1 web của em cài thì ok một cái khác thì nó bị lạ lắm, vào web thì không hiện comment fb, F5 refrest lại nó lại hiện, nếu khách vào mà xem 1 lần thì coi như không có comment luôn. Em sửa mãi mà không được thành ra đành phải gỡ ra
 

minhvv

Private
Tham gia
14/07/2016
Bài viết
5
Được Like
1
Mình biết lỗi do đâu rồi :'( cái widget "bài mới nhất" nó cứ scroll cái là fb comment nó cũng reload luôn. Mà mình chưa xử lý đc! bạn nào giúp mình vs.
http://xinhtuoi.net
 

ptvinhdtk

MasterCorporal
Tham gia
21/07/2015
Bài viết
202
Được Like
122
đúng rồi trước kia mình cũng bị giờ mới nhớ do wiget nó cứ nhảy làm fb load liên tục sau đó phải loại bỏ hết wiget bài liên quan ở thread_view đi
 

tuna

Sergeant
Tham gia
30/01/2017
Bài viết
639
Được Like
276
code của thớt sao thừa 1 thẻ đóng </li> vậy
Dùng code này để comment chỉ hiện ở bài đầu tiên (giảm load trang) và responsive trên mobile
Mã:
<xen:if is="{$message.isFirst}">
<li id="{$messageId}" class="message {xen:if $message.isDeleted, 'deleted'} {xen:if '{$message.is_admin} OR {$message.is_moderator}', 'staff'} {xen:if $message.isIgnored, ignored}" data-author="{$message.username}"> <div class="comment_fbdiv" ></div> <div id="fb-root"></div> <div class="fb-comments" data-href="{xen:link full:threads, $thread}"  data-num-posts="10" data-width="100%"></div> </li>
</xen:if>
code chuẩn nhất đây rồi :))
 

tuna

Sergeant
Tham gia
30/01/2017
Bài viết
639
Được Like
276
@THB bác cho em hỏi đoạn code này so với code lấy của trang fb plugin nó có khá nhau ko nhỉ, của fb nó chỉ là: <div class="fb-comments" data-numposts="5" </div>
 

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

XenForo 1 XenForo 2
Translate by PVS

Dịch vụ XenForo của VNXF

Mr. Tuấn

Mobile/Zalo: 0988 488 096

Telegram: bluekpro

Email: [email protected]

Nhà Tài Trợ

Mút Xốp Không Gian
pallet Thịnh Phát
Top Bottom