From 1b45add2e94b7992b87610b5f6608e520e17382f Mon Sep 17 00:00:00 2001 From: revofpla Date: Wed, 17 Jan 2018 15:02:18 +0900 Subject: [PATCH] =?UTF-8?q?[php5=5Fdebug]=20func.php=EC=97=90=EC=84=9C=20?= =?UTF-8?q?=EB=94=B0=EC=98=B4=ED=91=9C=20=EB=88=84=EB=9D=BD=EB=90=9C=20?= =?UTF-8?q?=EB=B6=80=EB=B6=84=EC=97=90=20=EC=B6=94=EA=B0=80=20=EB=B0=8F=20?= =?UTF-8?q?empty=20array=EC=97=90=20=EB=8C=80=ED=95=9C=20=EC=98=88?= =?UTF-8?q?=EC=99=B8=EC=B2=98=EB=A6=AC=EB=A1=9C=EC=A7=81=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80,=20=EB=B6=88=ED=95=84=EC=9A=94=20=EC=A3=BC=EC=84=9D?= =?UTF-8?q?=EC=B2=98=EB=A6=AC=EC=86=8C=EC=8A=A4=20=EC=82=AD=EC=A0=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- twe/func.php | 30 ++++++++++++++++++++---------- twe/main.php | 4 ---- 2 files changed, 20 insertions(+), 14 deletions(-) diff --git a/twe/func.php b/twe/func.php index 1edc4719..27f97990 100644 --- a/twe/func.php +++ b/twe/func.php @@ -3001,7 +3001,9 @@ function AllLog($count, $skin) { @fclose($fp); $log = explode("\r\n",$file); $str = ""; - for($i=0; $i < $count; $i++) { $str .= ConvertLog($log[count($log)-2-$i], $skin)."
"; } + for($i=0; $i < $count; $i++) { + $str .= isset($log[count($log)-2-$i]) ? ConvertLog($log[count($log)-2-$i], $skin)."
" : "
"; + } echo $str; } @@ -3023,7 +3025,9 @@ function History($count, $skin) { @fclose($fp); $log = explode("\r\n",$file); $str = ""; - for($i=0; $i < $count; $i++) { $str .= ConvertLog($log[count($log)-2-$i], $skin)."
"; } + for($i=0; $i < $count; $i++) { + $str .= isset($log[count($log)-2-$i]) ? ConvertLog($log[count($log)-2-$i], $skin)."
" : "
"; + } echo $str; } @@ -3034,7 +3038,9 @@ function MyLog($no, $count, $skin) { @fclose($fp); $log = explode("\r\n",$file); $str = ""; - for($i=0; $i < $count; $i++) { $str .= ConvertLog($log[count($log)-2-$i], $skin)."
"; } + for($i=0; $i < $count; $i++) { + $str .= isset($log[count($log)-2-$i]) ? ConvertLog($log[count($log)-2-$i], $skin)."
" : "
"; + } echo $str; } @@ -3315,11 +3321,11 @@ function MsgDip($connect, $bg) { $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $nation = MYDB_fetch_array($result); - if($nation[dip0]) { echo "\n"; DecodeMsg($connect, $nation[dip0], $nation['dip0_type'], $nation['dip0_who'], $nation['dip0_when'], $bg, 0); } - if($nation[dip1]) { echo "\n"; DecodeMsg($connect, $nation[dip1], $nation['dip1_type'], $nation['dip1_who'], $nation['dip1_when'], $bg, 1); } - if($nation[dip2]) { echo "\n"; DecodeMsg($connect, $nation[dip2], $nation['dip2_type'], $nation['dip2_who'], $nation['dip2_when'], $bg, 2); } - if($nation[dip3]) { echo "\n"; DecodeMsg($connect, $nation[dip3], $nation['dip3_type'], $nation['dip3_who'], $nation['dip3_when'], $bg, 3); } - if($nation[dip4]) { echo "\n"; DecodeMsg($connect, $nation[dip4], $nation['dip4_type'], $nation['dip4_who'], $nation['dip4_when'], $bg, 4); } + if($nation['dip0']) { echo "\n"; DecodeMsg($connect, $nation['dip0'], $nation['dip0_type'], $nation['dip0_who'], $nation['dip0_when'], $bg, 0); } + if($nation['dip1']) { echo "\n"; DecodeMsg($connect, $nation['dip1'], $nation['dip1_type'], $nation['dip1_who'], $nation['dip1_when'], $bg, 1); } + if($nation['dip2']) { echo "\n"; DecodeMsg($connect, $nation['dip2'], $nation['dip2_type'], $nation['dip2_who'], $nation['dip2_when'], $bg, 2); } + if($nation['dip3']) { echo "\n"; DecodeMsg($connect, $nation['dip3'], $nation['dip3_type'], $nation['dip3_who'], $nation['dip3_when'], $bg, 3); } + if($nation['dip4']) { echo "\n"; DecodeMsg($connect, $nation['dip4'], $nation['dip4_type'], $nation['dip4_who'], $nation['dip4_when'], $bg, 4); } } // type : xx,xx(불가침기간,타입) @@ -3412,10 +3418,14 @@ function MsgFile($skin, $bg, $nation=0, $level=0) { @fclose($fp); $code = explode("\r\n",$file); for($i=0; $i < $count; $i++) { - $msg = explode("|", $code[count($code)-2-$i]); + $msg = isset($code[count($code)-2-$i]) ? explode("|", $code[count($code)-2-$i]) : array(); $cnt = count($msg); - for($k=0; $k < $cnt; $k++) { $msg[$k] = trim($msg[$k]); } + if(!empty($cnt)){ + for($k=0; $k < $cnt; $k++) { + $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]); } diff --git a/twe/main.php b/twe/main.php index b4dfeb7a..22831d26 100644 --- a/twe/main.php +++ b/twe/main.php @@ -53,7 +53,6 @@ $scenario = getScenario($connect); type=text/css>