Skip to content

Commit

Permalink
Merge pull request #108 from nukeviet/develop
Browse files Browse the repository at this point in the history
Egov 1.2.02
  • Loading branch information
hoaquynhtim99 authored Jun 22, 2020
2 parents 9e24658 + ca12698 commit 09875af
Show file tree
Hide file tree
Showing 31 changed files with 530 additions and 288 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
CHANGE LOG: NukeViet eGovernment
http://egov.nukeviet.vn

NukeViet eGovernment 1.2.02
- Cập nhật NukeViet CMS 4.4.02

NukeViet eGovernment 1.2.01
- Cập nhật NukeViet CMS 4.4.01
- Sửa lỗi thanh tìm kiếm trên giao diện mobile không hoạt động (#104)
Expand Down
31 changes: 16 additions & 15 deletions admin/themes/sort_order.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,15 @@
* @Createdate 2-9-2010 14:43
* @Development version theme control
*/

if (!defined('NV_IS_FILE_THEMES')) {
die('Stop!!!');
}

$array_bid = $nv_Request->get_typed_array('bl', 'post', 'int', array());
$array_bid = $nv_Request->get_typed_array('bl', 'post', 'int', []);
$func_id = $nv_Request->get_int('func_id', 'post');

$position = $nv_Request->get_string('position', 'post');

if (md5(NV_CHECK_SESSION . '_' . $position) == $nv_Request->get_string('checkss', 'post')) {
if (!empty($array_bid) and !empty($position)) {
$pos_new = '[' . $position . ']';
Expand All @@ -41,22 +42,22 @@

$weight = 0;
while (list ($bid_i) = $sth->fetch(3)) {
++ $weight;
++$weight;
$db->query('UPDATE ' . NV_BLOCKS_TABLE . '_groups SET weight=' . $weight . ' WHERE bid=' . $bid_i);
}

if ($weight) {
$func_id_old = $weight = 0;

$sth = $db->prepare('SELECT t1.bid, t1.func_id FROM ' . NV_BLOCKS_TABLE . '_weight t1
INNER JOIN ' . NV_BLOCKS_TABLE . '_groups t2 ON t1.bid = t2.bid
WHERE t2.theme= :theme AND t2.position= :position ORDER BY t1.func_id ASC, t1.weight ASC');
INNER JOIN ' . NV_BLOCKS_TABLE . '_groups t2 ON t1.bid = t2.bid
WHERE t2.theme= :theme AND t2.position= :position ORDER BY t1.func_id ASC, t1.weight ASC');
$sth->bindParam(':theme', $theme, PDO::PARAM_STR);
$sth->bindParam(':position', $pos_old, PDO::PARAM_STR);
$sth->execute();
while (list ($bid_i, $func_id_i) = $sth->fetch(3)) {
if ($func_id_i == $func_id_old) {
++ $weight;
++$weight;
} else {
$weight = 1;
$func_id_old = $func_id_i;
Expand All @@ -67,29 +68,29 @@

// Update weight for news position
$sth = $db->prepare('SELECT bid FROM ' . NV_BLOCKS_TABLE . '_groups
WHERE theme= :theme AND position= :position
ORDER BY weight ASC');
WHERE theme= :theme AND position= :position
ORDER BY weight ASC');
$sth->bindParam(':theme', $theme, PDO::PARAM_STR);
$sth->bindParam(':position', $pos_new, PDO::PARAM_STR);
$sth->execute();

$weight = 0;
while (list ($bid_i) = $sth->fetch(3)) {
++ $weight;
++$weight;
$db->query('UPDATE ' . NV_BLOCKS_TABLE . '_groups SET weight=' . $weight . ' WHERE bid=' . $bid_i);
}

$func_id_old = $weight = 0;
$sth = $db->prepare('SELECT t1.bid, t1.func_id FROM ' . NV_BLOCKS_TABLE . '_weight t1
INNER JOIN ' . NV_BLOCKS_TABLE . '_groups t2 ON t1.bid = t2.bid
WHERE t2.theme= :theme AND t2.position= :position
ORDER BY t1.func_id ASC, t1.weight ASC');
INNER JOIN ' . NV_BLOCKS_TABLE . '_groups t2 ON t1.bid = t2.bid
WHERE t2.theme= :theme AND t2.position= :position
ORDER BY t1.func_id ASC, t1.weight ASC');
$sth->bindParam(':theme', $theme, PDO::PARAM_STR);
$sth->bindParam(':position', $pos_new, PDO::PARAM_STR);
$sth->execute();
while (list ($bid_i, $func_id_i) = $sth->fetch(3)) {
if ($func_id_i == $func_id_old) {
++ $weight;
++$weight;
} else {
$weight = 1;
$func_id_old = $func_id_i;
Expand All @@ -104,7 +105,7 @@
if (!empty($array_bid) and $func_id > 0) {
foreach ($array_bid as $bid) {
$db->query('UPDATE ' . NV_BLOCKS_TABLE . '_weight SET weight = ' . $weight . ' WHERE bid = ' . $bid . ' AND func_id=' . $func_id);
++ $weight;
++$weight;
}
}

Expand All @@ -114,4 +115,4 @@
$db->query('OPTIMIZE TABLE ' . NV_BLOCKS_TABLE . '_weight');
}

die('OK_' . $func_id);
die('OK_' . $func_id);
108 changes: 54 additions & 54 deletions assets/js/admin.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,63 +7,63 @@
*/

function nv_admin_logout() {
confirm(nv_admlogout_confirm[0]) && $.get(nv_base_siteurl + "index.php?second=admin_logout&js=1&nocache=" + (new Date).getTime(), function(b) {
1 == b && (alert(nv_admlogout_confirm[1]), window.location.href = 1 == nv_area_admin ? nv_base_siteurl + "index.php" : strHref)
});
return !1
confirm(nv_admlogout_confirm[0]) && $.get(nv_base_siteurl + "index.php?second=admin_logout&js=1&nocache=" + (new Date).getTime(), function(b) {
1 == b && (alert(nv_admlogout_confirm[1]), window.location.href = 1 == nv_area_admin ? nv_base_siteurl + "index.php" : strHref)
});
return !1
}
function nv_sh(b, a) {
3 == $("#" + b).val() ? nv_show_hidden(a, 1) : nv_show_hidden(a, 0);
return !1
3 == $("#" + b).val() ? nv_show_hidden(a, 1) : nv_show_hidden(a, 0);
return !1
}
$(function() {
if ("undefined" != typeof drag_block && 0 != drag_block) {
$("a.delblock").click(function() {
confirm(block_delete_confirm) && $.post(post_url + "blocks_del", "bid=" + $(this).attr("name") + "&checkss=" + $(this).data("checkss"), function(a) {
alert(a);
window.location.href = selfurl
})
});
$("a.outgroupblock").click(function() {
confirm(block_outgroup_confirm) && $.post(post_url + "block_outgroup", "func_id=" + func_id + "&bid=" + $(this).attr("name") + "&checkss=" + $(this).data("checkss"), function(a) {
alert(a);
window.location.href = selfurl
})
});
$("a.block_content").click(function() {
nv_open_browse(post_url + "block_content&selectthemes=" + module_theme + "&tag=" + $(this).attr("id") + "&bid=" + $(this).attr("name") + "&blockredirect=" + blockredirect, "ChangeBlock", 800, 500, "resizable=no,scrollbars=yes,toolbar=no,location=no,status=no")
});
if ("undefined" != typeof drag_block && 0 != drag_block) {
$("a.delblock").click(function() {
confirm(block_delete_confirm) && $.post(post_url + "blocks_del", "bid=" + $(this).attr("name") + "&checkss=" + $(this).data("checkss"), function(a) {
alert(a);
window.location.href = selfurl
})
});
$("a.outgroupblock").click(function() {
confirm(block_outgroup_confirm) && $.post(post_url + "block_outgroup", "func_id=" + func_id + "&bid=" + $(this).attr("name") + "&checkss=" + $(this).data("checkss"), function(a) {
alert(a);
window.location.href = selfurl
})
});
$("a.block_content").click(function() {
nv_open_browse(post_url + "block_content&selectthemes=" + module_theme + "&tag=" + $(this).attr("id") + "&bid=" + $(this).attr("name") + "&blockredirect=" + blockredirect, "ChangeBlock", 800, 500, "resizable=no,scrollbars=yes,toolbar=no,location=no,status=no")
});
$("a.actblock").click(function() {
$(this).prop("disabled", !0);
var a = this;
$.ajax({
type: "post",
url: post_url + "block_change_show",
data: "bid=" + $(this).attr("name") + "&checkss=" + $(this).data("checkss"),
cache: !1,
dataType: "json"
}).done(function(b) {
$(a).prop("disabled", !1);
"ok" == b.status && ($(a).attr("title", $(a).attr("data-" + b.act)).attr("alt", $(a).attr("data-" + b.act)).find("em").attr("class", $("em", a).attr("data-" + b.act)), "act" == b.act ? $(a).parent().parent().find(".blockct").removeClass("act0") : $(a).parent().parent().find(".blockct").addClass("act0"))
})
$(this).prop("disabled", !0);
var a = this;
$.ajax({
type: "post",
url: post_url + "block_change_show",
data: "bid=" + $(this).attr("name") + "&checkss=" + $(this).data("checkss"),
cache: !1,
dataType: "json"
}).done(function(b) {
$(a).prop("disabled", !1);
"ok" == b.status && ($(a).attr("title", $(a).attr("data-" + b.act)).attr("alt", $(a).attr("data-" + b.act)).find("em").attr("class", $("em", a).attr("data-" + b.act)), "act" == b.act ? $(a).parent().parent().find(".blockct").removeClass("act0") : $(a).parent().parent().find(".blockct").addClass("act0"))
});
});
var b = !1;
$(".column").sortable({
connectWith: ".column",
opacity: .8,
cursor: "move",
receive: function() {
b = !0;
$.post(post_url + "sort_order", $(this).sortable("serialize") + "&position=" + $(this).data("id") + "&checkss=" + $(this).data("checkss") + "&func_id=" + func_id, function(a) {
a == "OK_" + func_id ? $("div#toolbar>ul.info").html('<li><span style="color:#ff0000;padding-left:150px;font-weight:700;">' + blocks_saved + "</span></li>").fadeIn(1E3) : alert(blocks_saved_error)
});
},
stop: function() {
0 == b && $.post(post_url + "sort_order", $(this).sortable("serialize") + "&position=" + $(this).data("id") + "&checkss=" + $(this).data("checkss") + "&func_id=" + func_id, function(a) {
a == "OK_" + func_id ? $("div#toolbar>ul.info").html('<span style="color:#ff0000;padding-left:150px;font-weight:700;">' + blocks_saved + "</span>").fadeIn(1E3) : alert(blocks_saved_error)
});
}
});
var b = !1;
$(".column").sortable({
connectWith: ".column",
opacity: .8,
cursor: "move",
receive: function() {
b = !0;
$.post(post_url + "sort_order", $(this).sortable("serialize") + "&position=" + $(this).data("id") + "&checkss=" + $(this).data("checkss") + "&func_id=" + func_id, function(a) {
a == "OK_" + func_id ? $("div#toolbar>ul.info").html('<li><span style="color:#ff0000;padding-left:150px;font-weight:700;">' + blocks_saved + "</span></li>").fadeIn(1E3) : alert(blocks_saved_error)
})
},
stop: function() {
0 == b && $.post(post_url + "sort_order", $(this).sortable("serialize") + "&checkss=" + $(this).data("checkss") + "&func_id=" + func_id, function(a) {
a == "OK_" + func_id ? $("div#toolbar>ul.info").html('<span style="color:#ff0000;padding-left:150px;font-weight:700;">' + blocks_saved + "</span>").fadeIn(1E3) : alert(blocks_saved_error)
})
}
});
$(".column").disableSelection()
}
});
$(".column").disableSelection();
}
});
30 changes: 15 additions & 15 deletions includes/action_mysql.php
Original file line number Diff line number Diff line change
Expand Up @@ -174,21 +174,21 @@ function nv_create_table_sys($lang)
title, module_file, module_data, module_upload, module_theme, custom_title, admin_title, set_time, main_file, admin_file,
theme, mobile, description, keywords, groups_view, weight, act, admins, rss, sitemap
) VALUES
('about', 'page', 'about', 'about', 'page', 'About', '', 1592038800, 1, 1, '', '', '', '', '0', 1, 1, '', 1, 1),
('news', 'news', 'news', 'news', 'news', 'News', '', 1592038800, 1, 1, '', '', '', '', '0', 2, 1, '', 1, 1),
('users', 'users', 'users', 'users', 'users', 'Users', 'Users', 1592038800, 1, 1, '', '', '', '', '0', 3, 1, '', 0, 1),
('contact', 'contact', 'contact', 'contact', 'contact', 'Contact', '', 1592038800, 1, 1, '', '', '', '', '0', 4, 1, '', 0, 1),
('statistics', 'statistics', 'statistics', 'statistics', 'statistics', 'Statistics', '', 1592038800, 1, 0, '', '', '', '', '0', 5, 1, '', 0, 1),
('voting', 'voting', 'voting', 'voting', 'voting', 'Voting', '', 1592038800, 1, 1, '', '', '', '', '0', 6, 1, '', 1, 1),
('banners', 'banners', 'banners', 'banners', 'banners', 'Banners', '', 1592038800, 1, 1, '', '', '', '', '0', 7, 1, '', 0, 1),
('seek', 'seek', 'seek', 'seek', 'seek', 'Search', '', 1592038800, 1, 0, '', '', '', '', '0', 8, 1, '', 0, 1),
('menu', 'menu', 'menu', 'menu', 'menu', 'Menu Site', '', 1592038800, 0, 1, '', '', '', '', '0', 9, 1, '', 0, 1),
('feeds', 'feeds', 'feeds', 'feeds', 'feeds', 'Rss Feeds', '', 1592038800, 1, 1, '', '', '', '', '0', 10, 1, '', 0, 1),
('page', 'page', 'page', 'page', 'page', 'Page', '', 1592038800, 1, 1, '', '', '', '', '0', 11, 1, '', 1, 0),
('comment', 'comment', 'comment', 'comment', 'comment', 'Comment', '', 1592038800, 1, 1, '', '', '', '', '0', 12, 1, '', 0, 1),
('siteterms', 'page', 'siteterms', 'siteterms', 'page', 'Siteterms', '', 1592038800, 1, 1, '', '', '', '', '0', 13, 1, '', 1, 1),
('freecontent', 'freecontent', 'freecontent', 'freecontent', 'freecontent', 'Free Content', '', 1592038800, 0, 1, '', '', '', '', '0', 14, 1, '', 0, 1),
('two-step-verification', 'two-step-verification', 'two_step_verification', 'two-step-verification', 'two_step_verification', 'Two-Step Verification', '', 1592038800, 1, 0, '', '', '', '', '0', 15, 1, '', 0, 1)";
('about', 'page', 'about', 'about', 'page', 'About', '', 1592816400, 1, 1, '', '', '', '', '0', 1, 1, '', 1, 1),
('news', 'news', 'news', 'news', 'news', 'News', '', 1592816400, 1, 1, '', '', '', '', '0', 2, 1, '', 1, 1),
('users', 'users', 'users', 'users', 'users', 'Users', 'Users', 1592816400, 1, 1, '', '', '', '', '0', 3, 1, '', 0, 1),
('contact', 'contact', 'contact', 'contact', 'contact', 'Contact', '', 1592816400, 1, 1, '', '', '', '', '0', 4, 1, '', 0, 1),
('statistics', 'statistics', 'statistics', 'statistics', 'statistics', 'Statistics', '', 1592816400, 1, 0, '', '', '', '', '0', 5, 1, '', 0, 1),
('voting', 'voting', 'voting', 'voting', 'voting', 'Voting', '', 1592816400, 1, 1, '', '', '', '', '0', 6, 1, '', 1, 1),
('banners', 'banners', 'banners', 'banners', 'banners', 'Banners', '', 1592816400, 1, 1, '', '', '', '', '0', 7, 1, '', 0, 1),
('seek', 'seek', 'seek', 'seek', 'seek', 'Search', '', 1592816400, 1, 0, '', '', '', '', '0', 8, 1, '', 0, 1),
('menu', 'menu', 'menu', 'menu', 'menu', 'Menu Site', '', 1592816400, 0, 1, '', '', '', '', '0', 9, 1, '', 0, 1),
('feeds', 'feeds', 'feeds', 'feeds', 'feeds', 'Rss Feeds', '', 1592816400, 1, 1, '', '', '', '', '0', 10, 1, '', 0, 1),
('page', 'page', 'page', 'page', 'page', 'Page', '', 1592816400, 1, 1, '', '', '', '', '0', 11, 1, '', 1, 0),
('comment', 'comment', 'comment', 'comment', 'comment', 'Comment', '', 1592816400, 1, 1, '', '', '', '', '0', 12, 1, '', 0, 1),
('siteterms', 'page', 'siteterms', 'siteterms', 'page', 'Siteterms', '', 1592816400, 1, 1, '', '', '', '', '0', 13, 1, '', 1, 1),
('freecontent', 'freecontent', 'freecontent', 'freecontent', 'freecontent', 'Free Content', '', 1592816400, 0, 1, '', '', '', '', '0', 14, 1, '', 0, 1),
('two-step-verification', 'two-step-verification', 'two_step_verification', 'two-step-verification', 'two_step_verification', 'Two-Step Verification', '', 1592816400, 1, 0, '', '', '', '', '0', 15, 1, '', 0, 1)";

$sql_create_table[] = "INSERT INTO " . NV_CONFIG_GLOBALTABLE . " (lang, module, config_name, config_value) VALUES
('" . $lang . "', 'global', 'site_domain', ''),
Expand Down
Loading

0 comments on commit 09875af

Please sign in to comment.