thanhdao đã viết:Đã làm được cho bản 3.4, có điều phải thay đổi một chút, vì bản nk3.4 này có thẻ <noscrip> nên copy đoạn code1 vào phần body sẽ không được. Làm như sau thì OK:
- 1. tạo file face.js có nội dung là một phần đoạn code 1:
- Mã: Chọn hết
// JavaScript Document
(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 = "//connect.facebook.net/en_US/all.js#xfbml=1&appId=IDfacebook cap cho ban";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));
Lưu file này vào thư mục js trong themes của bạn
-2. Mở file header.tpl trong thư mục layout của themes của bạn
thêm đoạn code này vào trước thẻ </header>
- Mã: Chọn hết
<script type="text/javascript" src="/themes/forum/js/face.js"></script>
3- File detail.tpl trong thư mục themecuaban/module/new/
Thêm đoạn này vào chỗ bạn muốn hiển thị cách mạng, tốt nhất là dưới phần keyword
- Mã: Chọn hết
<div class="fb-comments" data-href="{SELFURL}" data-num-posts="5" data-width="550"></div>
File /modules/news/theme.php hoặc /themes/modern/modules/news/theme.php nếu dùng theme modern
Tìm
Tìm
- Mã: Chọn hết
global $global_config, $module_info, $lang_module, $module_name, $module_file, $module_config, $global_array_cat, $my_head, $lang_global, $user_info, $admin_info, $catid;
Thay lại thành
- Mã: Chọn hết
global $global_config, $module_info, $lang_module, $module_name, $module_file, $module_config, $global_array_cat, $my_head, $lang_global, $user_info, $admin_info, $catid, $client_info;
- Mã: Chọn hết
$xtpl = new XTemplate( "detail.tpl", NV_ROOTDIR . "/themes/" . $module_info['template'] . "/modules/" . $module_file );
Thêm vào dưới
- Mã: Chọn hết
$xtpl->assign( 'SELFURL', $client_info['selfurl'] );
Lưu tất cả lại và xem kết quả, demo:
http://dulichmocchau.net/news/Am-thuc-San-vat/Hat-doi-huong-vi-nui-rung-265/
sao mình làm cho themes default nukeviet 3.4 như vậy mà nó ko hiển thị được vậy...