Skip to content

Commit

Permalink
Discuz! X3.4 Thai UTF-8 R20210917, Rev.68
Browse files Browse the repository at this point in the history
- Add: addClass() removeClass() toggleClass()
- Add: Language pack keys for PHP version is too low during installation
- Add: New feature to detect the latest version during installation
- Optimize: HTML5 media playback function module loading
- Optimize: Improve the clarity of HTML5 avatar upload
- Optimize: Search engine inclusion strategy
- Optimize: Synchronize config_global_default.php with v3.5 branch modification to facilitate the merging between later branches
- Optimize: Thread table optimization
- Optimize: Waitid parameter in the original _ajaxpost was only passed in but not used in any way, which made the parameter meaningless and has been fixed.
- Fix: Abnormal group sorting in MySQL 5.7
- Fix: Content re-review caused the website to run slowly
- Fix: Database error report for GROUP BY clause
- Fix: Error of adding single quotes to the $ symbol in the code tag
- Fix: First page of the tag list shows all topics
- Fix: Group related text is not displayed due to the redundant group opening entry
- Fix: Missing code of !927
- Fix: No section partition in the left navigation of the post list
- Fix: Pagination link behind the title of the forum thread list supports the "New Window" function
- Fix: Ppicture that is not inserted into the sticker is displayed abnormally in the touch screen version
- Fix: Problem that the ixigua.com video cannot be parsed and played normally on the mobile device
- Fix: QQ guest user group name is empty after the QQ Internet plug-in is installed
- Fix: Remove obsolete language keys
- Fix: Remove redundant tags
- Fix: Security issues that can be bypassed by the mail authentication entrance CSRF and time limit
- Fix: Thread table bug
- Fix: Waitid parameter of _ajaxpost() is invalid, and fix the problem of abnormal operation of ajaxpost with functions such as [voting][report] due to the last modification
- Fix: When a reply is deleted, you can also like it
- Fix: Wrong style of the QQ share button on the forum post content page
  • Loading branch information
jaideejung007 committed Sep 28, 2021
1 parent f7296a7 commit 45e5ff1
Show file tree
Hide file tree
Showing 38 changed files with 297 additions and 242 deletions.
40 changes: 0 additions & 40 deletions upload/api/connect/like.php
Original file line number Diff line number Diff line change
@@ -1,40 +0,0 @@
<?php

/**
* [Discuz!] (C)2001-2099 Comsenz Inc.
* This is NOT a freeware, use is subject to license terms
*
* $Id: like.php 25510 2011-11-14 02:22:26Z yexinhao $
*/

define('IN_API', true);
define('CURSCRIPT', 'api');

require_once '../../source/class/class_core.php';

$cachelist = array();
$discuz = C::app();
$discuz->init_setting = true;
$discuz->init();

$body = '';
$style = 'body { background: transparent; color: '.$_G['style']['tabletext'].'; font: '.$_G['style']['fontsize'].' '.$_G['style']['font'].'; margin:0; }'.
'a { color: '.$_G['style']['link'].'; text-decoration: none; } a:hover { text-decoration: underline; }';

if($_G['setting']['connect']['like_allow'] && $_G['setting']['connect']['like_url']) {
$style .= '#txQZ { border: medium none; float: left; height:21px; margin-top: 4px; overflow: hidden; width: 110px; }'.
'.vm { vertical-align: middle; }';
$body .= '<iframe id="txQZ" src="'.$_G['setting']['connect']['like_url'].'" class="vm" allowtransparency="true" scrolling="no" border="0" frameborder="0"></iframe>';
}

if($_G['setting']['connect']['turl_allow'] && $_G['setting']['connect']['turl_code']) {
$style .= '#txWB_W1 { background: url("../../static/image/common/weibo.png") no-repeat scroll 0 50% transparent; float: left; line-height: 28px; padding: 0 5px 0 20px; }'.
'#txWB_W1 img { display: none; }'.
'#txWB_W1 b { font-weight: 400; }'.
'#txWB_W1 a { color: '.$_G['style']['highlightlink'].'; }';
$body .= $_G['setting']['connect']['turl_code'];
}

if($style && $body) {
echo '<style>'.$style.'</style><body>'.$body.'</body>';
}
4 changes: 4 additions & 0 deletions upload/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@
* $Id: index.php 34524 2014-05-15 04:42:23Z nemohou $
*/

if(version_compare(PHP_VERSION, '8.0.0', '>=')) {
exit('This version of Discuz! is not compatible with >= PHP 8.0, Please install or update to higher version.');
}

if(!empty($_SERVER['QUERY_STRING']) && is_numeric($_SERVER['QUERY_STRING'])) {
$_ENV['curapp'] = 'home';
$_GET = array('mod'=>'space', 'uid'=>$_SERVER['QUERY_STRING']);
Expand Down
76 changes: 74 additions & 2 deletions upload/install/include/install_function.php
Original file line number Diff line number Diff line change
Expand Up @@ -450,8 +450,38 @@ function show_form(&$form_items, $error_msg) {
show_footer();
}

function dunserialize($data) {
if(($ret = unserialize($data)) === false) {
$ret = unserialize(stripslashes($data));
}
return $ret;
}

function cloudaddons_getversion($instid) {
$timestamp = time();
$data = 'product=discuzx&sitever='.DISCUZ_VERSION.'/'.DISCUZ_RELEASE.'&sitecharset='.CHARSET.'&addonversion=1&os='.PHP_OS .'&php='.PHP_VERSION.'&web='.$_SERVER['SERVER_SOFTWARE'].'&lang='.INSTALL_LANG.'&type=installer&instid='.$instid;
$param = 'data='.rawurlencode(base64_encode($data));
$param .= '&md5hash='.substr(md5($data.$timestamp), 8, 8).'&timestamp='.$timestamp;
$param .= '&mod=app&ac=installcheck';

$url = 'https://logs.discuzthai.com/index.php?'.$param; /*jaideejung007*/

$return = dfopen($url, 0, '', '', FALSE, '', 3);

if(!empty($return)) {
$ret = dunserialize($return);
if(is_array($ret) && isset($ret['is_latest']) && !$ret['is_latest']) {
return $ret;
} else {
return array('is_latest' => 1, 'url' => '');
}
} else {
return array('is_latest' => 1, 'url' => '');
}
}

function show_license() {
global $self, $uchidden, $step;
global $self, $uchidden, $step, $instid;
$next = $step + 1;
if(VIEW_OFF) {

Expand All @@ -464,6 +494,27 @@ function show_license() {
$license = str_replace(' ', '&nbsp; ', lang('license'));
$lang_agreement_yes = lang('agreement_yes');
$lang_agreement_no = lang('agreement_no');

$lang_php8 = lang('php8_tips');
$lang_noutf8 = lang('no_utf8_tips').lang('next_tips');
$lang_unstable = lang('unstable_tips').lang('next_tips');

$is_php8 = version_compare(PHP_VERSION, '8.0.0', '>=') ? 1 : 0;
$is_utf8 = (strtolower(CHARSET) == 'utf-8') ? 1 : 0;
$is_unstable = (strlen(DISCUZ_RELEASE) != 8 || DISCUZ_RELEASE == 20180101) ? 1 : 0;

$info = cloudaddons_getversion($instid);

$hrefurl = empty($info['url']) ? 'https://discuzthai.com' : $info['url']; /*jaideejung007*/

if($info['is_latest']) {
$is_latest = 1;
$lang_nolatest = lang('no_latest_tips').lang('next_tips');
} else {
$is_latest = 0;
$lang_nolatest = empty($info['tips']) ? (lang('no_latest_tips').lang('next_tips')) : ($info['tips'].lang('next_tips'));
}

echo <<<EOT
</div>
<div class="main" style="margin-top:-123px;">
Expand All @@ -472,10 +523,31 @@ function show_license() {
<form method="get" autocomplete="off" action="index.php">
<input type="hidden" name="step" value="$next">
<input type="hidden" name="uchidden" value="$uchidden">
<input type="submit" name="submit" value="{$lang_agreement_yes}" style="padding: 2px">&nbsp;
<input type="submit" name="submit" value="{$lang_agreement_yes}" style="padding: 2px" onclick="return checker();">&nbsp;
<input type="button" name="exit" value="{$lang_agreement_no}" style="padding: 2px" onclick="javascript: window.close(); return false;">
</form>
</div>
<script type="text/javascript">
function checker() {
if(!$is_latest && confirm("$lang_nolatest")) {
window.location.href = "$hrefurl";
return false;
}
if($is_php8) {
alert("$lang_php8");
return false;
}
if($is_unstable && confirm("$lang_unstable")) {
window.location.href = "$hrefurl";
return false;
}
if(!$is_utf8 && confirm("$lang_noutf8")) {
window.location.href = "$hrefurl";
return false;
}
return true;
}
</script>
EOT;

show_footer();
Expand Down
14 changes: 10 additions & 4 deletions upload/install/include/install_lang.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
$lang = array(
'SC_GBK' => '简体中文版',
'TC_BIG5' => '繁体中文版',
'SC_UTF8' => '简体中文 UTF8 版',
'SC_UTF8' => 'ภาษาไทย UTF-8', /*jaideejung007*/
'TC_UTF8' => '繁体中文 UTF8 版',
'EN_ISO' => 'ENGLISH ISO8859',
'EN_UTF8' => 'ENGLIST UTF-8','TH_UTF8' => 'ภาษาไทย UTF-8', /*jaideejung007*/
'EN_UTF8' => 'ENGLIST UTF-8',

'title_install' => 'เครื่องมือติดตั้ง '.SOFT_NAME.'',
'agreement_yes' => 'ยอมรับข้อตกลง',
Expand Down Expand Up @@ -83,8 +83,8 @@

'ext_info_succ' => 'การติดตั้งสำเร็จ',
'install_submit' => 'ตกลง',
'install_locked' => 'การติดตั้งถูกระงับ, หากคุณต้องการติดตั้งใหม่ให้ไปที่เซิร์ฟเวอร์แล้วทำการลบ<br /> '.str_replace(ROOT_PATH, '', $lockfile),
'error_quit_msg' => 'คุณต้องแก้ปัญหาข้างต้น, มิฉนั้นการติดตั้งจะไม่สามารถดำเนินการต่อไปได้',
'install_locked' => 'การติดตั้งถูกระงับ หากคุณต้องการติดตั้งใหม่ให้ไปที่เซิร์ฟเวอร์แล้วทำการลบ<br /> '.str_replace(ROOT_PATH, '', $lockfile),
'error_quit_msg' => 'คุณต้องแก้ปัญหาข้างต้นก่อน ไม่เช่นนั้นการติดตั้งจะไม่สามารถดำเนินการต่อไปได้',

'step_app_reg_title' => 'ตั้งค่าระบบ',
'step_app_reg_desc' => 'ทดสอบระบบเซิร์ฟเวอร์, และตั้งค่า UCenter',
Expand Down Expand Up @@ -308,6 +308,12 @@
</div>',

'php8_tips' => 'สวัสดี ดิสคัสที่คุณกำลังติดตั้งไม่รองรับ PHP 8 กรุณาดาวน์เกรดเป็น PHP 7.4 ก่อน จากนั้นค่อยลองใหม่!',
'no_utf8_tips' => 'สวัสดี เวอร์ชันที่คุณใช้เป็นเวอร์ชันเข้ารหัสภาษาท้องถิ่น เช่น GBK / BIG-5 ซึ่งไม่ใช่เวอร์ชันหลักสำหรับแจกจ่ายอีกต่อไป หากคุณวางแผนที่จะสร้างเว็บไซต์ใหม่ ขอแนะนำ [อย่างยิ่ง] ให้ใช้เวอร์ชันล่าสุดอย่างเป็นทางการ นั่นคือ UTF-8',
'no_latest_tips' => 'สวัสดี คุณกำลังติดตั้งเวอร์ชันที่เก่าแล้ว และอาจมีข้อบกพร่องรวมไปถึงความเสี่ยงด้านความปลอดภัย หากเป็นไปได้ ขอแนะนำให้คุณติดตั้งเวอร์ชันภาษาไทยล่าสุดอย่างเป็นทางการจะดีกว่า',
'unstable_tips' => 'สวัสดี คุณกำลังติดตั้งเวอร์ชันที่ไม่เป็นทางการ อาจมีบั๊กหรือปัญหาที่ไม่รู้จักได้ หากคุณวางแผนที่จะสร้างเว็บไซต์หรือซื้อปลั๊กอินใหม่ ขอแนะนำให้คุณติดตั้งเวอร์ชันภาษาไทยล่าสุดอย่างเป็นทางการจะดีกว่า',
'next_tips' => '\r\nคลิก [ตกลง] เพื่อไปหน้าดาวน์โหลดดิสคัสภาษาไทยล่าสุด หรือคลิก [ยกเลิก] เพื่อติดตั้งต่อไป (ไม่แนะนำ)',

'uc_installed' => 'คุณได้ติดตั้ง UCenter ไว้อยู่แล้ว หากคุณจำเป็นต้องติดตั้งใหม่ให้ลบไฟล์ data/install.lock',
'i_agree' => 'ฉันได้อ่านและยอมรับข้อตกลงทั้งหมด',
'supportted' => 'สนับสนุน',
Expand Down
2 changes: 1 addition & 1 deletion upload/install/include/install_var.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

define('SOFT_NAME', 'Discuz!');

define('INSTALL_LANG', 'TH_UTF8'); /*jaideejung007*/
define('INSTALL_LANG', 'SC_UTF8');

define('CONFIG', './config/config_global.php');
define('CONFIG_UC', './config/config_ucenter.php');
Expand Down
10 changes: 8 additions & 2 deletions upload/install/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,13 @@
$default_appurl = $bbserver.substr($PHP_SELF, 0, strrpos($PHP_SELF, '/') - 8);
}

if(isset($_COOKIE['ULTRAXINSTID']) && strpos($_COOKIE['ULTRAXINSTID'], 'ULTRAXINSTID') === 0) {
$instid = $_COOKIE['ULTRAXINSTID'];
} else {
$instid = uniqid('ULTRAXINSTID', true);
setcookie('ULTRAXINSTID', $instid);
}

if($method == 'show_license') {

transfer_ucinfo($_POST);
Expand Down Expand Up @@ -408,7 +415,6 @@

$db->query("REPLACE INTO {$tablepre}common_member (uid, username, password, adminid, groupid, email, regdate, timeoffset) VALUES ('$uid', '$username', '$password', '1', '1', '$email', '".time()."', '9999');");

// UID 是变量, 不做适配会导致积分操作等异常
if($uid) {
$db->query("REPLACE INTO {$tablepre}common_member_count SET uid='$uid';");
$db->query("REPLACE INTO {$tablepre}common_member_status SET uid='$uid';");
Expand Down Expand Up @@ -492,7 +498,7 @@
} else {
show_header();
echo '</div><div class="main" style="margin-top: -123px;padding-left:30px"><span id="platformIntro"></span>';
/*jaideejung007*/ echo '<iframe frameborder="0" width="700" height="550" allowTransparency="true" src="https://log.1080ip.com/outer.php?id=installed&siteurl='.urlencode($default_appurl).'&platform=Discuz&version='.DISCUZ_VERSION.'&release='.DISCUZ_RELEASE.'&threvision='.DISCUZ_TH_REVISION.'"></iframe>';
/*jaideejung007*/ echo '<iframe frameborder="0" width="700" height="550" allowTransparency="true" src="https://logs.discuzthai.com/outer.php?id=installed&siteurl='.urlencode($default_appurl).'&platform=Discuz&version='.DISCUZ_VERSION.'&release='.DISCUZ_RELEASE.'&threvision='.DISCUZ_TH_REVISION.'"></iframe>';
echo '<p align="center"><a href="'.$default_appurl.'" style="padding: 10px 20px;color: #fff;background: #09C;border-radius: 4px;height: 40px;line-height: 40px;font-size: 16px;">'.$lang['install_finish'].'</a></p><br />';
echo '</div>';
show_footer();
Expand Down
12 changes: 8 additions & 4 deletions upload/robots.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,19 @@

User-agent: *
Disallow: /api/
Disallow: /data/
Disallow: /data/addonmd5/
Disallow: /data/download/
Disallow: /data/ipdata/
Disallow: /data/log/
Disallow: /data/plugindata/
Disallow: /data/template/
Disallow: /data/threadcache/
Disallow: /source/
Disallow: /install/
Disallow: /template/
Disallow: /template/default/
Disallow: /config/
Disallow: /uc_client/
Disallow: /uc_server/
Disallow: /static/
Disallow: /admin.php
Disallow: /search.php
Disallow: /member.php
Expand All @@ -21,7 +26,6 @@ Disallow: /connect.php
Disallow: /forum.php?mod=redirect*
Disallow: /forum.php?mod=post*
Disallow: /home.php?mod=spacecp*
Disallow: /userapp.php?mod=app&*
Disallow: /*?mod=misc*
Disallow: /*?mod=attachment*
Disallow: /*mobile=yes*
19 changes: 5 additions & 14 deletions upload/source/admincp/admincp_group.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
}

cpheader();
if($operation != 'setting' && empty($_G['setting']['groupstatus'])) {
cpmsg('group_status_off', 'action=group&operation=setting', 'error');
if(empty($_G['setting']['groupstatus'])) {
cpmsg('group_status_off', 'action=setting&operation=functions', 'error');
}

if($operation == 'setting') {
Expand All @@ -35,11 +35,9 @@
if(!submitcheck('updategroupsetting')) {
shownav('group', 'nav_group_setting');
showsubmenu('nav_group_setting');
/*search={"nav_group_setting":"action=group&operation=setting"}*/
showformheader('group&operation=setting');
showtableheader();
showtitle('groups_setting_basic');
showsetting('groups_setting_basic_status', 'settingnew[groupstatus]', $setting['groupstatus'], 'radio');
showsetting('groups_setting_basic_mod', 'settingnew[groupmod]', $setting['groupmod'], 'radio');
showsetting('groups_setting_basic_iconsize', 'settingnew[group_imgsizelimit]', $setting['group_imgsizelimit'], 'text');
showsetting('groups_setting_basic_recommend', 'settingnew[group_recommend]', $setting['group_recommend'], 'text');
Expand All @@ -55,14 +53,13 @@
showsubmit('updategroupsetting');
showtablefooter();
showformfooter();
/*search*/
} else {

require_once libfile('function/group');
$settings = array();
$settings['group_recommend'] = cacherecommend($_GET['settingnew']['group_recommend']);
require_once libfile('function/discuzcode');
$skey_array = array('groupstatus','group_imgsizelimit','group_allowfeed', 'groupmod');
$skey_array = array('group_imgsizelimit','group_allowfeed', 'groupmod');
foreach($_GET['settingnew'] as $skey => $svalue) {
if(in_array($skey, $skey_array)){
$settings[$skey] = intval($svalue);
Expand Down Expand Up @@ -114,7 +111,7 @@
foreach ($forums[$id] as $forum) {
$showed[] = showgroup($forum);
$lastfid = 0;
if(!empty($subs[$forum['fid']])) {//群组不展示了 废弃代码
if(!empty($subs[$forum['fid']])) {
foreach ($subs[$forum['fid']] as $sub) {
$showed[] = showgroup($sub, 'sub');
$lastfid = $sub['fid'];
Expand Down Expand Up @@ -506,7 +503,7 @@

} else {

$threads = C::t('forum_thread')->count_by_fid($fid);//群组不展示了 废弃代码
$threads = C::t('forum_thread')->count_by_fid($fid);
$formhash = formhash();
cpmsg('grouptype_delete_alarm', "action=group&operation=deletetype&fid=$fid&confirmed=1&formhash=$formhash", 'loadingform', array(), '<div id="percent">0%</div>', FALSE);
echo "
Expand Down Expand Up @@ -643,7 +640,6 @@ function forumsdelete(url, total, pp, currow) {
shownav('group', 'nav_group_userperm');
$varname = array('newgroup_userperm', array(), 'isfloat');
showsubmenu(cplang('nav_group_userperm').' - '.cplang('group_userperm_moderator'));
/*search={"newgroup_userperm":"action=group&operation=userperm"}*/
showformheader("group&operation=userperm&id=$id");
showtableheader();
$varname[1] = array(
Expand Down Expand Up @@ -697,7 +693,6 @@ function forumsdelete(url, total, pp, currow) {
showsubmit('permsubmit', 'submit');
showtablefooter();
showformfooter();
/*search*/
} else {
$default_perm = array('allowstickthread' => 0, 'allowbumpthread' => 0, 'allowhighlightthread' => 0, 'allowlivethread' => 0, 'allowstampthread' => 0, 'allowclosethread' => 0, 'allowmergethread' => 0, 'allowsplitthread' => 0, 'allowrepairthread' => 0, 'allowrefund' => 0, 'alloweditpoll' => 0, 'allowremovereward' => 0, 'alloweditactivity' => 0, 'allowedittrade' => 0, 'allowdigestthread' => 0, 'alloweditpost' => 0, 'allowwarnpost' => 0, 'allowbanpost' => 0, 'allowdelpost' => 0, 'allowupbanner' => 0, 'disablepostctrl' => 0, 'allowviewip' => 0);
$_GET['newgroup_userperm'] = array_merge($default_perm, $_GET['newgroup_userperm']);
Expand Down Expand Up @@ -741,9 +736,7 @@ function forumsdelete(url, total, pp, currow) {
EOT;
shownav('group', 'nav_group_level');
showsubmenu('nav_group_level');
/*search={"nav_group_level":"action=group&operation=level"}*/
showtips('group_level_tips');
/*search*/

showformheader('group&operation=level');
showtableheader('group_level', 'fixpadding', 'id="grouplevel"');
Expand Down Expand Up @@ -1098,7 +1091,6 @@ function searchgroups($submit) {
$dayselect .= "<option value=\"$d\" ".($birthday == $d ? 'selected' : '').">$d</option>\n";
}

/*search={"nav_group_manage":"action=group&operation=manage"}*/
showtagheader('div', 'searchgroups', !$submit);
echo '<script src="static/js/calendar.js" type="text/javascript"></script>';
showformheader("group&operation=manage");
Expand All @@ -1119,7 +1111,6 @@ function searchgroups($submit) {
showtablefooter();
showformfooter();
showtagfooter('div');
/*search*/
}

function countgroups() {
Expand Down
Loading

0 comments on commit 45e5ff1

Please sign in to comment.