Skip to content

Commit

Permalink
update 3.0.6 fix bugs
Browse files Browse the repository at this point in the history
- แก้ไขปัญหาเสียงกระซิบหาย
- แก้ไขปัญหาวัน-เวลาในหน้ารายการแชทส่วนตัวแสดงผลไม่ถูกต้อง
- แก้ไขปัญหาลบข้อความไม่หาย ต้อง Refresh (ในกรณีลบข้อความของตนเอง)
- แก้ไขให้ลบข้อความแล้วข้อความหายทันที แทนทีจะต้องรออัปเดตครั้งถัดไป (ในกรณีลบข้อความของตนเอง)
- แก้ไขตั้งค่าเสียงให้เปิดเสียงเป็นค่าเริ่มต้น
- แก้ไขข้อความในหน้าตั้งค่าปลั๊กอินใน AdminCP ให้สื่อความหมายให้เข้าใจง่ายขึ้น
- แก้ไขเวลาที่โพสต์ข้อความให้ติดข้างล่าง และไม่ตัดไปอีกบรรทัด
- แก้ไขดีไซน์อื่น ๆ เล็ก ๆ น้อย ๆ
- แก้ไขค่าเริ่มต้นของตั้งค่า "จำนวนข้อความที่จะแสดงเริ่มต้น" จาก 30 เป็น 50
- แก้ไขให้สามารถกำหนด "จำนวนข้อความในฐานข้อมูลสูงสุด" (เดิมใช้คำว่า "จำนวน log ที่จะเก็บไว้สูงสุด")
เป็น 0 เพื่อไม่จำกัดจำนวนข้อความในฐานข้อมูลได้ (โดยตั้งค่าเริ่มต้นเป็น 0 ให้หากติดตั้งแชทใหม่)
Developer Note: เนื่องจากแชทใหม่ที่แยกข้อความทั่วไปกับส่วนตัวจึงเห็นว่าไม่ควรลบข้อความเก่า ๆ ออกไป
และการเก็บข้อมูลแชทมาก ๆ แทบไม่มีผลต่อการใช้งานอย่างที่คิดกันในตอนแรก
แนะนำให้คนที่ใช้แชทเดิมแก้ไขให้เป็น 0 หลังจากอัปเกรดเป็นเวอร์ชั่นนี้
  • Loading branch information
popiazaza committed Jan 3, 2021
1 parent 2aec2cf commit 94ed45f
Show file tree
Hide file tree
Showing 15 changed files with 98 additions and 71 deletions.
26 changes: 12 additions & 14 deletions th_chat/discuz_plugin_th_chat.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<item id="datatables"><![CDATA[]]></item>
<item id="directory"><![CDATA[th_chat/]]></item>
<item id="copyright"><![CDATA[newz & popiazaza]]></item>
<item id="version"><![CDATA[3.0.5]]></item>
<item id="version"><![CDATA[3.0.6]]></item>
<item id="__modules">
<item id="0">
<item id="name"><![CDATA[chat]]></item>
Expand Down Expand Up @@ -47,35 +47,33 @@
<item id="description"><![CDATA[]]></item>
<item id="variable"><![CDATA[chat_init]]></item>
<item id="type"><![CDATA[number]]></item>
<item id="value"><![CDATA[30]]></item>
<item id="value"><![CDATA[50]]></item>
<item id="extra"><![CDATA[]]></item>
</item>
<item id="3">
<item id="displayorder"><![CDATA[3]]></item>
<item id="title"><![CDATA[การ clear ข้อมูลเก่า]]></item>
<item id="description"><![CDATA[ถ้ามีไม่มีการ clear ข้อมูล log ของการ chat ทั้งหมดจะถูกเก็บไว้ และอาจจะกระตุกเมื่อ log มีจำนวนมาก (ต้อง reload page ใหม่)
ถ้ามีการ clear ข้อมูล chat จะรักษาจำนวนแถวไว้ตามจำนวนแถวที่แสดงเริ่มต้น
*** ถ้ามีการ clear fade affect จะไม่สามารถใช้ได้]]></item>
<item id="title"><![CDATA[จำกัดจำนวนข้อความที่แสดงผลในหน้าแชท]]></item>
<item id="description"><![CDATA[หากเปิดใช้งานจะลบข้อความเก่าเมื่อมีการแสดงข้อความใหม่
โดยจำกัดจำนวนข้อความที่แสดงผลไว้ตามจำนวนข้อความที่จะแสดงเริ่มต้น]]></item>
<item id="variable"><![CDATA[typechatrow]]></item>
<item id="type"><![CDATA[select]]></item>
<item id="type"><![CDATA[radio]]></item>
<item id="value"><![CDATA[0]]></item>
<item id="extra"><![CDATA[0 = ไม่มีการ clear ข้อมูลเก่า
1 = มีการ clear ข้อมูลเก่า]]></item>
<item id="extra"><![CDATA[]]></item>
</item>
<item id="4">
<item id="displayorder"><![CDATA[4]]></item>
<item id="title"><![CDATA[จำนวน log ที่จะเก็บไว้สูงสุด]]></item>
<item id="title"><![CDATA[จำนวนข้อความในฐานข้อมูลสูงสุด]]></item>
<item id="description"><![CDATA[สามารถใช้คำสั่ง !clear เพื่อล้างข้อความทั้งหมดในห้องแชท
ไม่ควรแก้ไขถ้าคุณเข้าใจมันคืออะไร!]]></item>
ใส่ 0 ถ้าไม่ต้องการให้ลบข้อความเก่าทิ้ง]]></item>
<item id="variable"><![CDATA[chat_log]]></item>
<item id="type"><![CDATA[number]]></item>
<item id="value"><![CDATA[150]]></item>
<item id="value"><![CDATA[0]]></item>
<item id="extra"><![CDATA[]]></item>
</item>
<item id="5">
<item id="displayorder"><![CDATA[5]]></item>
<item id="title"><![CDATA[ที่อยู่ไฟล์เสียง pm]]></item>
<item id="description"><![CDATA[เว้นว่างไว้ถ้าไม่ต้องการ]]></item>
<item id="title"><![CDATA[ที่อยู่ไฟล์เสียงแจ้งเตือน]]></item>
<item id="description"><![CDATA[เว้นว้างไว้หากต้องการปิดการใช้งานเสียงแจ้งเตือน]]></item>
<item id="variable"><![CDATA[pm_sound]]></item>
<item id="type"><![CDATA[text]]></item>
<item id="value"><![CDATA[source/plugin/th_chat/images/msn.mp3]]></item>
Expand Down
2 changes: 1 addition & 1 deletion th_chat/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ function chatrow($id,$text,$uid_p,$username,$time,$touid,$icon,$mod){
<div style="display:flex;align-items:flex-end;">
<div class="nzinnercontent">'.$tag.$text.'</div>
<div class="nzchatimenu">
<span id="nzchatquota'.$id.'" class="nzcq"><a href="javascript:void(0);" onClick="nzQuota('.$id.')">อ้างอิง</a> <a href="javascript:void(0);" onclick="nzAt(\''.addslashes($username).'\')">@</a> <a href="javascript:void(0);" onclick="nzTouid('.$uid_p.')">กระซิบ</a> '.(($config['editmsg']==1)&&$mod?' <a href="javascript:;" onClick=\'nzCommand("edit","'.$id.'");\'>แก้ไข</a>':'').($mod?' <a href="javascript:;" onClick=\'nzCommand("del","'.$id.'");\'>ลบ</a>':'').'</span>
<span id="nzchatquota'.$id.'" class="nzcq"><a href="javascript:void(0);" onClick="nzQuota('.$id.')">อ้างอิง</a> <a href="javascript:void(0);" onclick="nzAt(\''.addslashes($username).'\')">@</a> <a href="javascript:void(0);" onclick="nzTouid('.$uid_p.')">แชทส่วนตัว</a> '.(($config['editmsg']==1)&&$mod?' <a href="javascript:;" onClick=\'nzCommand("edit","'.$id.'");\'>แก้ไข</a>':'').($mod?' <a href="javascript:;" onClick=\'nzCommand("del","'.$id.'");\'>ลบ</a>':'').'</span>
<br>
<span class="nztime" title="'.date("c",$time).'">'.get_date($time).'</span>
</div>
Expand Down
5 changes: 1 addition & 4 deletions th_chat/img.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@
if (!defined('IN_DISCUZ')) {exit('Access Denied');}
loadcache('plugin');
$config = $_G['cache']['plugin']['th_chat'];
$uid = $_G['uid'];
$is_mod = in_array($_G['adminid'], array(1, 2, 3));
if ($uid < 1) {
if ($_G['uid'] < 1) {
die('Login');
}

Expand All @@ -14,7 +12,6 @@
{
unlink(__DIR__ . '/img_up/' . $file->getFilename());
}

}

$files = glob(__DIR__ . '/img_up/' . $_G['uid'] . '_*');
Expand Down
4 changes: 2 additions & 2 deletions th_chat/js/th_chat.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ function nzalert(text) {
nzchatobj.ajaxSetup({
timeout: 2000,
error: function (jqXHR, textStatus, errorThrown) {
nzalert('เกิดข้อผิดพลาด: ไม่สามารถเชื่อมต่อกับเซิฟเวอร์ได้');
nzalert('ขาดเชื่อมต่อกับเซิฟเวอร์ กำลังลองใหม่...');
nzResetInterval();
}
});
Expand Down Expand Up @@ -200,7 +200,7 @@ function nzSend() {
data = JSON.parse(data);
if (data.type == 1) {
nzalert(data.error);
if (data.script == 1) {
if (data.script) {
eval(data.script);
}
} else {
Expand Down
2 changes: 1 addition & 1 deletion th_chat/js/th_chat.min.js

Large diffs are not rendered by default.

41 changes: 27 additions & 14 deletions th_chat/new.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,28 +11,32 @@
DB::update('newz_data', array(
'unread' => 0,
), "`id`>'$id' AND `unread`=1 AND `uid`='$room' AND `touid`='$uid'");
$re = DB::query("SELECT n.*,m.username AS name,mt.username AS toname,g.color,gt.color AS tocolor
$re = DB::query("SELECT n.*,m.username AS name,mt.username AS toname,g.color,gt.color AS tocolor
FROM " . DB::table('newz_data') . " n
LEFT JOIN " . DB::table('common_member') . " m ON n.uid=m.uid
LEFT JOIN " . DB::table('common_member') . " mt ON n.touid=mt.uid
LEFT JOIN " . DB::table('common_usergroup') . " g ON m.groupid=g.groupid
LEFT JOIN " . DB::table('common_usergroup') . " gt ON mt.groupid=gt.groupid
WHERE id>{$id} AND ((n.uid='$room' AND n.touid='$uid') OR (n.uid='$uid' AND n.touid='$room'))
WHERE id>{$id} AND ((n.touid='$uid') OR (n.uid='$uid' AND n.touid!=0) OR (n.uid='$uid' AND n.touid!=0))
ORDER BY id DESC LIMIT {$config['chat_init']}");
} else {
$re = DB::query("SELECT n.*,m.username AS name,mt.username AS toname,g.color,gt.color AS tocolor
$setting_data = DB::fetch_first("SELECT setting FROM ".DB::table('newz_nick')." WHERE uid='{$_G['uid']}'");
}else{
$re = DB::query("SELECT n.*,m.username AS name,mt.username AS toname,g.color,gt.color AS tocolor
FROM " . DB::table('newz_data') . " n
LEFT JOIN " . DB::table('common_member') . " m ON n.uid=m.uid
LEFT JOIN " . DB::table('common_member') . " mt ON n.touid=mt.uid
LEFT JOIN " . DB::table('common_usergroup') . " g ON m.groupid=g.groupid
LEFT JOIN " . DB::table('common_usergroup') . " gt ON mt.groupid=gt.groupid
WHERE id>{$id} AND (n.touid='0' OR n.touid='$uid')
WHERE id>{$id} AND ((n.touid='$uid') OR (n.touid=0))
ORDER BY id DESC LIMIT {$config['chat_init']}");
}
$setting_data = DB::fetch_first("SELECT setting FROM ".DB::table('newz_nick')." WHERE uid='{$_G['uid']}'");
$setting = json_decode($setting_data['setting'],1);
$setting['sound_general'] = $setting['sound_general'] == 0 ? 0 : 1;
$setting['sound_private'] = $setting['sound_private'] == 0 ? 0 : 1;
}
if($setting_data){
$setting = json_decode($setting_data['setting'],1);
}else{
$setting['sound_general'] = 1;
$setting['sound_private'] = 1;
}
$body = array();
while ($c = DB::fetch($re)) {
$c['text'] = preg_replace('/\[quota\](.*?)\[\/quota\]/', '$1', $c['text']);
Expand All @@ -46,20 +50,29 @@
$body[$c['id']] .= '<script>nzchatobj("#nzchatnotice").html("' . addslashes($c['text']) . '");</script>';
continue;
} elseif ($room != $c['uid'] && $c['touid'] == $uid) {
if ($config['pm_sound'] && $sounddata['sound_2']) {
if ($config['pm_sound'] && $setting['sound_private']) {
$body[$c['id']] .= '<audio autoplay><source src="' . $config['pm_sound'] . '" type="audio/mpeg"></audio>';
}
}else{
$body[$c['id']] = '';
}
continue;
}
} elseif ($room && $c['touid'] == 0) {
if($config['pm_sound'] && $setting['sound_general']){
$body[$c['id']] .= '<audio autoplay><source src="' . $config['pm_sound'] . '" type="audio/mpeg"></audio>';
}else{
$body[$c['id']] = '';
}
continue;
}
if ($c['ip'] == 'clear') {
$seedd = $time . '_' . $uid . '_' . rand(1, 999);
$c['text'] = '<span style="color:red" id="del_' . $seedd . '">แจ้งเตือน:</span> <span id="nzchatcontent' . $c['id'] . '">ล้างข้อมูล</span><script type="text/javascript">nzchatobj("#del_' . $seedd . '").parent().parent().parent().' . ($config['chat_type'] == 1 ? 'next' : 'prev') . 'Until().remove();</script>';
} elseif ($c['icon'] == 'alert') {
$c['text'] = '<span id="nzchatcontent' . $c['id'] . '">' . $c['text'] . '</span>';
} elseif ($c['touid'] == 0) {
$c['text'] = (($config['pm_sound'] && $setting['sound_general']) ? '<audio autoplay><source src="' . $config['pm_sound'] . '" type="audio/mpeg"></audio>' : '') . '<span id="nzchatcontent' . $c['id'] . '">' . $c['text'] . '</span>';
$c['text'] = (($config['pm_sound'] && $setting['sound_general']) ? '<audio autoplay><source src="' . $config['pm_sound'] . '" type="audio/mpeg"></audio>' : '') . '<span id="nzchatcontent' . $c['id'] . '">' . $c['text'] . '</span>';
} elseif ($c['touid'] == $uid) {
$c['text'] = (($config['pm_sound'] && $setting['sound_private']) ? '<audio autoplay><source src="' . $config['pm_sound'] . '" type="audio/mpeg"></audio>' : '') . '<span id="nzchatcontent' . $c['id'] . '">' . $c['text'] . '</span>';
$c['text'] = (($config['pm_sound'] && $setting['sound_private']) ? '<audio autoplay><source src="' . $config['pm_sound'] . '" type="audio/mpeg"></audio>' : '') . '<span id="nzchatcontent' . $c['id'] . '">' . $c['text'] . '</span>';
} elseif ($c['uid'] == $uid) {
$c['text'] = '<span id="nzchatcontent' . $c['id'] . '">' . $c['text'] . '</span>';
}
Expand Down
7 changes: 2 additions & 5 deletions th_chat/newinit.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,10 @@
ORDER BY id DESC LIMIT {$config['chat_init']}");
}
$body = array();
$lastid = 0;
$lastid = DB::fetch_first("SELECT max(id) as lastid FROM ".DB::table('newz_data'));
$lastid = $lastid['lastid'];
while ($c = DB::fetch($re)) {
$c['text'] = preg_replace('/\[quota\](.*?)\[\/quota\]/', '$1', $c['text']);
if ($c['id'] > $lastid) {
$lastid = $c['id'];
}

if ($c['ip'] == 'delete') {
continue;
} elseif ($c['ip'] == 'edit') {
Expand Down
8 changes: 4 additions & 4 deletions th_chat/online.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@

if ($_POST['list']) {
$chatgroup = array();
$re = DB::query("SELECT n.*,MAX(n.id) as maxid,SUM(n.unread) as count,m.username AS name,mt.username AS toname,g.color,gt.color AS tocolor
$re = DB::query("SELECT n.*,MAX(n.id) as maxid,MAX(n.time) as maxtime,SUM(n.unread) as count,m.username AS name,mt.username AS toname,g.color,gt.color AS tocolor
FROM " . DB::table('newz_data') . " n
LEFT JOIN " . DB::table('common_member') . " m ON n.uid=m.uid
LEFT JOIN " . DB::table('common_member') . " mt ON n.touid=mt.uid
Expand All @@ -77,7 +77,7 @@
</div>
<div style="display:inline-block;vertical-align: top;margin-left:10px;position:relative;height:32px;line-height: 15px;"><a class="nznametop2 nzat_' . $r['touid'] . '" id="nzolpro_' . $r['touid'] . '" onclick="showWindow(\'th_chat_profile\', \'plugin.php?id=th_chat:profile&uid=' . $r['uid'] . '\');return false;" style="cursor:pointer' . ($r['tocolor'] ? ';color:' . $r['tocolor'] : '') . '">' . $r['toname'] . '</a><br>
<span id="nzchatolr' . $r['touid'] . '">
<span class="nztime" title="' . date("c", $r['time']) . '">' . get_date($r['time']) . '</span>
<span class="nztime" title="' . date("c", $r['maxtime']) . '">' . get_date($r['maxtime']) . '</span>
<script>nzchatobj("#nzchatolr' . $r['touid'] . ' span.nztime").timeago();</script>
</span>
</div>
Expand All @@ -98,7 +98,7 @@
</div>
<div style="display:inline-block;vertical-align: top;margin-left:10px;position:relative;height:32px;line-height: 15px;"><a class="nznametop2 nzat_' . $r['uid'] . '" id="nzolpro_' . $r['uid'] . '" onclick="showWindow(\'th_chat_profile\', \'plugin.php?id=th_chat:profile&uid=' . $r['uid'] . '\');return false;" style="cursor:pointer' . ($r['color'] ? ';color:' . $r['color'] : '') . '">' . $r['name'] . '</a><br>
<span id="nzchatolr' . $r['uid'] . '">
' . ($r['count'] ? '<span class="nzunread">' . $r['count'] . ' ข้อความใหม่</span>' : '<span class="nztime" title="' . date("c", $r['time']) . '">' . get_date($r['time']) . '</span><script>nzchatobj("#nzchatolr' . $r['uid'] . ' span.nztime").timeago();</script>') . '
' . ($r['count'] ? '<span class="nzunread">' . $r['count'] . ' ข้อความใหม่</span>' : '<span class="nztime" title="' . date("c", $r['maxtime']) . '">' . get_date($r['maxtime']) . '</span><script>nzchatobj("#nzchatolr' . $r['uid'] . ' span.nztime").timeago();</script>') . '
</span>
</div>
</div>
Expand Down Expand Up @@ -133,7 +133,7 @@
</div><div style="display:inline-block;vertical-align: top;margin-left:10px;position:relative;height:32px;line-height: 15px;"><a class="nznametop2 nzat_' . $r['uid'] . '" id="nzolpro_' . $r['uid'] . '" onclick="showWindow(\'th_chat_profile\', \'plugin.php?id=th_chat:profile&uid=' . $r['uid'] . '\');return false;" style="cursor:pointer' . ($r['color'] ? ';color:' . $r['color'] : '') . '">' . ($r['ban'] ? '<strike>' . $r['username'] . '</strike>' : $r['username']) . '</a><br>
<span id="nzchatolr' . $r['uid'] . '">' . $r['grouptitle'] . '</span>
<span id="nzchatolc' . $r['uid'] . '" style="display:none;">
' . ($uid == $r['uid'] ? '<a href="javascript:void(0);" onclick="showWindow(\'th_chat_setting\', \'plugin.php?id=th_chat:setting\');return false;">ตั้งค่าห้องแชท</a>' : '<a href="javascript:void(0);" onclick="nzAt(\'' . addslashes($r['username']) . '\')">@</a> <a href="javascript:void(0);" onclick="nzTouid(' . $r['uid'] . ')">กระซิบ</a>') . '
' . ($uid == $r['uid'] ? '<a href="javascript:void(0);" onclick="showWindow(\'th_chat_setting\', \'plugin.php?id=th_chat:setting\');return false;">ตั้งค่าห้องแชท</a>' : '<a href="javascript:void(0);" onclick="nzAt(\'' . addslashes($r['username']) . '\')">@</a> <a href="javascript:void(0);" onclick="nzTouid(' . $r['uid'] . ')">แชทส่วนตัว</a>') . '
</span>
</div>
</div></div>';
Expand Down
4 changes: 3 additions & 1 deletion th_chat/post.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,9 @@
if ($needClear) {
DB::query("DELETE FROM " . DB::table('newz_data') . " WHERE id<" . $last);
} else {
DB::query("DELETE FROM " . DB::table('newz_data') . " WHERE id<" . ($last - $config['chat_log']));
if($config['chat_log']){
DB::query("DELETE FROM " . DB::table('newz_data') . " WHERE id<" . ($last - $config['chat_log']));
}
}
if ($_POST['touid']) {
$room = intval($_POST['room']);
Expand Down
2 changes: 1 addition & 1 deletion th_chat/profile.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
if($uid==$_G['uid']){
$mlist .= '<tr><td colspan="2"><img src="source/plugin/th_chat/images/avatar.png" align="absmiddle" style="padding-right:5px"> <a href="home.php?mod=spacecp&ac=avatar">เปลี่ยนรูป</a></td></tr><tr><td colspan="2"><img src="source/plugin/th_chat/images/settings.png" align="absmiddle" style="padding-right:5px"> <a href="javascript:void(0);" onclick="showWindow(\'th_chat_setting\', \'plugin.php?id=th_chat:setting\');return false;">ตั้งค่าห้องแชท</a></td></tr>';
}else{
$mlist .= '<tr><td colspan="2"><img src="source/plugin/th_chat/images/message.png" align="absmiddle" style="padding-right:5px"> <a href="javascript:void(0);" onClick="nzTouid('.$r['uid'].')">กระซิบ</a></td></tr><tr><td colspan="2"><img src="source/plugin/th_chat/images/addfriend.png" align="absmiddle" style="padding-right:5px"> <a href="home.php?mod=spacecp&amp;ac=friend&amp;op=add&amp;uid='.$r['uid'].'&amp;handlekey=addfriendhk_'.$r['uid'].'" id="a_friend_li_'.$r['uid'].'" onClick="showWindow(this.id, this.href, \'get\', 0);">เพิ่มเพื่อน</a></td></tr><tr><td colspan="2"><img src="source/plugin/th_chat/images/pm.png" align="absmiddle" style="padding-right:5px"> <a href="home.php?mod=spacecp&amp;ac=pm&amp;op=showmsg&amp;handlekey=showmsg_'.$r['uid'].'&amp;touid='.$r['uid'].'&amp;pmid=0&amp;daterange=2" onClick="showWindow(\'showMsgBox\', this.href, \'get\', 0)" id="a_sendpm_'.$r['uid'].'" class="xi2">ส่งข้อความ</a></td></tr>';
$mlist .= '<tr><td colspan="2"><img src="source/plugin/th_chat/images/message.png" align="absmiddle" style="padding-right:5px"> <a href="javascript:void(0);" onClick="nzTouid('.$r['uid'].')">แชทส่วนตัว</a></td></tr><tr><td colspan="2"><img src="source/plugin/th_chat/images/addfriend.png" align="absmiddle" style="padding-right:5px"> <a href="home.php?mod=spacecp&amp;ac=friend&amp;op=add&amp;uid='.$r['uid'].'&amp;handlekey=addfriendhk_'.$r['uid'].'" id="a_friend_li_'.$r['uid'].'" onClick="showWindow(this.id, this.href, \'get\', 0);">เพิ่มเพื่อน</a></td></tr><tr><td colspan="2"><img src="source/plugin/th_chat/images/pm.png" align="absmiddle" style="padding-right:5px"> <a href="home.php?mod=spacecp&amp;ac=pm&amp;op=showmsg&amp;handlekey=showmsg_'.$r['uid'].'&amp;touid='.$r['uid'].'&amp;pmid=0&amp;daterange=2" onClick="showWindow(\'showMsgBox\', this.href, \'get\', 0)" id="a_sendpm_'.$r['uid'].'" class="xi2">ส่งข้อความ</a></td></tr>';
}
$banuntil = '';
if($r['ban']){
Expand Down
9 changes: 6 additions & 3 deletions th_chat/setting.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,12 @@
exit('เปลี่ยนการตั้งค่าสำเร็จ!<script>hideWindow("th_chat_setting", 0, 1);nzalert("เปลี่ยนการตั้งค่าสำเร็จ!");</script>');
}else{
$setting_data = DB::fetch_first("SELECT setting FROM ".DB::table('newz_nick')." WHERE uid='{$_G['uid']}'");
$setting = json_decode($setting_data['setting'],1);
$setting['sound_general'] = $setting['sound_general'] == 0 ? 0 : 1;
$setting['sound_private'] = $setting['sound_private'] == 0 ? 0 : 1;
if($setting_data){
$setting = json_decode($setting_data['setting'],1);
}else{
$setting['sound_general'] = 1;
$setting['sound_private'] = 1;
}
if(!in_array($setting['theme'],array('light','dark'))){
$setting['theme'] = $config['default_theme'];
}
Expand Down
Loading

0 comments on commit 94ed45f

Please sign in to comment.