Tutorial 2x Chèn Comment Facebook vào Xenforo2

secpol

MasterCorporal
B1: Vào Template PAGE_CONTAINER tìm:
Mã:
<body data-template="{$template}">

Chèn vào phía dưới:
Mã:
<div id="fb-root"></div>
<script>(function(d, s, id) {
  var js, fjs = d.getElementsByTagName(s)[0];
  if (d.getElementById(id)) return;
  js = d.createElement(s); js.id = id;
  js.src = 'https://connect.facebook.net/vi_VN/sdk.js#xfbml=1&version=v2.12&appId=FB_ID&autoLogAppEvents=1';
  fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>

B2: Vào template thread_view tìm:
Mã:
<xf:ad position="thread_view_below_messages" arg-thread="{$thread}" />

Chèn vào phía dưới:
Mã:
<!-- comment fb -->
<div class="block-container">
   <h3 class="block-header">
       Bình luận bằng Facebook
   </h3>
   <div class="fb-comments" data-href="{{ link('full:threads', $thread) }}" data-width="100%" data-numposts="10" data-order-by="social" data-colorscheme="light"></div>
</div>
<!-- end comment fb -->

Note: thay FB_ID bằng ID của bạn lấy từ https://developers.facebook.com/apps
 
Sửa lần cuối:

Win

MasterCorporal
Xen 2
Để không bị mất cmt khi thay đổi tiêu đề nên thay bằng.

data-href="{{ link('full:threads', $thread) }}"

Thành

data-href="{{ link('full:threads/'.($thread.thread_id)) }}"
 

Đính kèm

  • CodeVn.Net-FbComment-1.0.3.zip
    13 KB · Lượt xem: 28
Sửa lần cuối:

maxrena

Private
Cho mình hỏi là có cách nào sửa để cái ô comment của facebook nằm phía dưới ô comment của forum được ko bạn?
 

secpol

MasterCorporal
Cho mình hỏi là có cách nào sửa để cái ô comment của facebook nằm phía dưới ô comment của forum được ko bạn?

Bạn chèn:

Mã:
<!-- comment fb -->
<div class="block-container">
   <h3 class="block-header">
       Bình luận bằng Facebook
   </h3>
   <div class="fb-comments" data-href="{{ link('full:threads', $thread) }}" data-width="100%" data-numposts="10" data-order-by="social" data-colorscheme="light"></div>
</div>
<!-- end comment fb -->

Ở phía trên:

Mã:
<div class="blockMessage blockMessage--none">

Trong temp thread_view
 
cho em hỏi là trang của em tên miền thì không bị facebook chặn nhưng link bài thì lại bị chặn. Xin chỉ em hướng giải quyết hoặc kiến nghị thế nào ạ
 
B1: Vào Template PAGE_CONTAINER tìm:
Mã:
<body data-template="{$template}">

Chèn vào phía dưới:
Mã:
<div id="fb-root"></div>
<script>(function(d, s, id) {
  var js, fjs = d.getElementsByTagName(s)[0];
  if (d.getElementById(id)) return;
  js = d.createElement(s); js.id = id;
  js.src = 'https://connect.facebook.net/vi_VN/sdk.js#xfbml=1&version=v2.12&appId=FB_ID&autoLogAppEvents=1';
  fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>

B2: Vào template thread_view tìm:
Mã:
<xf:ad position="thread_view_below_messages" arg-thread="{$thread}" />

Chèn vào phía dưới:
Mã:
<!-- comment fb -->
<div class="block-container">
   <h3 class="block-header">
       Bình luận bằng Facebook
   </h3>
   <div class="fb-comments" data-href="{{ link('full:threads', $thread) }}" data-width="100%" data-numposts="10" data-order-by="social" data-colorscheme="light"></div>
</div>
<!-- end comment fb -->

Note: thay FB_ID bằng ID của bạn lấy từ https://developers.facebook.com/apps
2 code trên em tìm hoài hok thấy cái chỗ để chèn FB_ID :(
 

maxrena

Private
Chào bạn, cho mình hỏi mình bị cái lỗi ô facebook comment nó bị thu nhỏ như vầy, bạn xem xét giúp mình với.
RhdRsOA

FB-cmt-forum-00.png
 

maxrena

Private
Xin chào, mình muốn hỏi là bản thân là người quản trị của forum mình, có cách nào để mình có thể xóa các comment từ facebook này không? Xin cảm ơn.
 

thahtrung06

MasterSergeant
Xin chào, mình muốn hỏi là bản thân là người quản trị của forum mình, có cách nào để mình có thể xóa các comment từ facebook này không? Xin cảm ơn.
Bạn vào công cụ phát triển của facebook có chỗ để duyệt và xóa comment đó. Ngày trước mình dùng có tùy chọn đăng ngày comment hay phải thông qua duyệt để đăng comment facebook, xóa comment. Lâu ko dùng cái này nên ko có hình và link cụ thể cho bạn.
 

maxrena

Private
Cho mình hỏi thêm chút, mình không hiểu rõ lắm.
Cái bạn đang nói tới là nằm trong forum hay trên facebook vậy, để mình biết chỗ tìm.
 

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

XenForo 1 XenForo 2
Translate by PVS

Hỗ trợ trực tuyến

Support Quảng cáo
Mr. San (PVS)

Skype chat, instant message

Mr. Tuấn (Blue)

Skype chat, instant message

Mr. Tuấn
0988 488 096
Mr. Trọng
0906 081 284
kinhdoanh@vnxf.vn

Nhà Tài Trợ

Mút Xốp Không Gian
pallet Thịnh Phát
Điện Lạnh Thịnh Phát
Top