From cadfa680f84fb41b56d7947bc42cdf0787f5f5f9 Mon Sep 17 00:00:00 2001 From: popiazaza Date: Tue, 18 Aug 2020 04:09:36 +0700 Subject: [PATCH] update 2.19 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - แสดงข้อความแจ้งเตือน เวลาเน็ตหลุด - แสดงแจ้งเตือนเมื่อมี แจ้งเตือน/ข้อความส่วนตัว ใหม่ ตรงรายชื่อออนไลน์ - แก้ไขปัญหาเรื่องการแก้ไขข้อความ ให้แสดงผลอย่างถูกต้อง - แก้ไขปัญหาเรื่องการแบน และทำให้สามารถกำหนดระยะเวลาแบนได้ - แก้ไขปัญหาไม่สามารถใช้บางคำสั่งกับคนที่มีชื่อ ' ได้ - แก้ไข จำนวนข้อความที่จะแสดงเริ่มต้น ให้แสดงผลอย่างถูกต้อง - แก้ไขข้อความ กระซิบถึง: แสดงเวลามีข้อความกระซิบเข้ามาเวลาส่งข้อความพอดี - รองรับ Discuz! X3.5 - เอาระบบให้คะแนนออกไป --- README.md | 8 +- addon/README.md | 1 + addon/block_thchat.php | 26 ++++++ th_chat/discuz_plugin_th_chat.xml | 29 +------ th_chat/functions.php | 29 ++----- th_chat/install.php | 3 +- th_chat/js/th_chat.js | 85 +++++++++---------- th_chat/js/th_chat.min.js | 2 +- th_chat/new.inc.php | 8 +- th_chat/newinit.inc.php | 2 +- th_chat/online.php | 97 ++++++++++++--------- th_chat/post.inc.php | 136 +++++++++++------------------- th_chat/profile.inc.php | 26 ++---- th_chat/template/big.htm | 8 +- th_chat/template/discuz.htm | 8 +- th_chat/template/profile.htm | 2 +- th_chat/template/th_chat.css | 7 ++ th_chat/template/th_chat.min.css | 2 +- th_chat/upgrade.php | 11 ++- 19 files changed, 224 insertions(+), 266 deletions(-) create mode 100644 addon/README.md create mode 100644 addon/block_thchat.php diff --git a/README.md b/README.md index a79392f..c8ab012 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,3 @@ 2TH Chat ======= -Chatbox for Discuz X/X2/X3 - -## Changelog -### 1.12 - - Fixed unable to send certain characters - - Fixed PHP open tag, now no longer require to enable short_open_tag - - Updated meta data and credit \ No newline at end of file +Chatbox for Discuz! X \ No newline at end of file diff --git a/addon/README.md b/addon/README.md new file mode 100644 index 0000000..cb6a402 --- /dev/null +++ b/addon/README.md @@ -0,0 +1 @@ +2TH Chat DIY addon \ No newline at end of file diff --git a/addon/block_thchat.php b/addon/block_thchat.php new file mode 100644 index 0000000..023fa7e --- /dev/null +++ b/addon/block_thchat.php @@ -0,0 +1,26 @@ + $return, 'data' => null); + } +} + +?> \ No newline at end of file diff --git a/th_chat/discuz_plugin_th_chat.xml b/th_chat/discuz_plugin_th_chat.xml index ffdebf2..ae758a4 100644 --- a/th_chat/discuz_plugin_th_chat.xml +++ b/th_chat/discuz_plugin_th_chat.xml @@ -14,7 +14,7 @@ - + @@ -118,24 +118,6 @@ 2 = ทำซ้ำแนวนอน 3 = ทำซ้ำแนวตั้ง 4 = ทำซ้ำแนวนอนและแนวตั้ง]]> - - - - - - - - - @@ -186,15 +168,6 @@ - - - - - - - - - diff --git a/th_chat/functions.php b/th_chat/functions.php index 48bcfa6..e5b9edd 100644 --- a/th_chat/functions.php +++ b/th_chat/functions.php @@ -3,10 +3,9 @@ function getat($attextn){ global $config; if(preg_match_all('/@(.*?)(\s|\z)/',$attextn,$atmatch)) { foreach ($atmatch[1] as $atvalue) { - $atuser = DB::query("SELECT m.uid,m.groupid,g.color FROM ".DB::table('common_member')." m LEFT JOIN ".DB::table('common_usergroup')." g ON m.groupid=g.groupid WHERE m.username='{$atvalue}' LIMIT 1"); - $atuser = DB::fetch($atuser); + $atuser = DB::fetch_first("SELECT m.uid,m.groupid,g.color FROM ".DB::table('common_member')." m LEFT JOIN ".DB::table('common_usergroup')." g ON m.groupid=g.groupid WHERE m.username='{$atvalue}' LIMIT 1"); if($atuser){ - $attext = paddslashes('@'.$atvalue.' '); + $attext = addslashes('@'.stripslashes($atvalue).' '); }else{ $attext = '@'.$atvalue; } @@ -17,16 +16,14 @@ function getat($attextn){ } function getat2($uid){ global $config; - $atuser = DB::query("SELECT m.uid,m.username,m.groupid,g.color FROM ".DB::table('common_member')." m LEFT JOIN ".DB::table('common_usergroup')." g ON m.groupid=g.groupid WHERE m.uid='{$uid}' LIMIT 1"); - $atuser = DB::fetch($atuser); + $atuser = DB::fetch_first("SELECT m.uid,m.username,m.groupid,g.color FROM ".DB::table('common_member')." m LEFT JOIN ".DB::table('common_usergroup')." g ON m.groupid=g.groupid WHERE m.uid='{$uid}' LIMIT 1"); $attext = ''.$atuser['username'].''; return $attext; } function getat3($uid){ global $config; - $atuser = DB::query("SELECT m.uid,m.username,m.groupid,g.color FROM ".DB::table('common_member')." m LEFT JOIN ".DB::table('common_usergroup')." g ON m.groupid=g.groupid WHERE m.uid='{$uid}' LIMIT 1"); - $atuser = DB::fetch($atuser); - $attext = ''.$atuser['username'].''; + $atuser = DB::fetch_first("SELECT m.uid,m.username,m.groupid,g.color FROM ".DB::table('common_member')." m LEFT JOIN ".DB::table('common_usergroup')." g ON m.groupid=g.groupid WHERE m.uid='{$uid}' LIMIT 1"); + $attext = ''.$atuser['username'].''; return $attext; } function getquota($quota){ @@ -36,7 +33,7 @@ function getquota($quota){ $quo = DB::fetch($quo); $quo['text'] = preg_replace('/\[quota\](.*?)\[\/quota\]/', '', $quo['text']); $attext = getat3($quo['uid']); - $text = '[quota]'.paddslashes('
'.$attext.': '.$quo['text'].'
').'[/quota]'; + $text = '[quota]'.addslashes('
'.$attext.': '.$quo['text'].'
').'[/quota]'; } return $text; } @@ -60,7 +57,7 @@ function chatrow($id,$text,$uid_p,$username,$time,$touid,$icon,$mod){ - '.getat2($uid_p).''.get_date($time).' อ้างอิง'.($uid!=$uid_p?' @ กระซิบ ':'').((($config['editmsg']==1)&&$mod)||(($config['editmsg']==2)&&$mod&&($uid==$uid_p))||(($config['editmsg']==3)&&($uid==$uid_p))?' แก้ไข':'').($mod?' ลบ':'').' + '.getat2($uid_p).''.get_date($time).' อ้างอิง'.($uid!=$uid_p?' @ กระซิบ ':'').((($config['editmsg']==1)&&$mod)||(($config['editmsg']==2)&&$mod&&($uid==$uid_p))||(($config['editmsg']==3)&&($uid==$uid_p))?' แก้ไข':'').($mod?' ลบ':'').'
'.$tag.$text.'
@@ -79,15 +76,5 @@ function get_date($timestamp) $strMonthThai=$strMonthCut[$strMonth]; return "$strDay $strMonthThai $strYear $strHour:$strMinute"; } -function paddslashes($data) { - if(is_array($data)) { - foreach($data as $key => $val) { - $data[paddslashes($key)] = paddslashes($val); - } - } else { - $data = str_replace(array('\\','\''),array('\\\\','\\\''),$data); - } - return $data; -} -$time = time(); +$time = TIMESTAMP; ?> \ No newline at end of file diff --git a/th_chat/install.php b/th_chat/install.php index d5f785b..7bca7bf 100644 --- a/th_chat/install.php +++ b/th_chat/install.php @@ -23,10 +23,9 @@ `uid` mediumint(8) unsigned NOT NULL, `total` tinyint(1) unsigned NOT NULL DEFAULT '0', `time` int(10) unsigned NOT NULL DEFAULT '0', - `point_time` int(10) unsigned NOT NULL DEFAULT '0', - `point_total` smallint(3) NOT NULL DEFAULT '0', `sound_1` int(1) NOT NULL DEFAULT '0', `sound_2` int(1) NOT NULL DEFAULT '1', + `ban` INT(10) UNSIGNED NOT NULL DEFAULT '0', PRIMARY KEY (`uid`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4; diff --git a/th_chat/js/th_chat.js b/th_chat/js/th_chat.js index 894f768..5c5fe59 100644 --- a/th_chat/js/th_chat.js +++ b/th_chat/js/th_chat.js @@ -1,4 +1,5 @@ var nzchatobj = jQuery.noConflict(); + var nzsid = getcookie('sid', true); var nztime1 = new Date().getTime(); var nztime2 = 0; @@ -21,11 +22,20 @@ function nzolout() { function nzalert(text) { nzchatobj('#nzalertbox').text(text); - nzchatobj('#nzalertbox').slideDown(); + nzchatobj('#nzalertbox').slideDown(200); setTimeout(function () { - nzchatobj('#nzalertbox').slideUp(); - }, 3000); + nzchatobj('#nzalertbox').slideUp(200); + }, 2000); } + +nzchatobj.ajaxSetup({ + timeout: 2000, + error: function(jqXHR, textStatus, errorThrown) { + nzalert('เกิดข้อผิดพลาด: ไม่สามารถเชื่อมต่อกับเซิฟเวอร์ได้'); + setTimeout(nzLoadText, nzsetting.reload); + } +}); + nzchatobj(function () { nzchatobj("#nzchatmessage").keydown(function (event) { if (event.keyCode == '13') { @@ -199,14 +209,13 @@ function nzSend() { 'quota': nzquota, 'command': nzcommandz }, function (data) { - if (nzquota > 0 || nzcommandz == 'notice' || nzcommandz.substr(0, 4) == 'edit') { nzTouid(0); } data = JSON.parse(data); if (data.type == 1) { nzalert(data.error); - if (data.script_add == 1) { + if (data.script == 1) { eval(data.script); } } else { @@ -248,10 +257,14 @@ function nzCommand(command, xid) { nzcommandz = 'edit ' + xid; nzchatobj(".nzquoteboxi").html('
แก้ไขข้อความ
' + nzchatobj("#nzrows_" + xid + " .nzinnercontent")[0].outerHTML + '
'); nzchatobj(".nzquoteboxi .nzcq").remove(); + nzchatobj(".nzquoteboxi .nzblockquote").remove(); + nzchatobj(".nzquoteboxi .nztag").remove(); + nzchatobj(".nzquoteboxi .nztag2").remove(); + nzchatobj(".nzquoteboxi .nztag3").remove(); nzchatobj(".nzquoteboxo").show(); nzchatobj("#nzchatcontent").css('height',nzchatheight - nzchatobj(".nzquoteboxo").height() - 2); nzScrollChat(true); - nzchatobj("#nzchatmessage").val(nzchatobj("#nzchatcontent" + xid).text()); + nzchatobj("#nzchatmessage").val(nzchatobj(".nzquoteboxi .nzinnercontent").text()); nzchatobj("#nzchatmessage").focus(); return; } else if (command == 'ban') { @@ -260,10 +273,6 @@ function nzCommand(command, xid) { } else if (command == 'unban') { var show = 'ปลดแบน'; var showid = ' ' + nzchatobj("#nzolpro_" + xid).text() + '(UID: ' + xid + ')'; - } else if (command == 'point') { - var show = 'ให้คะแนน'; - var n = xid.split("|"); - var showid = ' ' + n[1] + ' แก่ ' + nzchatobj("#nzolpro_" + n[0]).text() + '(UID: ' + xid + ')'; } else if (command == 'clear') { var show = 'ล้างห้องแชท'; var showid = ''; @@ -323,36 +332,34 @@ function nzLoadText() { nzchatobj.post("plugin.php?id=th_chat:new", { 'lastid': nzlastid }, function (data) { - if (data != 'not') { - data = JSON.parse(data); - var listmess = sortObject(data.chat_row); - nzReadyForScroll(); - nzchatobj.each(listmess, function (k, v) { - k = parseInt(k); - if (k > nzlastid) { - nzlastid = k; - nzchatobj("#afterme").before(v); - nzScrollChat(); - } - }); - nzchatobj('.nzinnercontent img').one('load', function () { + data = JSON.parse(data); + var listmess = sortObject(data.chat_row); + nzReadyForScroll(); + nzchatobj.each(listmess, function (k, v) { + k = parseInt(k); + if (k > nzlastid) { + nzlastid = k; + nzchatobj("#afterme").before(v); nzScrollChat(); - }); - if (nzsetting.iscleardata == 1) { - var nzchatrr = nzchatobj(".nzchatrow"); - if (nzchatrr.size() > nzsetting.chatrowmax) { - nzchatrr.first().remove(); - } } - if (data.chat_online) { - if (!nzonol) { - nzchatobj("#nzchatolcontent").html(data.chat_online); - } - nzchatobj("#nzoltotal").html(data.chat_online_total); + }); + nzchatobj('.nzinnercontent img').one('load', function () { + nzScrollChat(); + }); + if (nzsetting.iscleardata == 1) { + var nzchatrr = nzchatobj(".nzchatrow"); + if (nzchatrr.size() > nzsetting.chatrowmax) { + nzchatrr.first().remove(); } } + if (data.chat_online) { + if (!nzonol) { + nzchatobj("#nzchatolcontent").html(data.chat_online); + } + nzchatobj("#nzoltotal").html(data.chat_online_total); + } + setTimeout(nzLoadText, nzsetting.reload); }); - setTimeout(nzLoadText, nzsetting.reload); } function nzQuota(i) { @@ -450,14 +457,6 @@ function nzCheckImg(i) { } } -function nzPlusone(nz_uid, nz_type) { - var nz_res = prompt('เหตุผล'); - if (nz_res == null) { - nz_res = ""; - } - nzCommand('point', nz_uid + '|' + nz_type + '|' + nz_res); -} - function sortObject(a) { var b = {}, c, d = []; diff --git a/th_chat/js/th_chat.min.js b/th_chat/js/th_chat.min.js index 5c574de..1ac03f2 100644 --- a/th_chat/js/th_chat.min.js +++ b/th_chat/js/th_chat.min.js @@ -1 +1 @@ -var nzchatobj=jQuery.noConflict(),nzsid=getcookie("sid",!0),nztime1=(new Date).getTime(),nztime2=0,nztouid=0,nzquota=0,nzlastid=0,nzonol=!1,nzcommandz="",formhash="",nzChatPopupContent="",nzscroll=!0;function nzolover(){nzonol=!0}function nzolout(){nzonol=!1}function nzalert(t){nzchatobj("#nzalertbox").text(t),nzchatobj("#nzalertbox").slideDown(),setTimeout(function(){nzchatobj("#nzalertbox").slideUp()},3e3)}function nzNotice(){nzcommandz="notice",nzchatobj(".nzquoteboxi").html('
แก้ไขประกาศ: '+nzchatobj("#nzchatnotice").html()+'
'),nzchatobj(".nzquoteboxo").show(),nzchatobj("#nzchatcontent").css("height",nzchatheight-nzchatobj(".nzquoteboxo").height()-2),nzScrollChat(!0),nzchatobj("#nzchatmessage").val(nzchatobj("#nzchatnotice").text()),nzchatobj("#nzchatmessage").focus()}function nzChatPopup(t){nzChatPopupContent=nzchatobj(t).next(".nzchatpopuph").html(),nzchatobj("#th_chat_popup_box").html(nzChatPopupContent),showWindow("th_chat_popup","plugin.php?id=th_chat:popup")}function nzChatBig(){nzchatheight<830&&(nzchatheight+=50,nzchatobj("#nzchatcontent").animate({height:nzchatheight},200),nzchatobj("#nzchatolcontent").animate({height:nzchatheight},200))}function nzChatSmall(){nzchatheight>230&&(nzchatheight-=50,nzchatobj("#nzchatcontent").animate({height:nzchatheight},200),nzchatobj("#nzchatolcontent").animate({height:nzchatheight},200))}function nzChatReset(){nzchatheight=nzchatdefaultheight,nzchatobj("#nzchatcontent").animate({height:nzchatheight},200),nzchatobj("#nzchatolcontent").animate({height:nzchatheight},200)}function nzSend(){var data=nzchatobj.trim(nzchatobj("#nzchatmessage").val());if(""===data)return!1;nztime1=(new Date).getTime(),nztime1>nztime2?(nzchatobj("#nzchatmessage").val(""),nztime2=nztime1+nzsetting.delay,nzchatobj.post("plugin.php?id=th_chat:post"+formhash,{text:data,lastid:nzlastid,touid:nztouid,quota:nzquota,command:nzcommandz},function(data){if((nzquota>0||"notice"==nzcommandz||"edit"==nzcommandz.substr(0,4))&&nzTouid(0),data=JSON.parse(data),1==data.type)nzalert(data.error),1==data.script_add&&eval(data.script);else{var listmess=sortObject(data);if(nzReadyForScroll(),nzchatobj.each(listmess,function(t,n){(t=parseInt(t))>nzlastid&&(nzlastid=t,nzchatobj("#afterme").before(n),nzScrollChat())}),nzchatobj(".nzinnercontent img").one("load",function(){nzScrollChat()}),1==nzsetting.iscleardata){var nzchatrr=nzchatobj(".nzchatrow");nzchatrr.size()>nzsetting.chatrowmax&&nzchatrr.first().remove()}}})):nzalert("ส่งข้อความบ่อยไป")}function nzCommand(t,n){if(""==t)nzalert("คำสั่งผิดพลาด");else{if("del"==t)var o="ลบข้อความ",a=" "+nzchatobj("#nzchatcontent"+n).text();else{if("edit"==t)return nzTouid(0),nzcommandz="edit "+n,nzchatobj(".nzquoteboxi").html('
แก้ไขข้อความ
'+nzchatobj("#nzrows_"+n+" .nzinnercontent")[0].outerHTML+'
'),nzchatobj(".nzquoteboxi .nzcq").remove(),nzchatobj(".nzquoteboxo").show(),nzchatobj("#nzchatcontent").css("height",nzchatheight-nzchatobj(".nzquoteboxo").height()-2),nzScrollChat(!0),nzchatobj("#nzchatmessage").val(nzchatobj("#nzchatcontent"+n).text()),void nzchatobj("#nzchatmessage").focus();if("ban"==t)o="แบน",a=" "+nzchatobj("#nzolpro_"+n).text()+"(UID: "+n+")";else if("unban"==t)o="ปลดแบน",a=" "+nzchatobj("#nzolpro_"+n).text()+"(UID: "+n+")";else if("point"==t){o="ให้คะแนน";var e=n.split("|");a=" "+e[1]+" แก่ "+nzchatobj("#nzolpro_"+e[0]).text()+"(UID: "+n+")"}else if("clear"==t)o="ล้างห้องแชท",a=""}1==confirm("คุณต้องการที่จะ"+o+a+" ?")&&(nzchatobj("#nzchatmessage").val("!"+t+" "+n),nzSend())}}function nzLoadTextInit(){nzchatobj.post("plugin.php?id=th_chat:newinit",function(t){t=JSON.parse(t),nzlastid=t.lastid,nzchatobj("#nzchatcontent").html(''+t.datahtml+'
'),nzScrollChat(!0),nzchatobj(".nzinnercontent img").one("load",function(){nzScrollChat()}),nzonol||nzchatobj("#nzchatolcontent").html(t.datachatonline),nzchatobj("#nzoltotal").html(t.chat_online_total),nzchatobj("#nzchatnotice").html(t.welcometext),setTimeout(nzLoadText,nzsetting.reload)})}function nzScrollChat(t=!1){var n=document.getElementById("nzchatcontent");t&&(nzscroll=!0,nzchatobj("#nznewmessage").hide()),nzscroll?n.scrollTop=n.scrollHeight:nzchatobj("#nznewmessage").show()}function nzReadyForScroll(){var t=document.getElementById("nzchatcontent");nzscroll=!!nzchatobj(".nzquoteboxo:visible")||t.scrollHeight-t.scrollTop==nzchatheight}function nzLoadText(){nzchatobj.post("plugin.php?id=th_chat:new",{lastid:nzlastid},function(t){if("not"!=t){var n=sortObject((t=JSON.parse(t)).chat_row);if(nzReadyForScroll(),nzchatobj.each(n,function(t,n){(t=parseInt(t))>nzlastid&&(nzlastid=t,nzchatobj("#afterme").before(n),nzScrollChat())}),nzchatobj(".nzinnercontent img").one("load",function(){nzScrollChat()}),1==nzsetting.iscleardata){var o=nzchatobj(".nzchatrow");o.size()>nzsetting.chatrowmax&&o.first().remove()}t.chat_online&&(nzonol||nzchatobj("#nzchatolcontent").html(t.chat_online),nzchatobj("#nzoltotal").html(t.chat_online_total))}}),setTimeout(nzLoadText,nzsetting.reload)}function nzQuota(t){nzTouid(0),nzchatobj(".nzquoteboxi").html('
'+nzchatobj("#nzrows_"+t+" .nzuserat2")[0].outerHTML+": "+nzchatobj("#nzchatcontent"+t).html()+'
'),nzchatobj(".nzquoteboxi .nzcq").remove(),nzchatobj(".nzquoteboxi .nzuserat2").toggleClass("nzuserat2 nzuserat"),nzchatobj(".nzquoteboxo").show(),nzchatobj("#nzchatcontent").css("height",nzchatheight-nzchatobj(".nzquoteboxo").height()-2),nzScrollChat(!0),nzquota=t,nzchatobj("#nzchatmessage").focus()}function nzAt(t){seditor_insertunit("nzchat","@"+t+" ",""),nzchatobj("#nzchatmessage").focus()}function nzTouid(t){t>0?(nzTouid(0),nzchatobj(".nzquoteboxi").html('
กระซิบถึง '+nzchatobj(".nzat_"+t).last()[0].outerHTML+'
'),nzchatobj(".nzquoteboxi .nzcq").remove(),nzchatobj(".nzquoteboxi .nzinnercontent").remove(),nzchatobj(".nzquoteboxo").show(),nzchatobj("#nzchatcontent").css("height",nzchatheight-nzchatobj(".nzquoteboxo").height()-2),nzScrollChat(!0),nztouid=t):(nzchatobj("#nzchatcontent").css("height",nzchatheight),"edit"==nzcommandz.substr(0,4)?nzchatobj(".nzquoteboxi .nzinnercontent").text()==nzchatobj("#nzchatmessage").val()&&nzchatobj("#nzchatmessage").val(""):"notice"==nzcommandz&&nzchatobj("#nzchatmessage").val()==nzchatobj("#nzchatnotice").text()&&nzchatobj("#nzchatmessage").val(""),nzchatobj(".nzquoteboxi").html(""),nzchatobj("#nztouid").html(""),nzchatobj(".nzquoteboxo").hide(),nztouid=0,nzquota=0,nzcommandz="")}function nzReload(){nzchatobj("#nzchatolcontent").html(""),nzchatobj("#nzchatnotice").html("กำลังโหลดประกาศล่าสุด..."),nzchatobj("#nzchatcontent").html('





Load
'),nzchatobj.post("plugin.php?id=th_chat:newinit",function(t){t=JSON.parse(t),nzlastid=t.lastid,nzchatobj("#nzchatcontent").html(''+t.datahtml+'
'),nzScrollChat(!0),nzchatobj(".nzinnercontent img").one("load",function(){nzScrollChat()}),nzchatobj("#nzchatolcontent").html(t.datachatonline),nzchatobj("#nzchatnotice").html(t.welcometext)})}function nzClean(){nzchatobj(".nzchatrow").fadeOut("slow")}function nzCheckImg(t){var n=parseInt(t.width),o=parseInt(t.height);n>500&&(t.style.cursor="pointer",t.onclick=function(){window.open(this.src,"ImageViewer","resizable=1").focus()},o*=500/n,n=500,t.height=o,t.width=n),o>240&&(t.style.cursor="pointer",t.onclick=function(){window.open(this.src,"ImageViewer","resizable=1").focus()},t.width=240/o*n,t.height=240)}function nzPlusone(t,n){var o=prompt("เหตุผล");null==o&&(o=""),nzCommand("point",t+"|"+n+"|"+o)}function sortObject(t){var n,o={},a=[];for(n in t)t.hasOwnProperty(n)&&a.push(n);for(a.sort(),n=0;n{nzchatobj("#nzchatmessage").val(nzchatobj("#nzchatmessage").val()+t)}),nzchatobj("#nzemoji").click(function(){t.togglePicker(this)}),nzchatobj("#nznewmessage").click(function(){nzScrollChat(!0)}),nzchatobj("#nzchatmessage").keydown(function(t){"13"==t.keyCode&&nzSend()}),nzchatobj("#nzchatcontent").scroll(function(){var t=document.getElementById("nzchatcontent");t.scrollHeight-t.scrollTop==nzchatheight&&(nzchatobj("#nznewmessage").hide(),t.scrollTop=t.scrollHeight)})}); \ No newline at end of file +var nzchatobj=jQuery.noConflict(),nzsid=getcookie("sid",!0),nztime1=(new Date).getTime(),nztime2=0,nztouid=0,nzquota=0,nzlastid=0,nzonol=!1,nzcommandz="",formhash="",nzChatPopupContent="",nzscroll=!0;function nzolover(){nzonol=!0}function nzolout(){nzonol=!1}function nzalert(t){nzchatobj("#nzalertbox").text(t),nzchatobj("#nzalertbox").slideDown(200),setTimeout(function(){nzchatobj("#nzalertbox").slideUp(200)},2e3)}function nzNotice(){nzcommandz="notice",nzchatobj(".nzquoteboxi").html('
แก้ไขประกาศ: '+nzchatobj("#nzchatnotice").html()+'
'),nzchatobj(".nzquoteboxo").show(),nzchatobj("#nzchatcontent").css("height",nzchatheight-nzchatobj(".nzquoteboxo").height()-2),nzScrollChat(!0),nzchatobj("#nzchatmessage").val(nzchatobj("#nzchatnotice").text()),nzchatobj("#nzchatmessage").focus()}function nzChatPopup(t){nzChatPopupContent=nzchatobj(t).next(".nzchatpopuph").html(),nzchatobj("#th_chat_popup_box").html(nzChatPopupContent),showWindow("th_chat_popup","plugin.php?id=th_chat:popup")}function nzChatBig(){nzchatheight<830&&(nzchatheight+=50,nzchatobj("#nzchatcontent").animate({height:nzchatheight},200),nzchatobj("#nzchatolcontent").animate({height:nzchatheight},200))}function nzChatSmall(){nzchatheight>230&&(nzchatheight-=50,nzchatobj("#nzchatcontent").animate({height:nzchatheight},200),nzchatobj("#nzchatolcontent").animate({height:nzchatheight},200))}function nzChatReset(){nzchatheight=nzchatdefaultheight,nzchatobj("#nzchatcontent").animate({height:nzchatheight},200),nzchatobj("#nzchatolcontent").animate({height:nzchatheight},200)}function nzSend(){var data=nzchatobj.trim(nzchatobj("#nzchatmessage").val());if(""===data)return!1;nztime1=(new Date).getTime(),nztime1>nztime2?(nzchatobj("#nzchatmessage").val(""),nztime2=nztime1+nzsetting.delay,nzchatobj.post("plugin.php?id=th_chat:post"+formhash,{text:data,lastid:nzlastid,touid:nztouid,quota:nzquota,command:nzcommandz},function(data){if((nzquota>0||"notice"==nzcommandz||"edit"==nzcommandz.substr(0,4))&&nzTouid(0),data=JSON.parse(data),1==data.type)nzalert(data.error),1==data.script&&eval(data.script);else{var listmess=sortObject(data);if(nzReadyForScroll(),nzchatobj.each(listmess,function(t,n){(t=parseInt(t))>nzlastid&&(nzlastid=t,nzchatobj("#afterme").before(n),nzScrollChat())}),nzchatobj(".nzinnercontent img").one("load",function(){nzScrollChat()}),1==nzsetting.iscleardata){var nzchatrr=nzchatobj(".nzchatrow");nzchatrr.size()>nzsetting.chatrowmax&&nzchatrr.first().remove()}}})):nzalert("ส่งข้อความบ่อยไป")}function nzCommand(t,n){if(""==t)nzalert("คำสั่งผิดพลาด");else{if("del"==t)var o="ลบข้อความ",a=" "+nzchatobj("#nzchatcontent"+n).text();else{if("edit"==t)return nzTouid(0),nzcommandz="edit "+n,nzchatobj(".nzquoteboxi").html('
แก้ไขข้อความ
'+nzchatobj("#nzrows_"+n+" .nzinnercontent")[0].outerHTML+'
'),nzchatobj(".nzquoteboxi .nzcq").remove(),nzchatobj(".nzquoteboxi .nzblockquote").remove(),nzchatobj(".nzquoteboxi .nztag").remove(),nzchatobj(".nzquoteboxi .nztag2").remove(),nzchatobj(".nzquoteboxi .nztag3").remove(),nzchatobj(".nzquoteboxo").show(),nzchatobj("#nzchatcontent").css("height",nzchatheight-nzchatobj(".nzquoteboxo").height()-2),nzScrollChat(!0),nzchatobj("#nzchatmessage").val(nzchatobj(".nzquoteboxi .nzinnercontent").text()),void nzchatobj("#nzchatmessage").focus();if("ban"==t)o="แบน",a=" "+nzchatobj("#nzolpro_"+n).text()+"(UID: "+n+")";else if("unban"==t)o="ปลดแบน",a=" "+nzchatobj("#nzolpro_"+n).text()+"(UID: "+n+")";else if("clear"==t)o="ล้างห้องแชท",a=""}1==confirm("คุณต้องการที่จะ"+o+a+" ?")&&(nzchatobj("#nzchatmessage").val("!"+t+" "+n),nzSend())}}function nzLoadTextInit(){nzchatobj.post("plugin.php?id=th_chat:newinit",function(t){t=JSON.parse(t),nzlastid=t.lastid,nzchatobj("#nzchatcontent").html(''+t.datahtml+'
'),nzScrollChat(!0),nzchatobj(".nzinnercontent img").one("load",function(){nzScrollChat()}),nzonol||nzchatobj("#nzchatolcontent").html(t.datachatonline),nzchatobj("#nzoltotal").html(t.chat_online_total),nzchatobj("#nzchatnotice").html(t.welcometext),setTimeout(nzLoadText,nzsetting.reload)})}function nzScrollChat(t=!1){var n=document.getElementById("nzchatcontent");t&&(nzscroll=!0,nzchatobj("#nznewmessage").hide()),nzscroll?n.scrollTop=n.scrollHeight:nzchatobj("#nznewmessage").show()}function nzReadyForScroll(){var t=document.getElementById("nzchatcontent");nzscroll=!!nzchatobj(".nzquoteboxo:visible")||t.scrollHeight-t.scrollTop==nzchatheight}function nzLoadText(){nzchatobj.post("plugin.php?id=th_chat:new",{lastid:nzlastid},function(t){var n=sortObject((t=JSON.parse(t)).chat_row);if(nzReadyForScroll(),nzchatobj.each(n,function(t,n){(t=parseInt(t))>nzlastid&&(nzlastid=t,nzchatobj("#afterme").before(n),nzScrollChat())}),nzchatobj(".nzinnercontent img").one("load",function(){nzScrollChat()}),1==nzsetting.iscleardata){var o=nzchatobj(".nzchatrow");o.size()>nzsetting.chatrowmax&&o.first().remove()}t.chat_online&&(nzonol||nzchatobj("#nzchatolcontent").html(t.chat_online),nzchatobj("#nzoltotal").html(t.chat_online_total)),setTimeout(nzLoadText,nzsetting.reload)})}function nzQuota(t){nzTouid(0),nzchatobj(".nzquoteboxi").html('
'+nzchatobj("#nzrows_"+t+" .nzuserat2")[0].outerHTML+": "+nzchatobj("#nzchatcontent"+t).html()+'
'),nzchatobj(".nzquoteboxi .nzcq").remove(),nzchatobj(".nzquoteboxi .nzuserat2").toggleClass("nzuserat2 nzuserat"),nzchatobj(".nzquoteboxo").show(),nzchatobj("#nzchatcontent").css("height",nzchatheight-nzchatobj(".nzquoteboxo").height()-2),nzScrollChat(!0),nzquota=t,nzchatobj("#nzchatmessage").focus()}function nzAt(t){seditor_insertunit("nzchat","@"+t+" ",""),nzchatobj("#nzchatmessage").focus()}function nzTouid(t){t>0?(nzTouid(0),nzchatobj(".nzquoteboxi").html('
กระซิบถึง '+nzchatobj(".nzat_"+t).last()[0].outerHTML+'
'),nzchatobj(".nzquoteboxi .nzcq").remove(),nzchatobj(".nzquoteboxi .nzinnercontent").remove(),nzchatobj(".nzquoteboxo").show(),nzchatobj("#nzchatcontent").css("height",nzchatheight-nzchatobj(".nzquoteboxo").height()-2),nzScrollChat(!0),nztouid=t):(nzchatobj("#nzchatcontent").css("height",nzchatheight),"edit"==nzcommandz.substr(0,4)?nzchatobj(".nzquoteboxi .nzinnercontent").text()==nzchatobj("#nzchatmessage").val()&&nzchatobj("#nzchatmessage").val(""):"notice"==nzcommandz&&nzchatobj("#nzchatmessage").val()==nzchatobj("#nzchatnotice").text()&&nzchatobj("#nzchatmessage").val(""),nzchatobj(".nzquoteboxi").html(""),nzchatobj("#nztouid").html(""),nzchatobj(".nzquoteboxo").hide(),nztouid=0,nzquota=0,nzcommandz="")}function nzReload(){nzchatobj("#nzchatolcontent").html(""),nzchatobj("#nzchatnotice").html("กำลังโหลดประกาศล่าสุด..."),nzchatobj("#nzchatcontent").html('





Load
'),nzchatobj.post("plugin.php?id=th_chat:newinit",function(t){t=JSON.parse(t),nzlastid=t.lastid,nzchatobj("#nzchatcontent").html(''+t.datahtml+'
'),nzScrollChat(!0),nzchatobj(".nzinnercontent img").one("load",function(){nzScrollChat()}),nzchatobj("#nzchatolcontent").html(t.datachatonline),nzchatobj("#nzchatnotice").html(t.welcometext)})}function nzClean(){nzchatobj(".nzchatrow").fadeOut("slow")}function nzCheckImg(t){var n=parseInt(t.width),o=parseInt(t.height);n>500&&(t.style.cursor="pointer",t.onclick=function(){window.open(this.src,"ImageViewer","resizable=1").focus()},o*=500/n,n=500,t.height=o,t.width=n),o>240&&(t.style.cursor="pointer",t.onclick=function(){window.open(this.src,"ImageViewer","resizable=1").focus()},t.width=240/o*n,t.height=240)}function sortObject(t){var n,o={},a=[];for(n in t)t.hasOwnProperty(n)&&a.push(n);for(a.sort(),n=0;n{nzchatobj("#nzchatmessage").val(nzchatobj("#nzchatmessage").val()+t)}),nzchatobj("#nzemoji").click(function(){t.togglePicker(this)}),nzchatobj("#nznewmessage").click(function(){nzScrollChat(!0)}),nzchatobj("#nzchatmessage").keydown(function(t){"13"==t.keyCode&&nzSend()}),nzchatobj("#nzchatcontent").scroll(function(){var t=document.getElementById("nzchatcontent");t.scrollHeight-t.scrollTop==nzchatheight&&(nzchatobj("#nznewmessage").hide(),t.scrollTop=t.scrollHeight)})}); \ No newline at end of file diff --git a/th_chat/new.inc.php b/th_chat/new.inc.php index b3e5f1d..54e2252 100644 --- a/th_chat/new.inc.php +++ b/th_chat/new.inc.php @@ -24,10 +24,10 @@ $body[$c['id']] .= ''; continue; }elseif($c['ip'] == 'edit'){ - $body[$c['id']] .= ''; + $body[$c['id']] .= ''; continue; }elseif($c['ip'] == 'notice'){ - $body[$c['id']] .= ''; + $body[$c['id']] .= ''; continue; } if($c['ip']=='clear'){ @@ -48,8 +48,8 @@ } } session_start(); -if(time()-$_SESSION['th_chat_online']>15){ - $_SESSION['th_chat_online'] = time(); +if(TIMESTAMP-$_SESSION['th_chat_online']>15){ + $_SESSION['th_chat_online'] = TIMESTAMP; include 'online.php'; } echo json_encode(array('chat_row'=>$body,'chat_online'=>$body_online,'chat_online_total'=>$oltotal)); diff --git a/th_chat/newinit.inc.php b/th_chat/newinit.inc.php index 8a4e98c..bf2cdae 100644 --- a/th_chat/newinit.inc.php +++ b/th_chat/newinit.inc.php @@ -11,7 +11,7 @@ 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 (n.touid='0' OR n.touid='$uid' OR n.uid='$uid') AND n.ip != 'delete' +WHERE (n.touid='0' OR n.touid='$uid' OR n.uid='$uid') AND n.ip NOT IN ('delete','edit','notice') ORDER BY id DESC LIMIT {$config['chat_init']}"); $body=array(); $lastid=0; diff --git a/th_chat/online.php b/th_chat/online.php index 5c99735..82d44fd 100644 --- a/th_chat/online.php +++ b/th_chat/online.php @@ -1,22 +1,38 @@ $_G['session']['sid'], - 'ip1' => $ip1, - 'ip2' => $ip2, - 'ip3' => $ip3, - 'ip4' => $ip4, - 'uid' => $_G['member']['uid'], - 'username' => paddslashes($_G['member']['username']), - 'groupid' => $_G['member']['groupid'], - 'invisible' => $_G['member']['invisible'], - 'action' => APPTYPEID, - 'lastactivity' => $time, - 'lastolupdate' => 0, - 'fid' => 0, - 'tid' => 0, -); +$time = TIMESTAMP; +if ($_G['setting']['version'] > "X3.4") { + $dataarr = array( + 'sid' => $_G['session']['sid'], + 'ip' => $_G['clientip'], + 'uid' => $_G['member']['uid'], + 'username' => addslashes($_G['member']['username']), + 'groupid' => $_G['member']['groupid'], + 'invisible' => $_G['member']['invisible'], + 'action' => APPTYPEID, + 'lastactivity' => $time, + 'lastolupdate' => 0, + 'fid' => 0, + 'tid' => 0, + ); +} else { + list($ip1, $ip2, $ip3, $ip4) = explode('.', $_G['clientip']); + $dataarr = array( + 'sid' => $_G['session']['sid'], + 'ip1' => $ip1, + 'ip2' => $ip2, + 'ip3' => $ip3, + 'ip4' => $ip4, + 'uid' => $_G['member']['uid'], + 'username' => addslashes($_G['member']['username']), + 'groupid' => $_G['member']['groupid'], + 'invisible' => $_G['member']['invisible'], + 'action' => APPTYPEID, + 'lastactivity' => $time, + 'lastolupdate' => 0, + 'fid' => 0, + 'tid' => 0, + ); +} if ($_G['uid']) { if (DB::fetch_first('SELECT uid FROM ' . DB::table('common_session') . ' WHERE uid=\'' . $_G['uid'] . '\'')) { DB::update('common_session', $dataarr, "`uid`='" . $_G['uid'] . "'"); @@ -25,6 +41,8 @@ } } +DB::update('newz_nick', array('ban' => 0), "`ban`<'" . TIMESTAMP . "'"); + $timeout = 30; $gid = $_G['groupid']; @@ -32,26 +50,13 @@ $class = 'nzolnor'; $oltotal = 0; -$banned = DB::fetch_first("SELECT value FROM " . DB::table('common_pluginvar') . " WHERE variable='chat_ban' AND displayorder='16' LIMIT 1"); -$banned = explode(",", $banned['value']); -if ($config['chat_point']) { - $re = DB::query("SELECT s.uid,s.username,s.groupid,s.lastactivity,g.grouptitle,g.color,n.point_total" . ($config['chat_point'] != '9' ? ",p.extcredits{$config['chat_point']} AS point" : "") . " FROM " . DB::table('common_session') . " s LEFT JOIN " . DB::table('common_usergroup') . " g ON s.groupid=g.groupid LEFT JOIN " . DB::table('newz_nick') . " n ON s.uid=n.uid LEFT JOIN " . DB::table('common_member_count') . " p ON s.uid=p.uid WHERE s.uid>0 AND invisible=0 AND action IN (2,127) AND fid=0 AND tid=0"); - if (!empty($config['onlinebot'])) { - $re2 = DB::query("SELECT s.uid,s.username,s.groupid,g.grouptitle,g.color,n.point_total" . ($config['chat_point'] != '9' ? ",p.extcredits{$config['chat_point']} AS point" : "") . " FROM " . DB::table('common_member') . " s LEFT JOIN " . DB::table('common_usergroup') . " g ON s.groupid=g.groupid LEFT JOIN " . DB::table('newz_nick') . " n ON s.uid=n.uid LEFT JOIN " . DB::table('common_member_count') . " p ON s.uid=p.uid WHERE s.uid IN (" . $config['onlinebot'] . ")"); - } -} else { - $re = DB::query("SELECT s.uid,s.username,s.groupid,s.lastactivity,g.grouptitle,g.color,n.point_total FROM " . DB::table('common_session') . " s LEFT JOIN " . DB::table('common_usergroup') . " g ON s.groupid=g.groupid LEFT JOIN " . DB::table('newz_nick') . " n ON s.uid=n.uid WHERE s.uid>0 AND invisible=0 AND action IN (2,127) AND fid=0 AND tid=0"); - if (!empty($config['onlinebot'])) { - $re2 = DB::query("SELECT s.uid,s.username,s.groupid,g.grouptitle,g.color,n.point_total FROM " . DB::table('common_member') . " s LEFT JOIN " . DB::table('common_usergroup') . " g ON s.groupid=g.groupid LEFT JOIN " . DB::table('newz_nick') . " n ON s.uid=n.uid WHERE s.uid IN (" . $config['onlinebot'] . ")"); - } +$re = DB::query("SELECT s.uid,s.username,s.groupid,s.lastactivity,g.grouptitle,g.color,n.ban FROM " . DB::table('common_session') . " s LEFT JOIN " . DB::table('common_usergroup') . " g ON s.groupid=g.groupid LEFT JOIN " . DB::table('newz_nick') . " n ON s.uid=n.uid WHERE s.uid>0 AND invisible=0 AND action IN (2,127) AND fid=0 AND tid=0"); +if (!empty($config['onlinebot'])) { + $re2 = DB::query("SELECT s.uid,s.username,s.groupid,g.grouptitle,g.color,n.ban FROM " . DB::table('common_member') . " s LEFT JOIN " . DB::table('common_usergroup') . " g ON s.groupid=g.groupid LEFT JOIN " . DB::table('newz_nick') . " n ON s.uid=n.uid WHERE s.uid IN (" . $config['onlinebot'] . ")"); } + while ($r = DB::fetch($re) or $r = DB::fetch($re2)) { - $r['name'] = $r['username']; - $r['name'] = stripslashes($r['name']); - if (in_array($r['uid'], $banned)) { - $r['name'] = '' . $r['name'] . ''; - } if ($r['groupid'] > 9) {$r['groupid'] = 100 - $r['groupid'];} else if (in_array($r['groupid'], array(4, 5, 6, 9))) {$r['groupid'] = 100;} else if ($r['groupid'] == 7) {$r['groupid'] = 99;} else if ($r['groupid'] == 8) {$r['groupid'] = 98;} $botid = explode(",", $config['onlinebot']); if (in_array($r['uid'], $botid)) {if (empty($r['lastactivity'])) {$r['lastactivity'] = $time;} else {continue;}} @@ -59,13 +64,13 @@ if ($time - $r['lastactivity'] > $timeout) { $oltotal = $oltotal - 1; } else { - $body_onlinein[$r['groupid']] .= '
-
+ $body_onlinein[$r['groupid']] .= ''; @@ -73,6 +78,16 @@ $oltotal++; } ksort($body_onlinein); +if ($_G['member']['newprompt']) { + $body_onlinez .= ''; +} +if ($_G['member']['newpm']) { + $body_onlinez .= ''; +} foreach ($body_onlinein as $show) { $body_onlinez .= $show; } diff --git a/th_chat/post.inc.php b/th_chat/post.inc.php index 8703fd2..d758f59 100644 --- a/th_chat/post.inc.php +++ b/th_chat/post.inc.php @@ -9,9 +9,8 @@ if($uid<1){ die(json_encode(array('type'=>1,'error'=>'กรุณาเข้าสู่ระบบ'))); } -$banned = DB::fetch_first("SELECT value FROM ".DB::table('common_pluginvar')." WHERE variable='chat_ban' AND displayorder='16' LIMIT 1"); -$banned = explode(",",$banned['value']); -if((in_array($gid,array(4,5))||in_array($uid,$banned))&&!$is_mod){ +$newz_nick = DB::fetch_first("SELECT * FROM ".DB::table('newz_nick')." WHERE uid='{$uid}'"); +if($newz_nick['ban']){ die(json_encode(array('type'=>1,'error'=>'ขออภัย คุณถูกแบนอยู่'))); } if (get_magic_quotes_gpc()) { @@ -30,76 +29,39 @@ $id = intval(substr($text,4)); DB::query("DELETE FROM ".DB::table('newz_data')." WHERE id=$id LIMIT 1"); DB::query("INSERT INTO ".DB::table('newz_data')." (uid,touid,text,time,ip) VALUES ('$uid','0','$id','$time','delete')"); - die(json_encode(array('type'=>1,'error'=>'ลบสำเร็จแล้ว!'))); + die(json_encode(array('type'=>1,'error'=>'ลบสำเร็จแล้ว!','script'=>'nzchatobj("#nzrows_'.$id.'").fadeOut(200);'))); }elseif(substr($text,0,4)=="!ban"&&$is_mod){ - $uid_ban = intval(substr($text,4)); - if($uid_ban && !in_array($uid_ban,$banned) && $uid_ban != $uid){ - $banned[] = $uid_ban; - $username_ban = DB::fetch_first("SELECT username FROM ".DB::table('common_member')." WHERE uid='{$uid_ban}' LIMIT 1"); - $username_ban = '@'.addslashes($username_ban['username']); - $icon = 'alert'; - $touid = 0; - $text = $username_ban.' [color=red]ถูกแบน[/color]'; - $bannedq = implode(',',$banned); - DB::query("UPDATE ".DB::table('common_pluginvar')." SET value='{$bannedq}' WHERE variable='chat_ban' AND displayorder='16' LIMIT 1"); + $ban = explode(" ",$text); + $uid_ban = intval($ban[1]); + $time = intval($ban[2]); + if(!$time){ + $time = 4294967295; + }else{ + $time = TIMESTAMP + $time; } - }elseif(substr($text,0,6)=="!unban"&&$is_mod){ - $uid_ban = intval(substr($text,6)); - if($uid_ban && in_array($uid_ban,$banned)){ - $key = array_search($uid_ban, $banned); - if($key !== FALSE) unset($banned[$key]); - $username_ban = DB::fetch_first("SELECT username FROM ".DB::table('common_member')." WHERE uid='{$uid_ban}' LIMIT 1"); - $username_ban = '@'.addslashes($username_ban['username']); - $icon = 'alert'; - $touid = 0; - $text = '[color=red]ปลดแบน[/color] '.$username_ban; - $bannedq = implode(',',$banned); - DB::query("UPDATE ".DB::table('common_pluginvar')." SET value='{$bannedq}' WHERE variable='chat_ban' AND displayorder='16' LIMIT 1"); - } - }elseif(substr($text,0,6)=="!point"&&$config['chat_point']){ - $point = explode('|',substr($text,6)); - $uid_point = intval($point[0]); - $res = $point[2]; - $point = intval($point[1]); - if($uid_point&&($point==1||$point==-1)&&($uid_point!=$uid)||$uid==1){ - $re = DB::query("SELECT uid,point_time FROM ".DB::table('newz_nick')." WHERE uid='{$uid}'"); - if($re = DB::fetch($re)){ - if($time-$re['point_time']<$config['point_time']){ - die(json_encode(array('type'=>1,'error'=>'คุณสามารถให้คะแนนได้ 1 ครั้งภายใน 10 วินาที'))); - }else{ - DB::query("UPDATE ".DB::table('newz_nick')." SET point_time='{$time}' WHERE uid='{$uid}' LIMIT 1"); - } - }else{ - DB::query("INSERT INTO ".DB::table('newz_nick')." (uid,point_time) VALUES ('{$uid}','{$time}')"); - } - if($point>0){ - $point = '+'.$point; - } - if($touid!=$uid_point){ - $touid=0; - } - $this_username_name = DB::query("SELECT username FROM ".DB::table('common_member')." WHERE uid='{$uid_point}' LIMIT 1"); - $this_username_name = DB::fetch($this_username_name); - if($config['chat_point']!='9'){ - DB::query("UPDATE ".DB::table('common_member_count')." SET extcredits{$config['chat_point']}=extcredits{$config['chat_point']}{$point} WHERE uid='{$uid_point}' LIMIT 1"); - $username_point = DB::query("SELECT extcredits{$config['chat_point']} AS point FROM ".DB::table('common_member_count')." WHERE uid='{$uid_point}' LIMIT 1"); - $username_point = DB::fetch($username_point); - }else{ - DB::query("INSERT INTO ".DB::table('newz_nick')." (uid,point_total) VALUES ('{$uid_point}',{$point}) ON DUPLICATE KEY UPDATE point_total=point_total{$point}"); - $username_point = DB::query("SELECT point_total AS point FROM ".DB::table('newz_nick')." WHERE uid='{$uid_point}' LIMIT 1"); - $username_point = DB::fetch($username_point); - } - $total_point = $username_point['point']; - if($point>0||$point==0){ - $point='[color=green]'.$point.'[/color]'; - }else{ - $point='[color=red]'.$point.'[/color]'; - } - $icon = 'alert'; - $touid = 0; - $text = '@'.$this_username_name['username'].' '.$point.' = '.$total_point.' '.$res; - $quota = 0; + if(DB::fetch_first("SELECT uid FROM ".DB::table('newz_nick')." WHERE uid='{$uid_ban}' LIMIT 1")){ + DB::update('newz_nick', array( + 'ban' => $time + ), '`uid`='.$uid_ban); + }else{ + DB::query("INSERT INTO ".DB::table('newz_nick')." (uid,ban) VALUES ('{$uid_ban}','{$time}')"); } + $username_ban = DB::fetch_first("SELECT username FROM ".DB::table('common_member')." WHERE uid='{$uid_ban}' LIMIT 1"); + $username_ban = '@'.$username_ban['username']; + $icon = 'alert'; + $touid = 0; + $text = $username_ban.' [color=red]ถูกแบน'.($time==4294967295?'ถาวร':'ถึง '.date("d/m/Y H:i:s",$time)).'[/color]'; + }elseif(substr($text,0,6)=="!unban"&&$is_mod){ + $ban = explode(" ",$text); + $uid_ban = intval($ban[1]); + DB::update('newz_nick', array( + 'ban' => 0 + ), '`uid`='.$uid_ban); + $username_ban = DB::fetch_first("SELECT username FROM ".DB::table('common_member')." WHERE uid='{$uid_ban}' LIMIT 1"); + $username_ban = '@'.$username_ban['username']; + $icon = 'alert'; + $touid = 0; + $text = '[color=red]ปลดแบน[/color] '.$username_ban; } if($command=="notice"&&$is_mod){ $icon = 'alert'; @@ -110,14 +72,14 @@ if($config['editmsg']==1&&!$is_mod){ die(json_encode(array('type'=>1,'error'=>'Access Denied'))); } - $user = DB::fetch(DB::query("SELECT uid FROM ".DB::table('newz_data')." WHERE id='{$editid}'")); - if($config['editmsg']==2&&(!$is_mod||$user['uid']!=$uid)){ + $editmsg = DB::fetch_first("SELECT * FROM ".DB::table('newz_data')." WHERE id='{$editid}'"); + if($config['editmsg']==2&&(!$is_mod||$editmsg['uid']!=$uid)){ die(json_encode(array('type'=>1,'error'=>'Access Denied'))); - }else if($config['editmsg']==3&&($user['uid']!=$uid)){ + }else if($config['editmsg']==3&&($editmsg['uid']!=$uid)){ die(json_encode(array('type'=>1,'error'=>'Access Denied'))); } $edittext = 'ถูกแก้ไข'; - if($user['uid']!=$uid){ + if($editmsg['uid']!=$uid){ $edittext .='โดย '.$_G['username']; } $ip = 'edit'; @@ -153,7 +115,7 @@ $text = preg_replace('/\[quota\](.*?)\[\/quota\]/', '[quota]$1[[color=#fff][/color]/quota]', $text); if($config['usemore']){$usemore = -$_G['groupid'];}else{$usemore = 1;} $text = discuzcode($text,$config['useemo'],$config['usedzc'],$config['usehtml'],1,$usemore,$config['useimg'],1,0,$config['useunshowdzc'],0, $config['mediacode']); -$text = paddslashes(preg_replace('/\[mpopup\](.*?)\[\/mpopup\]/', '
คลิกเพื่อดูวีดีโอ
$1
', $text)); +$text = addslashes(preg_replace('/\[mpopup\](.*?)\[\/mpopup\]/', '
คลิกเพื่อดูวีดีโอ
$1
', $text)); if($txtlen==1){ if(preg_match('/[\x{1F3F4}](?:\x{E0067}\x{E0062}\x{E0077}\x{E006C}\x{E0073}\x{E007F})|[\x{1F3F4}](?:\x{E0067}\x{E0062}\x{E0073}\x{E0063}\x{E0074}\x{E007F})|[\x{1F3F4}](?:\x{E0067}\x{E0062}\x{E0065}\x{E006E}\x{E0067}\x{E007F})|[\x{1F3F4}](?:\x{200D}\x{2620}\x{FE0F})|[\x{1F3F3}](?:\x{FE0F}\x{200D}\x{1F308})|[\x{0023}\x{002A}\x{0030}\x{0031}\x{0032}\x{0033}\x{0034}\x{0035}\x{0036}\x{0037}\x{0038}\x{0039}](?:\x{FE0F}\x{20E3})|[\x{1F415}](?:\x{200D}\x{1F9BA})|[\x{1F468}\x{1F469}](?:\x{200D}\x{1F467}\x{200D}\x{1F467})|[\x{1F468}\x{1F469}](?:\x{200D}\x{1F467}\x{200D}\x{1F466})|[\x{1F468}\x{1F469}](?:\x{200D}\x{1F467})|[\x{1F468}\x{1F469}](?:\x{200D}\x{1F466}\x{200D}\x{1F466})|[\x{1F468}\x{1F469}](?:\x{200D}\x{1F466})|[\x{1F468}](?:\x{200D}\x{1F468}\x{200D}\x{1F467}\x{200D}\x{1F467})|[\x{1F468}](?:\x{200D}\x{1F468}\x{200D}\x{1F466}\x{200D}\x{1F466})|[\x{1F468}](?:\x{200D}\x{1F468}\x{200D}\x{1F467}\x{200D}\x{1F466})|[\x{1F468}](?:\x{200D}\x{1F468}\x{200D}\x{1F467})|[\x{1F468}](?:\x{200D}\x{1F468}\x{200D}\x{1F466})|[\x{1F468}\x{1F469}](?:\x{200D}\x{1F469}\x{200D}\x{1F467}\x{200D}\x{1F467})|[\x{1F468}\x{1F469}](?:\x{200D}\x{1F469}\x{200D}\x{1F466}\x{200D}\x{1F466})|[\x{1F468}\x{1F469}](?:\x{200D}\x{1F469}\x{200D}\x{1F467}\x{200D}\x{1F466})|[\x{1F468}\x{1F469}](?:\x{200D}\x{1F469}\x{200D}\x{1F467})|[\x{1F468}\x{1F469}](?:\x{200D}\x{1F469}\x{200D}\x{1F466})|[\x{1F469}](?:\x{200D}\x{2764}\x{FE0F}\x{200D}\x{1F469})|[\x{1F469}\x{1F468}](?:\x{200D}\x{2764}\x{FE0F}\x{200D}\x{1F468})|[\x{1F469}](?:\x{200D}\x{2764}\x{FE0F}\x{200D}\x{1F48B}\x{200D}\x{1F469})|[\x{1F469}\x{1F468}](?:\x{200D}\x{2764}\x{FE0F}\x{200D}\x{1F48B}\x{200D}\x{1F468})|[\x{1F468}\x{1F469}](?:\x{200D}\x{1F9BD})|[\x{1F468}\x{1F469}](?:\x{200D}\x{1F9BC})|[\x{1F468}\x{1F469}](?:\x{200D}\x{1F9AF})|[\x{1F575}\x{1F3CC}\x{26F9}\x{1F3CB}](?:\x{FE0F}\x{200D}\x{2640}\x{FE0F})|[\x{1F575}\x{1F3CC}\x{26F9}\x{1F3CB}](?:\x{FE0F}\x{200D}\x{2642}\x{FE0F})|[\x{1F468}\x{1F469}](?:\x{200D}\x{1F692})|[\x{1F468}\x{1F469}](?:\x{200D}\x{1F680})|[\x{1F468}\x{1F469}](?:\x{200D}\x{2708}\x{FE0F})|[\x{1F468}\x{1F469}](?:\x{200D}\x{1F3A8})|[\x{1F468}\x{1F469}](?:\x{200D}\x{1F3A4})|[\x{1F468}\x{1F469}](?:\x{200D}\x{1F4BB})|[\x{1F468}\x{1F469}](?:\x{200D}\x{1F52C})|[\x{1F468}\x{1F469}](?:\x{200D}\x{1F4BC})|[\x{1F468}\x{1F469}](?:\x{200D}\x{1F3ED})|[\x{1F468}\x{1F469}](?:\x{200D}\x{1F527})|[\x{1F468}\x{1F469}](?:\x{200D}\x{1F373})|[\x{1F468}\x{1F469}](?:\x{200D}\x{1F33E})|[\x{1F468}\x{1F469}](?:\x{200D}\x{2696}\x{FE0F})|[\x{1F468}\x{1F469}](?:\x{200D}\x{1F3EB})|[\x{1F468}\x{1F469}](?:\x{200D}\x{1F393})|[\x{1F468}\x{1F469}](?:\x{200D}\x{2695}\x{FE0F})|[\x{1F471}\x{1F64D}\x{1F64E}\x{1F645}\x{1F646}\x{1F481}\x{1F64B}\x{1F9CF}\x{1F647}\x{1F926}\x{1F937}\x{1F46E}\x{1F482}\x{1F477}\x{1F473}\x{1F9B8}\x{1F9B9}\x{1F9D9}\x{1F9DA}\x{1F9DB}\x{1F9DC}\x{1F9DD}\x{1F9DE}\x{1F9DF}\x{1F486}\x{1F487}\x{1F6B6}\x{1F9CD}\x{1F9CE}\x{1F3C3}\x{1F46F}\x{1F9D6}\x{1F9D7}\x{1F3C4}\x{1F6A3}\x{1F3CA}\x{1F6B4}\x{1F6B5}\x{1F938}\x{1F93C}\x{1F93D}\x{1F93E}\x{1F939}\x{1F9D8}](?:\x{200D}\x{2640}\x{FE0F})|[\x{1F468}\x{1F469}](?:\x{200D}\x{1F9B2})|[\x{1F468}\x{1F469}](?:\x{200D}\x{1F9B3})|[\x{1F468}\x{1F469}](?:\x{200D}\x{1F9B1})|[\x{1F468}\x{1F469}](?:\x{200D}\x{1F9B0})|[\x{1F471}\x{1F64D}\x{1F64E}\x{1F645}\x{1F646}\x{1F481}\x{1F64B}\x{1F9CF}\x{1F647}\x{1F926}\x{1F937}\x{1F46E}\x{1F482}\x{1F477}\x{1F473}\x{1F9B8}\x{1F9B9}\x{1F9D9}\x{1F9DA}\x{1F9DB}\x{1F9DC}\x{1F9DD}\x{1F9DE}\x{1F9DF}\x{1F486}\x{1F487}\x{1F6B6}\x{1F9CD}\x{1F9CE}\x{1F3C3}\x{1F46F}\x{1F9D6}\x{1F9D7}\x{1F3C4}\x{1F6A3}\x{1F3CA}\x{1F6B4}\x{1F6B5}\x{1F938}\x{1F93C}\x{1F93D}\x{1F93E}\x{1F939}\x{1F9D8}](?:\x{200D}\x{2642}\x{FE0F})|[\x{1F441}](?:\x{FE0F}\x{200D}\x{1F5E8}\x{FE0F})|[\x{1F1E6}\x{1F1E7}\x{1F1E8}\x{1F1E9}\x{1F1F0}\x{1F1F2}\x{1F1F3}\x{1F1F8}\x{1F1F9}\x{1F1FA}](?:\x{1F1FF})|[\x{1F1E7}\x{1F1E8}\x{1F1EC}\x{1F1F0}\x{1F1F1}\x{1F1F2}\x{1F1F5}\x{1F1F8}\x{1F1FA}](?:\x{1F1FE})|[\x{1F1E6}\x{1F1E8}\x{1F1F2}\x{1F1F8}](?:\x{1F1FD})|[\x{1F1E6}\x{1F1E7}\x{1F1E8}\x{1F1EC}\x{1F1F0}\x{1F1F2}\x{1F1F5}\x{1F1F7}\x{1F1F9}\x{1F1FF}](?:\x{1F1FC})|[\x{1F1E7}\x{1F1E8}\x{1F1F1}\x{1F1F2}\x{1F1F8}\x{1F1F9}](?:\x{1F1FB})|[\x{1F1E6}\x{1F1E8}\x{1F1EA}\x{1F1EC}\x{1F1ED}\x{1F1F1}\x{1F1F2}\x{1F1F3}\x{1F1F7}\x{1F1FB}](?:\x{1F1FA})|[\x{1F1E6}\x{1F1E7}\x{1F1EA}\x{1F1EC}\x{1F1ED}\x{1F1EE}\x{1F1F1}\x{1F1F2}\x{1F1F5}\x{1F1F8}\x{1F1F9}\x{1F1FE}](?:\x{1F1F9})|[\x{1F1E6}\x{1F1E7}\x{1F1EA}\x{1F1EC}\x{1F1EE}\x{1F1F1}\x{1F1F2}\x{1F1F5}\x{1F1F7}\x{1F1F8}\x{1F1FA}\x{1F1FC}](?:\x{1F1F8})|[\x{1F1E6}\x{1F1E7}\x{1F1E8}\x{1F1EA}\x{1F1EB}\x{1F1EC}\x{1F1ED}\x{1F1EE}\x{1F1F0}\x{1F1F1}\x{1F1F2}\x{1F1F3}\x{1F1F5}\x{1F1F8}\x{1F1F9}](?:\x{1F1F7})|[\x{1F1E6}\x{1F1E7}\x{1F1EC}\x{1F1EE}\x{1F1F2}](?:\x{1F1F6})|[\x{1F1E8}\x{1F1EC}\x{1F1EF}\x{1F1F0}\x{1F1F2}\x{1F1F3}](?:\x{1F1F5})|[\x{1F1E6}\x{1F1E7}\x{1F1E8}\x{1F1E9}\x{1F1EB}\x{1F1EE}\x{1F1EF}\x{1F1F2}\x{1F1F3}\x{1F1F7}\x{1F1F8}\x{1F1F9}](?:\x{1F1F4})|[\x{1F1E7}\x{1F1E8}\x{1F1EC}\x{1F1ED}\x{1F1EE}\x{1F1F0}\x{1F1F2}\x{1F1F5}\x{1F1F8}\x{1F1F9}\x{1F1FA}\x{1F1FB}](?:\x{1F1F3})|[\x{1F1E6}\x{1F1E7}\x{1F1E8}\x{1F1E9}\x{1F1EB}\x{1F1EC}\x{1F1ED}\x{1F1EE}\x{1F1EF}\x{1F1F0}\x{1F1F2}\x{1F1F4}\x{1F1F5}\x{1F1F8}\x{1F1F9}\x{1F1FA}\x{1F1FF}](?:\x{1F1F2})|[\x{1F1E6}\x{1F1E7}\x{1F1E8}\x{1F1EC}\x{1F1EE}\x{1F1F2}\x{1F1F3}\x{1F1F5}\x{1F1F8}\x{1F1F9}](?:\x{1F1F1})|[\x{1F1E8}\x{1F1E9}\x{1F1EB}\x{1F1ED}\x{1F1F1}\x{1F1F2}\x{1F1F5}\x{1F1F8}\x{1F1F9}\x{1F1FD}](?:\x{1F1F0})|[\x{1F1E7}\x{1F1E9}\x{1F1EB}\x{1F1F8}\x{1F1F9}](?:\x{1F1EF})|[\x{1F1E6}\x{1F1E7}\x{1F1E8}\x{1F1EB}\x{1F1EC}\x{1F1F0}\x{1F1F1}\x{1F1F3}\x{1F1F8}\x{1F1FB}](?:\x{1F1EE})|[\x{1F1E7}\x{1F1E8}\x{1F1EA}\x{1F1EC}\x{1F1F0}\x{1F1F2}\x{1F1F5}\x{1F1F8}\x{1F1F9}](?:\x{1F1ED})|[\x{1F1E6}\x{1F1E7}\x{1F1E8}\x{1F1E9}\x{1F1EA}\x{1F1EC}\x{1F1F0}\x{1F1F2}\x{1F1F3}\x{1F1F5}\x{1F1F8}\x{1F1F9}\x{1F1FA}\x{1F1FB}](?:\x{1F1EC})|[\x{1F1E6}\x{1F1E7}\x{1F1E8}\x{1F1EC}\x{1F1F2}\x{1F1F3}\x{1F1F5}\x{1F1F9}\x{1F1FC}](?:\x{1F1EB})|[\x{1F1E6}\x{1F1E7}\x{1F1E9}\x{1F1EA}\x{1F1EC}\x{1F1EE}\x{1F1EF}\x{1F1F0}\x{1F1F2}\x{1F1F3}\x{1F1F5}\x{1F1F7}\x{1F1F8}\x{1F1FB}\x{1F1FE}](?:\x{1F1EA})|[\x{1F1E6}\x{1F1E7}\x{1F1E8}\x{1F1EC}\x{1F1EE}\x{1F1F2}\x{1F1F8}\x{1F1F9}](?:\x{1F1E9})|[\x{1F1E6}\x{1F1E8}\x{1F1EA}\x{1F1EE}\x{1F1F1}\x{1F1F2}\x{1F1F3}\x{1F1F8}\x{1F1F9}\x{1F1FB}](?:\x{1F1E8})|[\x{1F1E7}\x{1F1EC}\x{1F1F1}\x{1F1F8}](?:\x{1F1E7})|[\x{1F1E7}\x{1F1E8}\x{1F1EA}\x{1F1EC}\x{1F1F1}\x{1F1F2}\x{1F1F3}\x{1F1F5}\x{1F1F6}\x{1F1F8}\x{1F1F9}\x{1F1FA}\x{1F1FB}\x{1F1FF}](?:\x{1F1E6})|[\x{00A9}\x{00AE}\x{203C}\x{2049}\x{2122}\x{2139}\x{2194}-\x{2199}\x{21A9}-\x{21AA}\x{231A}-\x{231B}\x{2328}\x{23CF}\x{23E9}-\x{23F3}\x{23F8}-\x{23FA}\x{24C2}\x{25AA}-\x{25AB}\x{25B6}\x{25C0}\x{25FB}-\x{25FE}\x{2600}-\x{2604}\x{260E}\x{2611}\x{2614}-\x{2615}\x{2618}\x{261D}\x{2620}\x{2622}-\x{2623}\x{2626}\x{262A}\x{262E}-\x{262F}\x{2638}-\x{263A}\x{2640}\x{2642}\x{2648}-\x{2653}\x{265F}-\x{2660}\x{2663}\x{2665}-\x{2666}\x{2668}\x{267B}\x{267E}-\x{267F}\x{2692}-\x{2697}\x{2699}\x{269B}-\x{269C}\x{26A0}-\x{26A1}\x{26AA}-\x{26AB}\x{26B0}-\x{26B1}\x{26BD}-\x{26BE}\x{26C4}-\x{26C5}\x{26C8}\x{26CE}-\x{26CF}\x{26D1}\x{26D3}-\x{26D4}\x{26E9}-\x{26EA}\x{26F0}-\x{26F5}\x{26F7}-\x{26FA}\x{26FD}\x{2702}\x{2705}\x{2708}-\x{270D}\x{270F}\x{2712}\x{2714}\x{2716}\x{271D}\x{2721}\x{2728}\x{2733}-\x{2734}\x{2744}\x{2747}\x{274C}\x{274E}\x{2753}-\x{2755}\x{2757}\x{2763}-\x{2764}\x{2795}-\x{2797}\x{27A1}\x{27B0}\x{27BF}\x{2934}-\x{2935}\x{2B05}-\x{2B07}\x{2B1B}-\x{2B1C}\x{2B50}\x{2B55}\x{3030}\x{303D}\x{3297}\x{3299}\x{1F004}\x{1F0CF}\x{1F170}-\x{1F171}\x{1F17E}-\x{1F17F}\x{1F18E}\x{1F191}-\x{1F19A}\x{1F201}-\x{1F202}\x{1F21A}\x{1F22F}\x{1F232}-\x{1F23A}\x{1F250}-\x{1F251}\x{1F300}-\x{1F321}\x{1F324}-\x{1F393}\x{1F396}-\x{1F397}\x{1F399}-\x{1F39B}\x{1F39E}-\x{1F3F0}\x{1F3F3}-\x{1F3F5}\x{1F3F7}-\x{1F3FA}\x{1F400}-\x{1F4FD}\x{1F4FF}-\x{1F53D}\x{1F549}-\x{1F54E}\x{1F550}-\x{1F567}\x{1F56F}-\x{1F570}\x{1F573}-\x{1F57A}\x{1F587}\x{1F58A}-\x{1F58D}\x{1F590}\x{1F595}-\x{1F596}\x{1F5A4}-\x{1F5A5}\x{1F5A8}\x{1F5B1}-\x{1F5B2}\x{1F5BC}\x{1F5C2}-\x{1F5C4}\x{1F5D1}-\x{1F5D3}\x{1F5DC}-\x{1F5DE}\x{1F5E1}\x{1F5E3}\x{1F5E8}\x{1F5EF}\x{1F5F3}\x{1F5FA}-\x{1F64F}\x{1F680}-\x{1F6C5}\x{1F6CB}-\x{1F6D2}\x{1F6D5}\x{1F6E0}-\x{1F6E5}\x{1F6E9}\x{1F6EB}-\x{1F6EC}\x{1F6F0}\x{1F6F3}-\x{1F6FA}\x{1F7E0}-\x{1F7EB}\x{1F90D}-\x{1F93A}\x{1F93C}-\x{1F945}\x{1F947}-\x{1F971}\x{1F973}-\x{1F976}\x{1F97A}-\x{1F9A2}\x{1F9A5}-\x{1F9AA}\x{1F9AE}-\x{1F9CA}\x{1F9CD}-\x{1F9FF}\x{1FA70}-\x{1FA73}\x{1FA78}-\x{1FA7A}\x{1FA80}-\x{1FA82}\x{1FA90}-\x{1FA95}]/u', $text)){ $text = ''.$text.''; @@ -168,13 +130,20 @@ } $text = getat($text); if($ip == 'notice'){ - DB::query("UPDATE ".DB::table('common_pluginvar')." SET value='{$text}' WHERE variable='welcometext' AND displayorder='1' LIMIT 1"); + $plugin = C::t('common_plugin')->fetch_by_identifier('th_chat'); + C::t('common_pluginvar')->update_by_variable($plugin['pluginid'], 'welcometext', array('value' => $text)); include_once libfile('function/cache'); updatecache('plugin'); - DB::query("INSERT INTO ".DB::table('newz_data')." (uid,touid,icon,text,time,ip) VALUES ('$uid','0','alert','$text','".time()."','".$_G['clientip']."')"); + DB::query("INSERT INTO ".DB::table('newz_data')." (uid,touid,icon,text,time,ip) VALUES ('$uid','0','alert','$text','".TIMESTAMP."','".$_G['clientip']."')"); }elseif($ip == 'edit'){ - $text .=' '.$edittext.''; - DB::query("UPDATE ".DB::table('newz_data')." SET text='{$text}' WHERE id='{$icon}' LIMIT 1"); + preg_match('/\[quota\](.*?)\[\/quota\]/', $editmsg['text'], $editquota); + if($editquota[0]){ + $text = addslashes($editquota[0]).$text; + } + $text .= ' '.$edittext.''; + DB::update('newz_data', array( + 'text' => $text + ), '`id`='.$icon); } if($quota>0 && $ip != 'clear'){ $text = getquota($quota).$text; @@ -204,13 +173,10 @@ $body[$c['id']] .= ''; continue; }elseif($c['ip'] == 'notice'){ - DB::query("UPDATE ".DB::table('common_pluginvar')." SET value='".addslashes($c['text'])."' WHERE variable='welcometext' AND displayorder='1' LIMIT 1"); - include_once libfile('function/cache'); - updatecache('plugin'); - $body[$c['id']] .= ''; + $body[$c['id']] .= ''; continue; }elseif($c['ip'] == 'edit'){ - $body[$c['id']] .= ''; + $body[$c['id']] .= ''; continue; } if($c['ip']=='clear'){ @@ -221,7 +187,7 @@ }elseif($c['touid']==0){ $c['text'] = '' . $c['text']; }elseif($c['touid']==$uid){ - $c['text'] = ($config['pm_sound']?'':'').'กระซิบว่า (ตอบ): ' . $c['text']; + $c['text'] = ($config['pm_sound']?'':'').'' . $c['text']; }elseif($c['uid']==$uid){ $c['text'] = '' . $c['text']; } diff --git a/th_chat/profile.inc.php b/th_chat/profile.inc.php index 1cba16e..9833ffd 100644 --- a/th_chat/profile.inc.php +++ b/th_chat/profile.inc.php @@ -12,34 +12,20 @@ loadcache('plugin'); $config = $_G['cache']['plugin']['th_chat']; $avatar = avatar($uid,'big',1); -$r = DB::fetch_first("SELECT s.uid,s.username,s.groupid,g.grouptitle,g.color,n.point_total,p.extcredits1,p.extcredits2,p.extcredits3,p.extcredits4,p.extcredits5,p.extcredits6,p.extcredits7,p.extcredits8 FROM ".DB::table('common_member')." s LEFT JOIN ".DB::table('common_usergroup')." g ON s.groupid=g.groupid LEFT JOIN ".DB::table('newz_nick')." n ON s.uid=n.uid LEFT JOIN ".DB::table('common_member_count')." p ON s.uid=p.uid WHERE s.uid=".$uid); +$r = DB::fetch_first("SELECT s.uid,s.username,s.groupid,g.grouptitle,g.color,n.ban,p.extcredits1,p.extcredits2,p.extcredits3,p.extcredits4,p.extcredits5,p.extcredits6,p.extcredits7,p.extcredits8 FROM ".DB::table('common_member')." s LEFT JOIN ".DB::table('common_usergroup')." g ON s.groupid=g.groupid LEFT JOIN ".DB::table('newz_nick')." n ON s.uid=n.uid LEFT JOIN ".DB::table('common_member_count')." p ON s.uid=p.uid WHERE s.uid=".$uid); if($uid==$_G['uid']){ $mlist .= ' เปลี่ยนรูป ตั้งค่าห้องแชท'; }else{ $mlist .= ' กระซิบ เพิ่มเพื่อน ส่งข้อความ'; } -if($config['chat_point']){ - if($config['chat_point']==9){ - $chat_point = $r['point_total']; - }else{ - $chat_point = $r['extcredits'.$config['chat_point']]; - } - if(in_array($_G['adminid'],array(1,2,3))){ - $mlist .= 'ให้คะแนน +1 / -1 / กรอกคะแนน'; - }elseif($uid!=$_G['uid']){ - $mlist .= 'ให้คะแนน +1 / -1'; - } - if($chatpoint>0){ - $chatpoint .= '
(+'.number_format($chat_point).')'; - }elseif($chatpoint<0){ - $chatpoint .= '
(-'.number_format($chat_point).')'; - }else{ - $chatpoint .= '
('.number_format($chat_point).')'; - } +$banuntil = ''; +if($r['ban']){ + $banuntil = 'ถูกแบนถึง
'.date("d/m/Y H:i:s",$r['ban']).'

'; } $groupcolor = ($r['color']?'style="background-color:'.$r['color'].'" ':''); +$banned = explode(",", $config['chat_ban']); if(in_array($_G['adminid'],array(1,2,3))&&!($uid==$_G['uid'])){ - $mlist .= (in_array($r['gourpid'],array(1,2,3))?'':(!in_array($uid,$banned)?'แบน':'ปลดแบน')); + $mlist .= (in_array($r['groupid'],array(1,2,3))?'':(!$r['ban']?'แบน: [1 ชม.] [1 วัน] [ถาวร]':'ปลดแบน')); } include template('common/header_ajax'); include template('th_chat:profile'); diff --git a/th_chat/template/big.htm b/th_chat/template/big.htm index ad5d300..9876e6e 100644 --- a/th_chat/template/big.htm +++ b/th_chat/template/big.htm @@ -1,12 +1,12 @@ {$chat['guest_show']} -
© 2th Chat 2.18e by ChaoHost
+ - +