From c5679802217a25822da9e290b32b47f7b16c0437 Mon Sep 17 00:00:00 2001 From: revofpla Date: Wed, 17 Jan 2018 16:25:12 +0900 Subject: [PATCH] =?UTF-8?q?[php5=5Fdebug]=20msglist.php=EC=9D=98=20?= =?UTF-8?q?=EA=B8=B0=EB=8A=A5=20=EB=B2=84=EA=B7=B8=20=EB=B0=8F=20=EB=A1=9C?= =?UTF-8?q?=EC=A7=81=20=EA=B0=9C=EC=84=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- twe/c_msgsubmit.php | 15 +++++++++++++-- twe/func.php | 8 +++++--- twe/func_string.php | 16 ++++++++++++++++ 3 files changed, 34 insertions(+), 5 deletions(-) diff --git a/twe/c_msgsubmit.php b/twe/c_msgsubmit.php index ea20a7bf..a0f14079 100644 --- a/twe/c_msgsubmit.php +++ b/twe/c_msgsubmit.php @@ -27,12 +27,15 @@ if($con >= 2) { echo "'; if($me['nation'] == 0) { $nation['name'] = '재야'; $nation['color'] = 'FFFFFF'; @@ -47,6 +50,7 @@ if($genlist == 9999 && str_replace(" ", "", $msg) != "") { if($me['nation'] == 0) { $nation['name'] = '재야'; $nation['color'] = 'FFFFFF'; + $nation['nation'] = 0; } else { $query = "select nation,name,color from nation where nation='{$me['nation']}'"; $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); @@ -57,6 +61,13 @@ if($genlist == 9999 && str_replace(" ", "", $msg) != "") { $query = "select nation,name,color from nation where nation='$genlist'"; $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $dest = MYDB_fetch_array($result); + + //$dest가 없다는건 수신도 재야. + if(empty($dest)){ + $dest['name'] = '재야'; + $dest['color'] = 'FFFFFF'; + $dest['nation'] = 0; + } if($nation['nation'] == $dest['nation']) { PushMsg(2, $nation['nation'], $me['picture'], $me['imgsvr'], "{$me['name']}:", $nation['color'], $dest['name'], $dest['color'], $msg); @@ -113,6 +124,6 @@ if($genlist == 9999 && str_replace(" ", "", $msg) != "") { fclose($fp); } -//echo ""; -echo 'msglist.php';//TODO:replace +echo ""; +//echo 'msglist.php';//TODO:replace diff --git a/twe/func.php b/twe/func.php index 27f97990..50250199 100644 --- a/twe/func.php +++ b/twe/func.php @@ -3184,7 +3184,8 @@ function genList($connect) { $query = "select no,nation,level,msgindex,userlevel from general where user_id='{$_SESSION['p_id']}'"; $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $me = MYDB_fetch_array($result); - + $you = array(); + $query = "select msg{$me['msgindex']}_who as reply,msg{$me['msgindex']}_type as type from general where user_id='{$_SESSION['p_id']}'"; $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $reply = MYDB_fetch_array($result); @@ -3426,8 +3427,9 @@ function MsgFile($skin, $bg, $nation=0, $level=0) { $msg[$k] = trim($msg[$k]); } } - - ShowMsg($skin, $bgcolor, $msg[0], $msg[7], $msg[8], $msg[1], $msg[5], $msg[2], $msg[6], $msg[4], $msg[3]); + if(!empty($msg)){ + ShowMsg($skin, $bgcolor, $msg[0], $msg[7], $msg[8], $msg[1], $msg[5], $msg[2], $msg[6], $msg[4], $msg[3]); + } } } diff --git a/twe/func_string.php b/twe/func_string.php index 489c767d..c8a6561a 100644 --- a/twe/func_string.php +++ b/twe/func_string.php @@ -236,6 +236,22 @@ class _String { } return $string; } + + function Fill($str, $maxsize, $ch) { + $size = strlen($str); + + $count = ($maxsize - $size) / 2; + + $string = ''; + for($i=0; $i < $count; $i++) { + $string = $string.$ch; + } + $string = $string.$str; + for($i=0; $i < $count; $i++) { + $string = $string.$ch; + } + return $string; + } //우측정렬 public static function Fill2($str, $maxsize, $ch='0') {