_Setting, _String, _Time 클래스 재 명명
- autoload로 변환
This commit is contained in:
+1
-1
@@ -84,7 +84,7 @@ $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""
|
||||
$histCount = MYDB_num_rows($result);
|
||||
for($i=0; $i < $histCount; $i++) {
|
||||
$history = MYDB_fetch_array($result);
|
||||
$value = "".$history['year']._String::Fill2($history['month'], 2, "0");
|
||||
$value = "".$history['year'].StringUtil::Fill2($history['month'], 2, "0");
|
||||
if($history['year'] == $year && $history['month'] == $month) {
|
||||
echo "
|
||||
<option selected value={$value}>{$history['year']}년 {$history['month']}월</option>";
|
||||
|
||||
@@ -53,7 +53,7 @@ if($me['level'] == 0) {
|
||||
echo "
|
||||
<option value={$city['city']}";
|
||||
if($city['city'] == $_REQUEST['citylist']) { echo " selected"; $valid = 1; }
|
||||
echo ">==================================================【"._String::Fill($city['name'], 4, '_')."】";
|
||||
echo ">==================================================【".StringUtil::Fill($city['name'], 4, '_')."】";
|
||||
if($city['nation'] == 0) echo "공백지";
|
||||
elseif($me['nation'] == $city['nation']) echo "본국==";
|
||||
else echo "타국==";
|
||||
@@ -69,7 +69,7 @@ if($me['level'] == 0) {
|
||||
echo "
|
||||
<option value={$city['city']}";
|
||||
if($city['city'] == $_REQUEST['citylist']) { echo " selected"; $valid = 1; }
|
||||
echo ">==================================================【"._String::Fill($city['name'], 4, '_')."】";
|
||||
echo ">==================================================【".StringUtil::Fill($city['name'], 4, '_')."】";
|
||||
if($city['nation'] == 0) echo "공백지";
|
||||
elseif($me['nation'] == $city['nation']) echo "본국==";
|
||||
else echo "타국==";
|
||||
@@ -86,7 +86,7 @@ if($me['level'] == 0) {
|
||||
echo "
|
||||
<option value={$city['city']}";
|
||||
if($city['city'] == $_REQUEST['citylist']) { echo " selected"; $valid = 1; }
|
||||
echo ">==================================================【"._String::Fill($city['name'], 4, '_')."】";
|
||||
echo ">==================================================【".StringUtil::Fill($city['name'], 4, '_')."】";
|
||||
if($city['nation'] == 0) echo "공백지";
|
||||
elseif($me['nation'] == $city['nation']) echo "본국==";
|
||||
else echo "타국==";
|
||||
@@ -112,7 +112,7 @@ if($myNation['level'] > 0) {
|
||||
echo "
|
||||
<option value={$city['city']}";
|
||||
if($city['city'] == $_REQUEST['citylist']) { echo " selected"; $valid = 1; }
|
||||
echo ">==================================================【"._String::Fill($city['name'], 4, '_')."】";
|
||||
echo ">==================================================【".StringUtil::Fill($city['name'], 4, '_')."】";
|
||||
if($city['nation'] == 0) echo "공백지";
|
||||
elseif($me['nation'] == $city['nation']) echo "본국==";
|
||||
else echo "타국==";
|
||||
|
||||
+1
-1
@@ -173,7 +173,7 @@ for($j=0; $j < $gencount; $j++) {
|
||||
$turn = getTurn($connect, $general, 1, 0);
|
||||
|
||||
for($i=0; $i < 5; $i++) {
|
||||
$turn[$i] = _String::SubStrForWidth($turn[$i], 0, 20);
|
||||
$turn[$i] = StringUtil::SubStrForWidth($turn[$i], 0, 20);
|
||||
$k = $i+1;
|
||||
echo "
|
||||
$k : $turn[$i] <br>";
|
||||
|
||||
+3
-3
@@ -30,7 +30,7 @@ if($command == 46) {
|
||||
$name = str_replace(" ", "", $name);
|
||||
$name = str_replace(" ", "뷁", $name);
|
||||
if($name == "") { $name = "무명"; }
|
||||
$name = _String::SubStrForWidth($name, 0, 12);
|
||||
$name = StringUtil::SubStrForWidth($name, 0, 12);
|
||||
|
||||
$query = "update general set makenation='{$name}' where owner='{$_SESSION['userID']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
@@ -56,7 +56,7 @@ if($command == 46) {
|
||||
$nationname = str_replace(" ", "", $nationname);
|
||||
$nationname = str_replace(" ", "뷁", $nationname);
|
||||
if($nationname == "") { $nationname = "무명"; }
|
||||
$nationname = _String::SubStrForWidth($nationname, 0, 12);
|
||||
$nationname = StringUtil::SubStrForWidth($nationname, 0, 12);
|
||||
|
||||
$query = "update general set makenation='{$nationname}' where level>=5 and nation='{$me['nation']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
@@ -82,7 +82,7 @@ if($command == 46) {
|
||||
$note = str_replace("|", "", $note);
|
||||
$note = str_replace(" ", "", $note);
|
||||
$note = str_replace(" ", "뷁", $note);
|
||||
$note = _String::SubStrForWidth($note, 0, 90);
|
||||
$note = StringUtil::SubStrForWidth($note, 0, 90);
|
||||
|
||||
$query = "update diplomacy set reserved='{$note}' where me='{$me['nation']}' and you='$double'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
|
||||
+19
-19
@@ -1510,7 +1510,7 @@ function PushMsg($type, $nation, $picture, $imgsvr, $from, $fromcolor, $to, $toc
|
||||
else { $file = "_nation_msg{$nation}.txt"; }
|
||||
$fp = fopen("logs/{$file}", "a");
|
||||
//로그 파일에 기록
|
||||
$str = "{$type}|"._String::Fill($from,12," ")."|"._String::Fill($to,12," ")."|".$date."|".$msg."|".$fromcolor."|".$tocolor."|".$picture."|".$imgsvr;
|
||||
$str = "{$type}|".StringUtil::Fill($from,12," ")."|".StringUtil::Fill($to,12," ")."|".$date."|".$msg."|".$fromcolor."|".$tocolor."|".$picture."|".$imgsvr;
|
||||
fwrite($fp, "{$str}\n");
|
||||
fclose($fp);
|
||||
}
|
||||
@@ -1599,11 +1599,11 @@ function addTurn($date, $turnterm=1) {
|
||||
if($day > $lastday[$month]) { $month++; $day = 1; }
|
||||
if($month >= 13) { $year++; $month = 1; }
|
||||
|
||||
$month = _String::Fill2($month, 2, "0");
|
||||
$day = _String::Fill2($day, 2, "0");
|
||||
$hour = _String::Fill2($hour, 2, "0");
|
||||
$min = _String::Fill2($min, 2, "0");
|
||||
$sec = _String::Fill2($sec, 2, "0");
|
||||
$month = StringUtil::Fill2($month, 2, "0");
|
||||
$day = StringUtil::Fill2($day, 2, "0");
|
||||
$hour = StringUtil::Fill2($hour, 2, "0");
|
||||
$min = StringUtil::Fill2($min, 2, "0");
|
||||
$sec = StringUtil::Fill2($sec, 2, "0");
|
||||
|
||||
return "{$year}-{$month}-{$day} {$hour}:{$min}:{$sec}";
|
||||
}
|
||||
@@ -1635,11 +1635,11 @@ function add12Turn($date, $turnterm=1) {
|
||||
if($day > $lastday[$month]) { $month++; $day = 1; }
|
||||
if($month >= 13) { $year++; $month = 1; }
|
||||
|
||||
$month = _String::Fill2($month, 2, "0");
|
||||
$day = _String::Fill2($day, 2, "0");
|
||||
$hour = _String::Fill2($hour, 2, "0");
|
||||
$min = _String::Fill2($min, 2, "0");
|
||||
$sec = _String::Fill2($sec, 2, "0");
|
||||
$month = StringUtil::Fill2($month, 2, "0");
|
||||
$day = StringUtil::Fill2($day, 2, "0");
|
||||
$hour = StringUtil::Fill2($hour, 2, "0");
|
||||
$min = StringUtil::Fill2($min, 2, "0");
|
||||
$sec = StringUtil::Fill2($sec, 2, "0");
|
||||
|
||||
return "{$year}-{$month}-{$day} {$hour}:{$min}:{$sec}";
|
||||
}
|
||||
@@ -1671,12 +1671,12 @@ function subTurn($date, $turnterm=1) {
|
||||
if($day <= 0) { $month--; $day = $lastday[$month]; }
|
||||
if($month <= 0) { $year--; $month = 12; }
|
||||
|
||||
$year = _String::Fill2($year, 2, "0");
|
||||
$month = _String::Fill2($month, 2, "0");
|
||||
$day = _String::Fill2($day, 2, "0");
|
||||
$hour = _String::Fill2($hour, 2, "0");
|
||||
$min = _String::Fill2($min, 2, "0");
|
||||
$sec = _String::Fill2($sec, 2, "0");
|
||||
$year = StringUtil::Fill2($year, 2, "0");
|
||||
$month = StringUtil::Fill2($month, 2, "0");
|
||||
$day = StringUtil::Fill2($day, 2, "0");
|
||||
$hour = StringUtil::Fill2($hour, 2, "0");
|
||||
$min = StringUtil::Fill2($min, 2, "0");
|
||||
$sec = StringUtil::Fill2($sec, 2, "0");
|
||||
|
||||
return "{$year}-{$month}-{$day} {$hour}:{$min}:{$sec}";
|
||||
}
|
||||
@@ -1809,7 +1809,7 @@ function increaseRefresh($type="", $cnt=1) {
|
||||
$date2 = substr($date, 0, 10);
|
||||
$online = getOnlineNum();
|
||||
$fp = fopen("logs/_{$date2}_refresh.txt", "a");
|
||||
$msg = _String::Fill2($date,20," ")._String::Fill2($_SESSION['userName'],13," ")._String::Fill2($_SESSION['p_name'],13," ")._String::Fill2($_SESSION['p_ip'],16," ")._String::Fill2($type, 10, " ")." 동접자: {$online}";
|
||||
$msg = StringUtil::Fill2($date,20," ").StringUtil::Fill2($_SESSION['userName'],13," ").StringUtil::Fill2($_SESSION['p_name'],13," ").StringUtil::Fill2($_SESSION['p_ip'],16," ").StringUtil::Fill2($type, 10, " ")." 동접자: {$online}";
|
||||
fwrite($fp, $msg."\n");
|
||||
fclose($fp);
|
||||
|
||||
@@ -1867,7 +1867,7 @@ function updateTraffic() {
|
||||
$date = date('Y-m-d H:i:s');
|
||||
$fp = fopen("logs/_traffic.txt", "a");
|
||||
//일시|년|월|총갱신|접속자|최다갱신자
|
||||
$msg = _String::Fill2($date,20," ")."|"._String::Fill2($game['year'],3," ")."|"._String::Fill2($game['month'],2," ")."|"._String::Fill2($game['refresh'],8," ")."|"._String::Fill2($online,5," ")."|"._String::Fill2($user['name']."(".$user['refresh'].")",20," ");
|
||||
$msg = StringUtil::Fill2($date,20," ")."|".StringUtil::Fill2($game['year'],3," ")."|".StringUtil::Fill2($game['month'],2," ")."|".StringUtil::Fill2($game['refresh'],8," ")."|".StringUtil::Fill2($online,5," ")."|".StringUtil::Fill2($user['name']."(".$user['refresh'].")",20," ");
|
||||
fwrite($fp, $msg."\n");
|
||||
fclose($fp);
|
||||
}
|
||||
|
||||
@@ -715,10 +715,10 @@ function command_Other($connect, $turn, $commandtype) {
|
||||
|
||||
|
||||
function EncodeCommand($fourth, $third, $double, $command) {
|
||||
$str = _String::Fill2($fourth, 4, "0");
|
||||
$str .= _String::Fill2($third, 4, "0");
|
||||
$str .= _String::Fill2($double, 4, "0");
|
||||
$str .= _String::Fill2($command, 2, "0");
|
||||
$str = StringUtil::Fill2($fourth, 4, "0");
|
||||
$str .= StringUtil::Fill2($third, 4, "0");
|
||||
$str .= StringUtil::Fill2($double, 4, "0");
|
||||
$str .= StringUtil::Fill2($command, 2, "0");
|
||||
return $str;
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -563,7 +563,7 @@ function processAI($connect, $no) {
|
||||
$colors = GetNationColors();
|
||||
$color = rand() % count($colors);
|
||||
$command = EncodeCommand(0, $type, $color, 46);
|
||||
$nationName = "㉿"._String::SubStr($general['name'], 1);
|
||||
$nationName = "㉿".StringUtil::SubStr($general['name'], 1);
|
||||
//건국
|
||||
$query = "update general set turn0='$command',makenation='$nationName' where no='{$general['no']}'";
|
||||
MYDB_query($query, $connect) or Error("processAI08 ".MYDB_error($connect),"");
|
||||
|
||||
@@ -1603,11 +1603,11 @@ function process_31($connect, &$general) {
|
||||
$alllog[] = "<C>●</>{$admin['month']}월:누군가가 <G><b>{$city['name']}</b></>(을)를 살피는 것 같습니다.";
|
||||
$log[] = "<C>●</>{$admin['month']}월:<G><b>{$city['name']}</b></>의 많은 정보를 얻었습니다. <1>$date</>";
|
||||
$msg[count($msg)] = "【<S>병종</>】";
|
||||
for($i=0; $i <= 5; $i++) { if($typecount[$i] != 0) { $msg[count($msg)] = _String::SubStr(getTypename($i), 0, 2).":$typecount[$i]"; } }
|
||||
for($i=10; $i <= 14; $i++) { if($typecount[$i] != 0) { $msg[count($msg)] = _String::SubStr(getTypename($i), 0, 2).":$typecount[$i]"; } }
|
||||
for($i=20; $i <= 27; $i++) { if($typecount[$i] != 0) { $msg[count($msg)] = _String::SubStr(getTypename($i), 0, 2).":$typecount[$i]"; } }
|
||||
for($i=30; $i <= 38; $i++) { if($typecount[$i] != 0) { $msg[count($msg)] = _String::SubStr(getTypename($i), 0, 2).":$typecount[$i]"; } }
|
||||
for($i=40; $i <= 43; $i++) { if($typecount[$i] != 0) { $msg[count($msg)] = _String::SubStr(getTypename($i), 0, 2).":$typecount[$i]"; } }
|
||||
for($i=0; $i <= 5; $i++) { if($typecount[$i] != 0) { $msg[count($msg)] = StringUtil::SubStr(getTypename($i), 0, 2).":$typecount[$i]"; } }
|
||||
for($i=10; $i <= 14; $i++) { if($typecount[$i] != 0) { $msg[count($msg)] = StringUtil::SubStr(getTypename($i), 0, 2).":$typecount[$i]"; } }
|
||||
for($i=20; $i <= 27; $i++) { if($typecount[$i] != 0) { $msg[count($msg)] = StringUtil::SubStr(getTypename($i), 0, 2).":$typecount[$i]"; } }
|
||||
for($i=30; $i <= 38; $i++) { if($typecount[$i] != 0) { $msg[count($msg)] = StringUtil::SubStr(getTypename($i), 0, 2).":$typecount[$i]"; } }
|
||||
for($i=40; $i <= 43; $i++) { if($typecount[$i] != 0) { $msg[count($msg)] = StringUtil::SubStr(getTypename($i), 0, 2).":$typecount[$i]"; } }
|
||||
|
||||
$count = ceil(count($msg) / 8) * 8;
|
||||
for($i=$count; $i > 0; $i-=8) {
|
||||
|
||||
@@ -764,7 +764,7 @@ function process_55($connect, &$general) {
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$nationcount = MYDB_num_rows($result);
|
||||
|
||||
if($nationcount > 0) { $makename = _String::SubStr("$nationcount".$general['name'], 0, 6); }
|
||||
if($nationcount > 0) { $makename = StringUtil::SubStr("$nationcount".$general['name'], 0, 6); }
|
||||
else { $makename = $general['name']; }
|
||||
|
||||
if($general['level'] != 0) {
|
||||
|
||||
@@ -70,264 +70,5 @@ function tab2($str, $maxsize, $ch) {
|
||||
return $string;
|
||||
}
|
||||
|
||||
class _String {
|
||||
public static function GetStrLen($str) {
|
||||
$count = strlen($str);
|
||||
$len = 0;
|
||||
for($i=0; $i < $count; ) {
|
||||
$code = ord($str[$i]);
|
||||
|
||||
if($code >= 0xf0) {
|
||||
$len++;
|
||||
$i += 4;
|
||||
} elseif($code >= 0xe0) {
|
||||
$len++;
|
||||
$i += 3;
|
||||
} elseif($code >= 0xc2) {
|
||||
$len++;
|
||||
$i += 2;
|
||||
} else {
|
||||
$len++;
|
||||
$i += 1;
|
||||
}
|
||||
}
|
||||
return $len;
|
||||
}
|
||||
|
||||
public static function SubStr($str, $s, $l=1000) {
|
||||
$count = strlen($str);
|
||||
$startByte = 0; $isSet = 0;
|
||||
$endByte = $count;
|
||||
$len = 0;
|
||||
for($i=0; $i < $count; ) {
|
||||
$code = ord($str[$i]);
|
||||
|
||||
if($isSet == 0 && $len >= $s) {
|
||||
$startByte = $i; $isSet = 1;
|
||||
}
|
||||
if($isSet == 1 && $len-$s >= $l) {
|
||||
$endByte = $i;
|
||||
break;
|
||||
}
|
||||
|
||||
if($code >= 0xf0) {
|
||||
$len++;
|
||||
$i += 4;
|
||||
} elseif($code >= 0xe0) {
|
||||
$len++;
|
||||
$i += 3;
|
||||
} elseif($code >= 0xc2) {
|
||||
$len++;
|
||||
$i += 2;
|
||||
} else {
|
||||
$len++;
|
||||
$i += 1;
|
||||
}
|
||||
}
|
||||
$str = substr($str, $startByte, $endByte-$startByte);
|
||||
return $str;
|
||||
}
|
||||
|
||||
public static function SubStrForWidth($str, $s, $w) {
|
||||
$count = strlen($str);
|
||||
$startByte = 0; $isSet = 0;
|
||||
$endByte = $count; $last = 0;
|
||||
$len = 0;
|
||||
$width = 0;
|
||||
for($i=0; $i < $count; ) {
|
||||
$code = ord($str[$i]);
|
||||
|
||||
if($isSet == 0 && $len >= $s) {
|
||||
$startByte = $i; $isSet = 1;
|
||||
$width = 0;
|
||||
}
|
||||
if($isSet == 1 && $width == $w) {
|
||||
$endByte = $i;
|
||||
break;
|
||||
}
|
||||
if($isSet == 1 && $width > $w) {
|
||||
$endByte = $i - $last;
|
||||
break;
|
||||
}
|
||||
|
||||
if($code >= 0xf0) {
|
||||
$len++;
|
||||
$width += 2;
|
||||
$last = 4;
|
||||
$i += 4;
|
||||
} elseif($code >= 0xe0) {
|
||||
$len++;
|
||||
$width += 2;
|
||||
$last = 3;
|
||||
$i += 3;
|
||||
} elseif($code >= 0xc2) {
|
||||
$len++;
|
||||
$width += 2;
|
||||
$last = 2;
|
||||
$i += 2;
|
||||
} else {
|
||||
$len++;
|
||||
$width += 1;
|
||||
$last = 1;
|
||||
$i += 1;
|
||||
}
|
||||
}
|
||||
$str = substr($str, $startByte, $endByte-$startByte);
|
||||
return $str;
|
||||
}
|
||||
|
||||
public static function CutStrForWidth($str, $s, $w, $ch='..') {
|
||||
$isCut = 0;
|
||||
$count = strlen($str);
|
||||
$startByte = 0; $isSet = 0;
|
||||
$endByte = $count; $last = 0;
|
||||
$len = 0;
|
||||
$width = 0;
|
||||
for($i=0; $i < $count; ) {
|
||||
$code = ord($str[$i]);
|
||||
|
||||
if($isSet == 0 && $len >= $s) {
|
||||
$startByte = $i; $isSet = 1;
|
||||
$width = 0;
|
||||
}
|
||||
if($isSet == 1 && $width >= $w) {
|
||||
$endByte = $i - $last;
|
||||
$isCut = 1;
|
||||
break;
|
||||
}
|
||||
|
||||
if($code >= 0xf0) {
|
||||
$len++;
|
||||
$width += 2;
|
||||
$last = 4;
|
||||
$i += 4;
|
||||
} elseif($code >= 0xe0) {
|
||||
$len++;
|
||||
$width += 2;
|
||||
$last = 3;
|
||||
$i += 3;
|
||||
} elseif($code >= 0xc2) {
|
||||
$len++;
|
||||
$width += 2;
|
||||
$last = 2;
|
||||
$i += 2;
|
||||
} else {
|
||||
$len++;
|
||||
$width += 1;
|
||||
$last = 1;
|
||||
$i += 1;
|
||||
}
|
||||
}
|
||||
if($isCut != 0) {
|
||||
$str = substr($str, $startByte, $endByte-$startByte) . $ch;
|
||||
}
|
||||
return $str;
|
||||
}
|
||||
|
||||
//중간정렬
|
||||
public static function staticFill($str, $maxsize, $ch) {
|
||||
if(!$str){
|
||||
$str = '';
|
||||
}
|
||||
$size = strlen($str);
|
||||
|
||||
$count = ($maxsize - $size) / 2;
|
||||
|
||||
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 Fill($str, $maxsize, $ch) {
|
||||
if(!$str){
|
||||
$str = '';
|
||||
}
|
||||
$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') {
|
||||
if(!$str){
|
||||
$str = '';
|
||||
}
|
||||
$size = strlen($str);
|
||||
|
||||
$count = ($maxsize - $size);
|
||||
$string = '';
|
||||
for($i=0; $i < $count; $i++) {
|
||||
$string = $string.$ch;
|
||||
}
|
||||
$string = $string.$str;
|
||||
|
||||
return $string;
|
||||
}
|
||||
|
||||
public static function EscapeTag($str) {
|
||||
$str = htmlspecialchars($str);
|
||||
$str = str_replace("\r\n", "<br>", $str);
|
||||
$str = str_replace("\n", "<br>", $str);
|
||||
// return nl2br(htmlspecialchars($str));
|
||||
// return htmlspecialchars($str);
|
||||
return $str;
|
||||
}
|
||||
|
||||
public static function NoSpecialCharacter($str) {
|
||||
$str = str_replace(" ", "", $str);
|
||||
$str = str_replace("\"", "", $str);
|
||||
$str = str_replace("'", "", $str);
|
||||
$str = str_replace("ⓝ", "", $str);
|
||||
$str = str_replace("ⓜ", "", $str);
|
||||
$str = str_replace("ⓖ", "", $str);
|
||||
$str = str_replace("\\", "", $str);
|
||||
$str = str_replace("/", "", $str);
|
||||
$str = str_replace("`", "", $str);
|
||||
$str = str_replace("-", "", $str);
|
||||
$str = str_replace("=", "", $str);
|
||||
$str = str_replace("[", "", $str);
|
||||
$str = str_replace("]", "", $str);
|
||||
$str = str_replace(";", "", $str);
|
||||
$str = str_replace(",", "", $str);
|
||||
$str = str_replace(".", "", $str);
|
||||
$str = str_replace("~", "", $str);
|
||||
$str = str_replace("!", "", $str);
|
||||
$str = str_replace("@", "", $str);
|
||||
$str = str_replace("#", "", $str);
|
||||
$str = str_replace("$", "", $str);
|
||||
$str = str_replace("%", "", $str);
|
||||
$str = str_replace("^", "", $str);
|
||||
$str = str_replace("&", "", $str);
|
||||
$str = str_replace("*", "", $str);
|
||||
$str = str_replace("(", "", $str);
|
||||
$str = str_replace(")", "", $str);
|
||||
$str = str_replace("_", "", $str);
|
||||
$str = str_replace("+", "", $str);
|
||||
$str = str_replace("|", "", $str);
|
||||
$str = str_replace("{", "", $str);
|
||||
$str = str_replace("}", "", $str);
|
||||
$str = str_replace(":", "", $str);
|
||||
$str = str_replace("", "", $str);
|
||||
$str = str_replace("<", "", $str);
|
||||
$str = str_replace(">", "", $str);
|
||||
$str = str_replace("?", "", $str);
|
||||
$str = str_replace(" ", "", $str);
|
||||
return $str;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -76,7 +76,7 @@ function processGoldIncome($connect) {
|
||||
// 실지급율
|
||||
$ratio = $realoutcome / $originoutcome;
|
||||
}
|
||||
$adminLog[count($adminLog)] = _String::Fill2($nation['name'],12," ")." // 세금 : "._String::Fill2($income,6," ")." // 세출 : "._String::Fill2($originoutcome,6," ")." // 실제 : ".tab2($realoutcome,6," ")." // 지급율 : ".tab2(round($ratio*100,2),5," ")." % // 결과금 : ".tab2($nation['gold'],6," ");
|
||||
$adminLog[count($adminLog)] = StringUtil::Fill2($nation['name'],12," ")." // 세금 : ".StringUtil::Fill2($income,6," ")." // 세출 : ".StringUtil::Fill2($originoutcome,6," ")." // 실제 : ".tab2($realoutcome,6," ")." // 지급율 : ".tab2(round($ratio*100,2),5," ")." % // 결과금 : ".tab2($nation['gold'],6," ");
|
||||
|
||||
$query = "select no,name,nation from general where nation='{$nation['nation']}' and level>='9'";
|
||||
$coreresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
@@ -368,7 +368,7 @@ function processRiceIncome($connect) {
|
||||
// 실지급율
|
||||
$ratio = $realoutcome / $originoutcome;
|
||||
}
|
||||
$adminLog[count($adminLog)] = _String::Fill2($nation['name'],12," ")." // 세곡 : "._String::Fill2($income,6," ")." // 세출 : "._String::Fill2($originoutcome,6," ")." // 실제 : ".tab2($realoutcome,6," ")." // 지급율 : ".tab2(round($ratio*100,2),5," ")." % // 결과곡 : ".tab2($nation['rice'],6," ");
|
||||
$adminLog[count($adminLog)] = StringUtil::Fill2($nation['name'],12," ")." // 세곡 : ".StringUtil::Fill2($income,6," ")." // 세출 : ".StringUtil::Fill2($originoutcome,6," ")." // 실제 : ".tab2($realoutcome,6," ")." // 지급율 : ".tab2(round($ratio*100,2),5," ")." % // 결과곡 : ".tab2($nation['rice'],6," ");
|
||||
|
||||
$query = "select no,name,nation from general where nation='{$nation['nation']}' and level>='9'";
|
||||
$coreresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
|
||||
@@ -900,7 +900,7 @@ function fight($connect, $tnmt_type, $tnmt, $phs, $group, $g1, $g2, $type) {
|
||||
$energy1 = round($energy1); $energy2 = round($energy2);
|
||||
$damage1 = round($damage1); $damage2 = round($damage2);
|
||||
|
||||
$log[] = "<S>●</> "._String::Fill2($phase, 2, "0")."合 : <C>"._String::Fill2($energy1, 3, "0")."</> <span class='ev_highlight'>(-"._String::Fill2($damage1, 3, "0").")</span> vs <span class='ev_highlight'>(-"._String::Fill2($damage2, 3, "0").")</span> <C>"._String::Fill2($energy2, 3, "0")."</>";
|
||||
$log[] = "<S>●</> ".StringUtil::Fill2($phase, 2, "0")."合 : <C>".StringUtil::Fill2($energy1, 3, "0")."</> <span class='ev_highlight'>(-".StringUtil::Fill2($damage1, 3, "0").")</span> vs <span class='ev_highlight'>(-".StringUtil::Fill2($damage2, 3, "0").")</span> <C>".StringUtil::Fill2($energy2, 3, "0")."</>";
|
||||
|
||||
if($energy1 <= 0 && $energy2 <= 0) {
|
||||
if($type == 0) { $sel = 2; break; }
|
||||
|
||||
+3
-3
@@ -7,7 +7,7 @@ include "func.php";
|
||||
|
||||
|
||||
$name = $_POST['name'];
|
||||
$name = _String::NoSpecialCharacter($name);
|
||||
$name = StringUtil::NoSpecialCharacter($name);
|
||||
$pic = util::array_get($_POST['pic'],'');
|
||||
$character = $_POST['character'];
|
||||
|
||||
@@ -78,7 +78,7 @@ if($id_num) {
|
||||
history.go(-1)
|
||||
</script>");
|
||||
exit;
|
||||
} elseif(_String::GetStrLen($name) < 1) {
|
||||
} elseif(StringUtil::GetStrLen($name) < 1) {
|
||||
echo("<script>
|
||||
window.alert('이름이 짧습니다. 다시 가입해주세요!')
|
||||
history.go(-1)
|
||||
@@ -90,7 +90,7 @@ if($id_num) {
|
||||
history.go(-1)
|
||||
</script>");
|
||||
exit;
|
||||
} elseif(_String::GetStrLen($name) > 6) {
|
||||
} elseif(StringUtil::GetStrLen($name) > 6) {
|
||||
echo("<script>
|
||||
window.alert('이름이 유효하지 않습니다. 다시 가입해주세요!')
|
||||
history.go(-1)
|
||||
|
||||
@@ -50,7 +50,7 @@ MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$date = date('Y_m_d H:i:s');
|
||||
$date2 = substr($date, 0, 10);
|
||||
$fp = fopen("logs/_{$date2}_login.txt", "a");
|
||||
$msg = _String::Fill2($date,20," ").tab2($id,13," ")._String::Fill2($me['name'],13," ")._String::Fill2($_SESSION['p_ip'],16," ");
|
||||
$msg = StringUtil::Fill2($date,20," ").tab2($id,13," ").StringUtil::Fill2($me['name'],13," ").StringUtil::Fill2($_SESSION['p_ip'],16," ");
|
||||
fwrite($fp, $msg."\n");
|
||||
fclose($fp);
|
||||
|
||||
|
||||
+3
-3
@@ -380,7 +380,7 @@ function processWar($connect, $general, $city) {
|
||||
}
|
||||
|
||||
$render_attacker = [
|
||||
'crewtype' => _String::SubStr(getTypename($general['crewtype']), 0, 2),
|
||||
'crewtype' => StringUtil::SubStr(getTypename($general['crewtype']), 0, 2),
|
||||
'name'=> $general['name'],
|
||||
'remain_crew' => $general['crew'],
|
||||
'killed_crew' => -$mydeathnum
|
||||
@@ -1257,13 +1257,13 @@ function processWar($connect, $general, $city) {
|
||||
}
|
||||
|
||||
$render_attacker = [
|
||||
'crewtype' => _String::SubStr(getTypename($general['crewtype']), 0, 2),
|
||||
'crewtype' => StringUtil::SubStr(getTypename($general['crewtype']), 0, 2),
|
||||
'name'=> $general['name'],
|
||||
'remain_crew' => $general['crew'],
|
||||
'killed_crew' => -$mydeathnum
|
||||
];
|
||||
$render_defender = [
|
||||
'crewtype' => _String::SubStr(getTypename($oppose['crewtype']), 0, 2),
|
||||
'crewtype' => StringUtil::SubStr(getTypename($oppose['crewtype']), 0, 2),
|
||||
'name'=> $oppose['name'],
|
||||
'remain_crew' => $oppose['crew'],
|
||||
'killed_crew' => -$opdeathnum
|
||||
|
||||
Reference in New Issue
Block a user