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:
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

Sửa lần cuối:
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?
 
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 :(
 
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
 
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.
 
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.
 
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.
 
Back
Top