-
Notifications
You must be signed in to change notification settings - Fork 12
Hướng dẫn nâng cấp giao diện tương thích từ NukeViet 4.1 Official lên NukeViet 4.2.01
Nếu cần tùy chỉnh giao diện báo lỗi (lỗi 404, lỗi 403, 500...) bạn có thể tùy chỉnh như sau (không bắt buộc):
Mở file themes/ten-theme/theme.php
thêm vào cuối file:
/**
* nv_error_theme()
*
* @param string $title
* @param string $content
* @param integer $code
*/
function nv_error_theme($title, $content, $code)
{
nv_info_die($title, $title, $content, $code);
}
Thay dòng
nv_info_die($title, $title, $content, $code);
bằng code để thiết lập giao diện.
Để tùy chỉnh giao diện gửi email đi bạn có thể thực hiện như sau (không bắt buộc)
Thêm vào file theme.php:
/**
* nv_mailHTML()
*
* @param string $title
* @param string $content
* @param string $footer
*/
function nv_mailHTML($title, $content, $footer='')
{
global $global_config, $lang_global;
$xtpl = new XTemplate('mail.tpl', NV_ROOTDIR . '/themes/default/system');
$xtpl->assign('SITE_URL', NV_MY_DOMAIN);
$xtpl->assign('GCONFIG', $global_config);
$xtpl->assign('LANG', $lang_global);
$xtpl->assign('MESSAGE_TITLE', $title);
$xtpl->assign('MESSAGE_CONTENT', $content);
$xtpl->assign('MESSAGE_FOOTER', $footer);
$xtpl->parse('main');
return $xtpl->text('main');
}
Copy file themes/default/system/mail.tpl
sang giao diện của bạn: themes/ten-theme/system/mail.tpl
Kiểm tra lại giao diện của bạn có sử dụng các block riêng (Các block trong themes/ten-theme/blocks) lấy dữ liệu từ module banners không, nếu có cần chú ý thay đổi lại link khi click vào quảng cáo như sau:
Phiên bản trước link có dạng:
$banners['link'] = NV_BASE_SITEURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&' . NV_NAME_VARIABLE . '=banners&' . NV_OP_VARIABLE . '=click&id=' . $banners['id'];
Phiên bản này link có dạng:
$banners['link'] = NV_BASE_SITEURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&' . NV_NAME_VARIABLE . '=banners&' . NV_OP_VARIABLE . '=click&id=' . $banners['id'] . '&s=' . md5($banners['id'] . NV_CHECK_SESSION);
Nếu giao diện của bạn tồn tại file themes/ten-theme/system/info_die.tpl
mở lên kiểm tra nếu có thì xóa đoạn code sau:
<!--[if lt IE 9]>
<script type="text/javascript" src="{NV_BASE_SITEURL}themes/{TEMPLATE}/js/html5shiv.js"></script>
<script type="text/javascript" src="{NV_BASE_SITEURL}themes/{TEMPLATE}/js/respond.min.js"></script>
<![endif]-->
Nếu giao diện của bạn tồn tại themes/ten-theme/modules/banners
thì cập nhật như sau:
Trong thư mục themes/ten-theme/modules/banners xóa các file thừa cledit.tpl, clientinfo.tpl, clinfo.tpl, logininfo.tpl. Đối chiếu với giao diện mặc định để sửa các file: home.tpl, addads.tpl, stats.tpl do có nhiều thay đổi.
Chú ý: Banners là một module rất ít tùy biến do đó bạn có thể chép đè các file home.tpl, addads.tpl, stats.tpl từ giao diện mặc định sang rồi sửa giao diện nếu thấy chưa hợp lý.
Nếu giao diện của bạn tồn tại themes/ten-theme/modules/news
thì cập nhật như sau:
Mở themes/ten-theme/modules/news/viewcat_grid.tpl
tìm:
$(window).load(function(){
Nếu có sửa lại thành:
$(window).on('load', function() {
Mở themes/ten-theme/modules/two-step-verification/main.tpl
:
Tìm:
<a href="{LINK_TURNOFF}" class="btn btn-danger">{LANG.turnoff2step}</a>
Nếu có thay lại thành:
<input class="btn btn-danger" type="button" value="{LANG.turnoff2step}" data-toggle="turnoff2step" data-tokend="{NV_CHECK_SESSION}"/>
Tìm:
<a href="{LINK_CREATCODE}" class="btn btn-info">{LANG.creat_other_code}</a>
Nếu có thay lại thành:
<input class="btn btn-info" type="button" value="{LANG.creat_other_code}" data-toggle="changecode2step" data-tokend="{NV_CHECK_SESSION}"/>
Tìm:
<!-- END: backupcode -->
Thêm lên trên:
<!-- BEGIN: autoshowcode -->
<script type="text/javascript">
$(function() {
$('[data-toggle="viewcode"]').click();
});
</script>
<!-- END: autoshowcode -->
Nếu giao diện của bạn tồn tại themes/ten-theme/modules/two-step-verification
thì cập nhật như sau:
Nếu giao diện của bạn tồn tại file themes/ten-theme/js/two-step-verification.js
thì đối chiếu với giao diện default để sửa hoặc xóa đi (nếu không tùy chỉnh vào js) để hệ thống lấy từ giao diện mặc định.
Nếu giao diện của bạn tồn tại themes/ten-theme/modules/users
thì cập nhật như sau:
Đối chiếu với giao diện mặc định để sửa các file sau do có rất nhiều thay đổi: info.tpl, register_form.tpl
Khuyến nghị: Chụp lại ảnh giao diện của các phần tương ứng sau đó chép đè các file trên từ giao diện mặc định sau đó chỉnh lại giao diện cho giống ban đầu.
Mở file themes/ten-theme/modules/users/lostpass_form.tpl
Tìm:
<div class="nv-recaptcha-default"><div id="{RECAPTCHA_ELEMENT}"></div></div>
Thay lại thành:
<div class="nv-recaptcha-default">
<div id="{RECAPTCHA_ELEMENT}"></div>
<input type="hidden" value="" name="gcaptcha_session"/>
</div>
Nếu giao diện của bạn tồn tại file themes/ten-theme/js/users.js
thì đối chiếu với giao diện default để sửa hoặc xóa đi (nếu không tùy chỉnh vào js) để hệ thống lấy từ giao diện mặc định.