Áp dụng cho phpBB mọi phiên bản, điều kiện cần là máy tính / line internet của bạn không bị chặn facebook, và điều kiện đủ là trình duyệt của bạn không khóa (disable) iframe (<iframe>), tất cả trình duyệt đều mặc định là bật (enable) iframe.
Gồm 3 bước:
1. Mở file viewtopic.php, tìm:
// We need to do the same with the topic_id. See #53025. if (empty($_REQUEST['t']) && !empty($topic_id)) { $_REQUEST['t'] = $topic_id; }thêm vào bên dưới:
// Facebook like for phpBB by PETER at vncoder.org $like = ((!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off') || $_SERVER['SERVER_PORT'] == 443) ? "https://" : "http://"; $like .= $_SERVER['HTTP_HOST']; $like .= $_SERVER['PHP_SELF']; $like = urlencode("{$like}?f={$row['forum_id']}&t={$row['topic_id']}&"); $template->assign_vars(array( 'LIKE' => $like) );2. Mở file viewtopic_body.html của (một hoặc nhiều) template mà bạn đang sử dụng, tìm:
<td class="gensmall" align="{S_CONTENT_FLOW_END}"> <!-- IF not S_IS_BOT -->thêm vào trên nó (bên trên):
<td align="left"> <div align="left"><iframe src="http://www.facebook.com/plugins/like.php?href={LIKE}postid={postrow.POST_ID}&layout=button_count&show_faces=false&width=150&action=like&font&colorscheme=light&height=21" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:150px; height:21px;" allowTransparency="true"></iframe></div> </td>3. Vào trang admin, reset / clear template cache của diễn đàn sau đó quay ra để xem kết quả.
Demo: http://www.hoavanshz....php?f=55&t=985
Như vậy là xong rồi đó, chúc các bạn thành công!