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') {