Skip to content

Commit

Permalink
Discuz! X3.5 Thai R20230726 Rev.7
Browse files Browse the repository at this point in the history
- เพิ่ม ฟีเจอร์การอัปโหลดโลโก้สำหรับเทมเพลตได้เองที่ระบบหลังบ้าน (AdminCP)
- ลบ ปลั๊กอิน wechat ออก แล้วนำปลั๊กอิน witframe_api แทน
- ปรับปรุง การแปลภาษาไทยของสัญญาอนุญาตให้ใช้สิทธิในหน้าติดตั้งใหม่
- ปรับปรุง CSS ระบบหลังบ้าน (AdminCP) เช่น โหมดสีเข้ม (Dark mode) ใหม่ ให้มีประสิทธิภาพแสดงผลที่ดียิ่งขึ้น
- ปรับปรุง สะสมตามรอบการปรับปรุงของ Discuz! X3.5 20230726
- ปรับปรุง ฐานข้อมูล GeoIP2 จาก MaxMind's GeoLite2 City วันที่ 1 กันยายน 2023
- แก้ไขข้อผิดพลาดและปรับปรุงประสิทธิภาพการทำงานทั่วไป
  • Loading branch information
jaideejung007 committed Sep 1, 2023
1 parent 6f985cd commit 3225d19
Show file tree
Hide file tree
Showing 148 changed files with 1,389 additions and 8,787 deletions.
68 changes: 33 additions & 35 deletions LICENSE

Large diffs are not rendered by default.

66 changes: 33 additions & 33 deletions readme/license.txt

Large diffs are not rendered by default.

Binary file modified upload/data/ipdata/GeoLite2-City.mmdb
Binary file not shown.
2 changes: 1 addition & 1 deletion upload/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@
}
if(empty($url) && empty($_ENV['curapp'])) {
if(!empty($_ENV['domain']['defaultindex']) && !$jump) {
if($_ENV['defaultapp'][$_ENV['domain']['defaultindex']]) {
if(!empty($_ENV['defaultapp'][$_ENV['domain']['defaultindex']])) {
$_ENV['curapp'] = $_ENV['defaultapp'][$_ENV['domain']['defaultindex']];
} else {
$url = $_ENV['domain']['defaultindex'];
Expand Down
16 changes: 8 additions & 8 deletions upload/install/data/install_data.sql

Large diffs are not rendered by default.

72 changes: 57 additions & 15 deletions upload/install/include/install_function.php
Original file line number Diff line number Diff line change
Expand Up @@ -879,10 +879,11 @@ function authcode($string, $operation = 'DECODE', $key = '', $expiry = 0) {

function show_db_install() {
if(VIEW_OFF) return;
global $dbhost, $dbuser, $dbpw, $dbname, $tablepre, $username, $password, $email, $uid;
global $dbhost, $dbuser, $dbpw, $dbname, $tablepre, $username, $password, $email, $uid, $myisam2innodb;
$dzucfull = DZUCFULL;
$dzucstl = DZUCSTL ? 1 : 0;
$allinfo = base64_encode(serialize(compact('dbhost', 'dbuser', 'dbpw', 'dbname', 'tablepre', 'username', 'password', 'email', 'dzucfull', 'dzucstl', 'uid')));
$succlang = $myisam2innodb ? 'initdbinnodbresult_succ' : 'initdbdataresult_succ';
$allinfo = base64_encode(serialize(compact('dbhost', 'dbuser', 'dbpw', 'dbname', 'tablepre', 'username', 'password', 'email', 'dzucfull', 'dzucstl', 'uid', 'myisam2innodb')));
init_install_log_file();
?>
<script type="text/javascript">
Expand Down Expand Up @@ -969,29 +970,59 @@ function request_do_db_init() {
ajax.get('index.php?<?= http_build_query(array('method' => 'do_db_init', 'allinfo' => $allinfo)) ?>', function(data) {
if(data.indexOf('Discuz! Database Error') !== -1 || data.indexOf('Discuz! System Error') !== -1 || data.indexOf('Fatal error') !== -1) {
var p = document.createElement('p');
p.innerText = '<?= lang('failed') ?> ' + data;
p.innerHTML = '<?= lang('failed') ?> ' + data;
p.className = 'red';
append_notice(p.outerHTML);
append_notice('<p class="red"><?= lang('error_quit_msg') ?></p>');
document.getElementById('laststep').value = '<?= lang('error_reinstall_msg') ?>';
add_instfail();
return;
}
request_do_db_data_init();
var resultDiv = document.getElementById('notice');
if(resultDiv.innerHTML.indexOf('<?= lang('failed') ?>') === -1) {
request_do_db_data_init();
}
});
}

function request_do_db_data_init() {
ajax.get('index.php?<?= http_build_query(array('method' => 'do_db_data_init', 'allinfo' => $allinfo)) ?>', function(data) {
if(data.indexOf('Discuz! Database Error') !== -1 || data.indexOf('Discuz! System Error') !== -1 || data.indexOf('Fatal error') !== -1) {
var p = document.createElement('p');
p.innerText = '<?= lang('failed') ?> ' + data;
p.innerHTML = '<?= lang('failed') ?> ' + data;
p.className = 'red';
append_notice(p.outerHTML);
append_notice('<p class="red"><?= lang('error_quit_msg') ?></p>');
document.getElementById('laststep').value = '<?= lang('error_reinstall_msg') ?>';
add_instfail();
return;
}
var resultDiv = document.getElementById('notice');
if(resultDiv.innerHTML.indexOf('<?= lang('failed') ?>') === -1) {
<?php echo $myisam2innodb ? 'request_do_db_innodb(0);' : 'request_do_initsys();';?>
}
});
}

function request_do_db_innodb(i) {
ajax.get('index.php?<?= http_build_query(array('method' => 'do_db_innodb', 'allinfo' => $allinfo)) ?>&i=' + i, function(data) {
if(data.indexOf('Discuz! Database Error') !== -1 || data.indexOf('Discuz! System Error') !== -1 || data.indexOf('Fatal error') !== -1) {
var p = document.createElement('p');
p.innerHTML = '<?= lang('failed') ?> ' + data;
p.className = 'red';
append_notice(p.outerHTML);
append_notice('<p class="red"><?= lang('error_quit_msg') ?></p>');
add_instfail();
return;
}
request_do_initsys();
var resultDiv = document.getElementById('notice');
if(resultDiv.innerHTML.indexOf('<?= lang('failed') ?>') === -1) {
if(resultDiv.innerHTML.indexOf('<?= lang('initdbinnodbresult_succ') ?>') !== -1) {
request_do_initsys();
} else if(document.getElementById('laststep').value.indexOf('<?= lang('install_in_processed') ?>') !== -1) {
request_do_db_innodb(Number(i)+1);
}
}
});
}

Expand Down Expand Up @@ -1037,7 +1068,7 @@ function request_log() {
add_instfail();
return;
}
if(data.indexOf('<?= lang('initdbdataresult_succ') ?>') === -1) {
if(data.indexOf('<?= lang($succlang) ?>') === -1) {
setTimeout(request_log, 200);
}
});
Expand All @@ -1046,10 +1077,12 @@ function request_log() {
function request_do_initsys() {
var resultDiv = document.getElementById('notice');
if(resultDiv.innerHTML.indexOf('<?= lang('failed') ?>') !== -1) {
document.getElementById('laststep').value = '<?= lang('error_quit_msg') ?>';
if(document.getElementById('laststep').value.indexOf('<?= lang('error_reinstall_msg') ?>') === -1) {
document.getElementById('laststep').value = '<?= lang('error_quit_msg') ?>';
}
return;
}
if(resultDiv.innerHTML.indexOf('<?= lang('initdbdataresult_succ') ?>') !== -1) {
if(resultDiv.innerHTML.indexOf('<?= lang($succlang) ?>') !== -1) {
append_notice("<p><?= lang('initsys') ?> ... </p>");
refresh_lastmsg();
ajax.get('../misc.php?mod=initsys', function(callback, status) {
Expand Down Expand Up @@ -1170,7 +1203,6 @@ function runucquery($sql, $tablepre) {
foreach($ret as $query) {
$query = trim($query);
if($query) {

if(substr($query, 0, 12) == 'CREATE TABLE') {
$name = preg_replace("/CREATE TABLE ([a-z0-9_]+) .*/is", "\\1", $query);
if($db->query(createtable($query, $db->version()))) {
Expand All @@ -1180,12 +1212,15 @@ function runucquery($sql, $tablepre) {
return false;
}
} else {
$db->query($query);
if (!$db->query($query)) {
showjsmessage(lang('failed') . "\n");
return false;
}
}

}
}

return true;
}


Expand Down Expand Up @@ -1430,7 +1465,7 @@ function show_error($type, $errors = '', $quit = false) {
if($step > 0) {
echo "<div class=\"desc\"><b>$title</b><ul>$comment</ul>";
} else {
echo "</div><div class=\"main\"><b>$title</b><ul style=\"line-height: 200%; margin-left: 30px;\">$comment</ul>";
echo "<div><b>$title</b><ul style=\"line-height: 200%; margin-left: 30px;\">$comment</ul>";
}

if($quit) {
Expand Down Expand Up @@ -1668,12 +1703,19 @@ function uc_write_config($config, $file, $password) {
}

function install_uc_server() {
global $db, $dbhost, $dbuser, $dbpw, $dbname, $tablepre, $username, $password, $email, $dzucstl;
global $db, $dbhost, $dbuser, $dbpw, $dbname, $tablepre, $username, $password, $email, $dzucstl, $myisam2innodb;

$ucsql = file_get_contents(ROOT_PATH.'./uc_server/install/uc.sql');
$uctablepre = $tablepre.'ucenter_';
$ucsql = str_replace(' uc_', ' '.$uctablepre, $ucsql);
$ucsql && runucquery($ucsql, $uctablepre);
if ($ucsql) {
if($myisam2innodb) {
$ucsql = str_replace('ENGINE=InnoDB', 'ENGINE=MyISAM', $ucsql);
}
if (!runucquery($ucsql, $uctablepre)) {
exit();
}
}
$appauthkey = _generate_key();
$ucdbhost = $dbhost;
$ucdbname = $dbname;
Expand Down
Loading

0 comments on commit 3225d19

Please sign in to comment.