#101062 gửi bởi hunghtqni
Ngày 15 Tháng 11 2011 , 11:47
Guide to upgrade to NukeViet 3.3 applied for NukeViet 3.1 and NukeViet 3.2, please read user manual before use.

- If you are using smaller version NukeViet 3.1, you need to upgrade to Nukeviet 3.1 then upgrade next.

- If you are using NukeViet 3.3.Dev, please wait a few days more will have upgrade tool.

- Due the upgraded version will fix most all of the file, and edit much pretty in the database, so you need to data backup, to a problem can write back to previous versions. Is best backup and upgrade the test site on localhost before upgrading.


Upgrade Guide to NukeViet 3.3 details for the smaller version 3.3 RC3

1) Backup the entire site and database.

2) Login as administrator Supreme, click: Configuration -> General Configuration, select the mode closed site: "Close the site only has the Administrator Supreme access", save.

3) Use the system cleanup functions. (Do not select: Delete the database backup file) to delete the system log.

If your hosting is linux, you need configure FTP functions to the update process the system will be used to delete unused files.

4) If you are not using the default theme, you need corrected according to the instructions below.

Note: my_theme: the directory of your theme.

4.1) Edit file: themes/my_theme/layout/header.tpl
Find and delete the line:
Mã: Chọn hết
{THEME_MY_HEAD}


Find the line:
Mã: Chọn hết
{THEME_ERROR_INFO}


Replace with:
Mã: Chọn hết
[THEME_ERROR_INFO]


4.2) Edit file: themes/my_theme/layout/footer.tpl
Find and delete:
Mã: Chọn hết
<!-- BEGIN: for_admin -->
<p class="show_query">
{CLICK_SHOW_QUERIES}
</p>
<div id="div_hide" style="visibility: hidden; display: none;">
{SHOW_QUERIES_FOR_ADMIN}
</div>
<!-- END: for_admin -->


---------------------------------------------------------
Mã: Chọn hết
{THEME_ADMIN_MENU}
{THEME_MY_FOOTER}
{THEME_FOOTER_JS}


4.3) Edit file: themes/my_theme/theme.php
in function nv_site_theme (Delete: $nv_array_block_contents,)

Mã: Chọn hết
global $home, $array_mod_title, $lang_global, $language_array, $global_config, $site_mods, $module_name, $module_info, $op, $db, $mod_title, $my_head, $my_footer, $nv_array_block_contents, $client_info, $db_config;


Changed to:
Mã: Chọn hết
global $home, $array_mod_title, $lang_global, $language_array, $global_config, $site_mods, $module_name, $module_info, $op, $db, $mod_title, $my_head, $my_footer, $client_info, $db_config;


---------------------------------------------------------

Find the line:
Mã: Chọn hết
if ( ! file_exists( NV_ROOTDIR . "/themes/" . $global_config['module_theme'] . "/layout/layout." . $module_info['funcs'][$op]['layout'] . ".tpl" ) )


Changed to:
Mã: Chọn hết
if ( ! file_exists( NV_ROOTDIR . "/themes/" . $global_config['module_theme'] . "/layout/layout." . $module_info['layout_funcs'][$op] . ".tpl" ) )


---------------------------------------------------------

Find the line:
Mã: Chọn hết
$xtpl = new XTemplate( "layout." . $module_info['funcs'][$op]['layout'] . ".tpl", NV_ROOTDIR . "/themes/" . $global_config['module_theme'] . "/layout/" );


Changed to:
Mã: Chọn hết
$xtpl = new XTemplate( "layout." . $module_info['layout_funcs'][$op] . ".tpl", NV_ROOTDIR . "/themes/" . $global_config['module_theme'] . "/layout/" );


---------------------------------------------------------

Find and delete:
Mã: Chọn hết
if ( $my_head ) $xtpl->assign( 'THEME_MY_HEAD', $my_head );


Mã: Chọn hết
$xtpl->assign( 'THEME_FOOTER_JS', $theme_footer_js );
if ( $my_footer ) $xtpl->assign( 'THEME_MY_FOOTER', $my_footer );


Mã: Chọn hết
if ( defined( 'NV_IS_ADMIN' ) )
{
$xtpl->assign( 'THEME_ADMIN_MENU', nv_admin_menu() );
$end_time = array_sum( explode( " ", microtime() ) );
$total_time = substr( ( $end_time - NV_START_TIME + $db->time ), 0, 5 );
$theme_click_show_queries = "";
if ( defined( 'NV_IS_SPADMIN' ) )
{
$show_queries = " <a href=\"#queries\" onclick=\"nv_show_hidden('div_hide',2);\">" . $lang_global['show_queries'] . "</a>";
$theme_click_show_queries = $lang_global['db_num_queries'] . ": " . count( $db->query_strs ) . " / " . $total_time . "'." . $show_queries . "<br />\n";
}
$xtpl->assign( 'CLICK_SHOW_QUERIES', $theme_click_show_queries );
$xtpl->assign( 'SHOW_QUERIES_FOR_ADMIN', nv_show_queries_for_admin() );
$xtpl->parse( 'main.for_admin' );
}


Mã: Chọn hết
$xtpl->assign( 'THEME_ERROR_INFO', nv_error_info() );


Mã: Chọn hết
foreach ( $nv_array_block_contents as $position => $blcontent )
{
$sitecontent = str_replace( $position, $blcontent, $sitecontent );
}


Find the line:
Mã: Chọn hết
$sitecontent = $xtpl->text( 'main' );


Add the following below:
Mã: Chọn hết

$sitecontent = nv_blocks_content($sitecontent);
$sitecontent = str_replace( '[THEME_ERROR_INFO]', nv_error_info(), $sitecontent );

$my_footer = $theme_footer_js . $my_footer;
if ( defined( 'NV_IS_ADMIN' ) )
{
$my_footer = nv_admin_menu() . $my_footer;
}
if ( ! empty( $my_head ) ) $sitecontent = preg_replace( '/(<\/head>)/i', $my_head . "\\1", $sitecontent, 1 );
if ( ! empty( $my_footer ) ) $sitecontent = preg_replace( '/(<\/body>)/i', $my_footer . "\\1", $sitecontent, 1 );


4.4) If your themes has file: themes\my_theme\modules\contact\form.tpl
Find the line:
Mã: Chọn hết
<option value="{SELECT_VALUE}">{SELECT_NAME}</option>


Replace with:
Mã: Chọn hết
<option value="{SELECT_VALUE}" {SELECTED}>{SELECT_NAME}</option>


4.5) If your themes has file: themes\my_theme\modules\download\upload.tpl
Find the line:
Mã: Chọn hết
<dl class="clearfix">
<dd class="fl" style="vertical-align:top">
<label>
{LANG.upload_files}<br />
(<em>{LANG.upload_valid_ext_info}: {EXT_ALLOWED}</em>)
</label>
</dd>
<dt class="fl">
<input type="file" class="txt" name="upload_fileupload" id="upload_fileupload" />
</dt>
</dl>


Add to before:
Mã: Chọn hết
<!-- BEGIN: is_upload_allow -->


Add the following below:
Mã: Chọn hết
<!-- END: is_upload_allow -->


4.6) If your themes has file: themes\my_theme\ modules\news\search.tpl
Find the line:
Mã: Chọn hết
http://www.google.com.vn/custom


Replace with:
Mã: Chọn hết
http://www.google.com/search


4.7) If your themes has file: themes\my_theme\modules\search\form.tpl
Find the line:
Mã: Chọn hết
http://www.google.com/cse


Replace with:
Mã: Chọn hết
http://www.google.com/search


5.) Download attached file, unzip and upload to the host to replace file is using.
http://nuke-viet.googlecode.com/files/Update_NukeViet3.3.06.zip
Upload all files edited in theme to the site.

If the site is a white page, open file mainfile.php and find the line:
Mã: Chọn hết
if ( $global_config['getloadavg'] ) require ( NV_ROOTDIR . "/includes/getloadavg.php" );


Replace with:
Mã: Chọn hết
if (isset($global_config['getloadavg']) and $global_config['getloadavg'] ) require ( NV_ROOTDIR . "/includes/getloadavg.php" );


6) Login to site with administrator supreme then visit link: http://mysite.com/update_nukeviet3.3.vi.php which: http://mysite.com is your domain name may be: http://domain.com/installation_directory_Nukeviet

Wait until complete and delete file update_nukeviet3.3.php file, if any.

7) If you use a single language, the regional of management:

Click Language -> Configure the interface language to delete the language not use.
If you do not use that module, for example, do not use module shops, click Manage Modules -> Setting up a new module, remove the module does not use.

If you use is not the language is Vietnamese and English, should improve on the language packs, Reference the http://translate.nukeviet.vn to have a more full version.

In the menu Configuration -> Configure file robots.txt to correct robots.txt file configured properly.
#101094 gửi bởi hunghtqni
Ngày 15 Tháng 11 2011 , 21:46
If you upgrade directly from NukeViet 3.1 Up to NukeViet 3.3 you need to corrected as follows:

If you are not using the default theme, need to edit the theme as follows:
Copy the following files to the directory corresponding to your theme.
themes\default\modules\users\re_groups.tpl (If the directory themes\my_theme\modules\users\)

Edit the following file corresponding to your theme: (If the directory themes\my_theme\modules\users\)

file: themes\default\modules\users\changepass.tpl
themes\default\modules\users\changequestion.tpl
themes\default\modules\users\info.tpl
themes\default\modules\users\openid_administrator.tpl
themes\default\modules\users\userinfo.tpl

with the modified theme from the default theme
Find the line:
Mã: Chọn hết
<!-- BEGIN: logout --><strong>&middot;</strong> <a href="{URL_HREF}logout">{LANG.logout_title}</a><!-- END: logout -->


Add to before:
Mã: Chọn hết
<!-- BEGIN: regroups --><strong>&middot;</strong><a href="{URL_HREF}regroups">{LANG.in_group}<!-- END: regroups -->


with the modified theme from the modern theme
Find the line:
Mã: Chọn hết
<li><!-- BEGIN: logout --><a href="{URL_HREF}logout">{LANG.logout_title}</a><!-- END: logout --></li>


Replace with:
Mã: Chọn hết

<!-- BEGIN: regroups --><li><a href="{URL_HREF}regroups">{LANG.in_group}</a></li><!-- END: regroups -->
<!-- BEGIN: logout --><li><a href="{URL_HREF}logout">{LANG.logout_title}</a></li><!-- END: logout -->
#101105 gửi bởi hunghtqni
Ngày 15 Tháng 11 2011 , 22:34
With the block of module News (the block is not in the default)
need to fix the SQL query as follows:

for example the SQL in version 3.2 NukeViet:
Mã: Chọn hết
$sql = "SELECT id, listcatid, publtime, exptime, title, alias, hometext, homeimgthumb, homeimgfile FROM `" . NV_PREFIXLANG . "_" . $module_data . "_rows` WHERE `status`= 1 AND `publtime` < " . NV_CURRENTTIME . " AND (`exptime`=0 OR `exptime`>" . NV_CURRENTTIME . ") ORDER BY `publtime` DESC LIMIT 0 , 4";


In Nukeviet 3.2 be changed to
Mã: Chọn hết
$sql = "SELECT id, listcatid, publtime, exptime, title, alias, hometext, homeimgthumb, homeimgfile FROM `" . NV_PREFIXLANG . "_" . $module_data . "_rows` WHERE `status`= 1 ORDER BY `publtime` DESC LIMIT 0 , 4";


(That is delete paragraph: AND `publtime` < " . NV_CURRENTTIME . " AND (`exptime`=0 OR `exptime`>" . NV_CURRENTTIME . ") )

Also in the table xx_xx_news_rows, will no longer the fields: imgposition copyright allowed_send allowed_print allowed_save, so if block of you have these fields, the need to rewrite accordingly.

(P/S: Anh kiểm tra lại giúp em: "trường trong DB nghĩa là gì, em không rõ lắm nên tạm dịch vậy. Nếu anh sửa lại thì xóa dòng này)
#118663 gửi bởi sonbkmta
Ngày 22 Tháng 06 2012 , 05:39
làm sao để sửa DB từ phiên bản 2.0 lên 3.4 giờ nhỉ? dữ liệu cũ chả nhẽ bỏ hết đi sao?

Gia đình là trên hết => http://webgiadinh.vn Phụ kiện: AriBlade 2010 - HP Envy 14 - Nikon D3100 - IP4 World - BlackBerry Tour 9630.
#118713 gửi bởi hoaquynhtim99
Ngày 22 Tháng 06 2012 , 18:57
sonbkmta đã viết:làm sao để sửa DB từ phiên bản 2.0 lên 3.4 giờ nhỉ? dữ liệu cũ chả nhẽ bỏ hết đi sao?
Bạn update dần lên, có hướng dẫn update cho đầy đủ các phiên bản

Hãy sống là chính mình, bình thường nhưng không tầm thường.