build(WIP): printDist를 모든 코드에 적용
- 현재 summernote 미작동
This commit is contained in:
+82
-53
@@ -1,58 +1,72 @@
|
||||
<?php
|
||||
|
||||
namespace sammo;
|
||||
|
||||
function printLimitMsg($turntime) {
|
||||
function printLimitMsg($turntime)
|
||||
{
|
||||
//FIXME: template로 이동.
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>접속제한</title>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=1024" />
|
||||
<?=WebUtil::printCSS('../d_shared/common.css')?>
|
||||
<?=WebUtil::printCSS('dist_css/common.css')?>
|
||||
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/gh/orioncactus/pretendard/dist/web/static/pretendard.css" />
|
||||
</head>
|
||||
<body>
|
||||
<font size=4><b>
|
||||
접속 제한중입니다. 1턴 이내에 너무 많은 갱신을 하셨습니다. (다음 접속 가능 시각 : <?=$turntime?>)<br>
|
||||
(자신의 턴이 되면 다시 접속 가능합니다. 당신의 건강을 위해 잠시 쉬어보시는 것은 어떨까요? ^^)<br>
|
||||
</b></font>
|
||||
</body>
|
||||
</html>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<title>접속제한</title>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=1024" />
|
||||
<?= WebUtil::printCSS('../d_shared/common.css') ?>
|
||||
<?= WebUtil::printDist('ts', 'common', true) ?>
|
||||
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/gh/orioncactus/pretendard/dist/web/static/pretendard.css" />
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<font size=4><b>
|
||||
접속 제한중입니다. 1턴 이내에 너무 많은 갱신을 하셨습니다. (다음 접속 가능 시각 : <?= $turntime ?>)<br>
|
||||
(자신의 턴이 되면 다시 접속 가능합니다. 당신의 건강을 위해 잠시 쉬어보시는 것은 어떨까요? ^^)<br>
|
||||
</b></font>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
<?php
|
||||
}
|
||||
|
||||
|
||||
function bar($per, $h=7) {
|
||||
if($h == 7) { $bd = 0; $h = 7; $h2 = 5; }
|
||||
else { $bd = 1; $h = 12; $h2 = 8; }
|
||||
function bar($per, $h = 7)
|
||||
{
|
||||
if ($h == 7) {
|
||||
$bd = 0;
|
||||
$h = 7;
|
||||
$h2 = 5;
|
||||
} else {
|
||||
$bd = 1;
|
||||
$h = 12;
|
||||
$h2 = 8;
|
||||
}
|
||||
|
||||
$per = round($per, 1);
|
||||
|
||||
$str = "<div class='bar_out' style='height:{$h}px;'>
|
||||
<div class='bar_in' style='background:url(".ServConfig::$gameImagePath."/pr{$h2}.gif)'></div>
|
||||
<div style='width:{$per}%;background:url(".ServConfig::$gameImagePath."/pb{$h2}.gif)'></div>
|
||||
<div class='bar_in' style='background:url(" . ServConfig::$gameImagePath . "/pr{$h2}.gif)'></div>
|
||||
<div style='width:{$per}%;background:url(" . ServConfig::$gameImagePath . "/pb{$h2}.gif)'></div>
|
||||
</div>";
|
||||
return $str;
|
||||
}
|
||||
|
||||
|
||||
function optionsForCities(callable $infoCall=null) {
|
||||
function optionsForCities(callable $infoCall = null)
|
||||
{
|
||||
|
||||
if(!$infoCall){
|
||||
return join('', array_map(function($city){
|
||||
if (!$infoCall) {
|
||||
return join('', array_map(function ($city) {
|
||||
return "<option value='{$city->id}'>{$city->name}</option>";
|
||||
}, CityConst::all()));
|
||||
}
|
||||
|
||||
$infoList = [];
|
||||
$noInfoList = [];
|
||||
foreach(CityConst::all() as $city){
|
||||
foreach (CityConst::all() as $city) {
|
||||
$info = $infoCall($city);
|
||||
if(!$info){
|
||||
if (!$info) {
|
||||
$noInfoList[] = "<option value='{$city->id}'>{$city->name}</option>";
|
||||
continue;
|
||||
}
|
||||
@@ -62,7 +76,8 @@ function optionsForCities(callable $infoCall=null) {
|
||||
return join('', array_merge($infoList, $noInfoList));
|
||||
}
|
||||
|
||||
function Submit($url, $msg="", $msg2="") {
|
||||
function Submit($url, $msg = "", $msg2 = "")
|
||||
{
|
||||
echo "a"; // 파폭 버그 때문
|
||||
echo "
|
||||
<form method=post name=f1 action='{$url}'>
|
||||
@@ -74,49 +89,62 @@ function Submit($url, $msg="", $msg2="") {
|
||||
}
|
||||
|
||||
|
||||
function GetNationColors() {
|
||||
$colors = array("#FF0000", "#800000", "#A0522D", "#FF6347", "#FFA500", "#FFDAB9", "#FFD700", "#FFFF00",
|
||||
function GetNationColors()
|
||||
{
|
||||
$colors = array(
|
||||
"#FF0000", "#800000", "#A0522D", "#FF6347", "#FFA500", "#FFDAB9", "#FFD700", "#FFFF00",
|
||||
"#7CFC00", "#00FF00", "#808000", "#008000", "#2E8B57", "#008080", "#20B2AA", "#6495ED", "#7FFFD4",
|
||||
"#AFEEEE", "#87CEEB", "#00FFFF", "#00BFFF", "#0000FF", "#000080", "#483D8B", "#7B68EE", "#BA55D3",
|
||||
"#800080", "#FF00FF", "#FFC0CB", "#F5F5DC", "#E0FFFF", "#FFFFFF", "#A9A9A9");
|
||||
"#800080", "#FF00FF", "#FFC0CB", "#F5F5DC", "#E0FFFF", "#FFFFFF", "#A9A9A9"
|
||||
);
|
||||
return $colors;
|
||||
}
|
||||
|
||||
|
||||
function backButton() {
|
||||
function backButton()
|
||||
{
|
||||
return "
|
||||
<input type=button value='돌아가기' onclick=location.replace('./')><br>
|
||||
";
|
||||
}
|
||||
|
||||
function CoreBackButton() {
|
||||
function CoreBackButton()
|
||||
{
|
||||
return "
|
||||
<input type=button value='돌아가기' onclick=location.replace('b_chiefcenter.php')><br>
|
||||
";
|
||||
}
|
||||
|
||||
function closeButton() {
|
||||
function closeButton()
|
||||
{
|
||||
return "
|
||||
<input type=button value='창 닫기' onclick=window.close()><br>
|
||||
";
|
||||
}
|
||||
|
||||
|
||||
function printCitiesBasedOnDistance(int $cityNo, int $maxDistance=1):string {
|
||||
function printCitiesBasedOnDistance(int $cityNo, int $maxDistance = 1): string
|
||||
{
|
||||
$distanceList = searchDistance($cityNo, $maxDistance, true);
|
||||
$result = [];
|
||||
|
||||
for($dist = 1; $dist <= $maxDistance; $dist++){
|
||||
$cityList = array_map(function($cityID){
|
||||
for ($dist = 1; $dist <= $maxDistance; $dist++) {
|
||||
$cityList = array_map(function ($cityID) {
|
||||
return CityConst::byID($cityID)->name;
|
||||
}, Util::array_get($distanceList[$dist], []));
|
||||
|
||||
$cityStr = join(', ', $cityList);
|
||||
|
||||
switch($dist) {
|
||||
case 1: $color = "magenta"; break;
|
||||
case 2: $color = "orange"; break;
|
||||
default: $color = "yellow"; break;
|
||||
switch ($dist) {
|
||||
case 1:
|
||||
$color = "magenta";
|
||||
break;
|
||||
case 2:
|
||||
$color = "orange";
|
||||
break;
|
||||
default:
|
||||
$color = "yellow";
|
||||
break;
|
||||
}
|
||||
|
||||
$result[] = "{$dist}칸 떨어진 도시 : <span style='color:{$color};font-weight:bold;'>{$cityStr}</span>";
|
||||
@@ -125,7 +153,8 @@ function printCitiesBasedOnDistance(int $cityNo, int $maxDistance=1):string {
|
||||
}
|
||||
|
||||
|
||||
function info($type=0) {
|
||||
function info($type = 0)
|
||||
{
|
||||
$db = DB::db();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
|
||||
@@ -136,14 +165,14 @@ function info($type=0) {
|
||||
$gencount = $db->queryFirstField('SELECT count(no) FROM general WHERE npc < 2');
|
||||
$npccount = $db->queryFirstField('SELECT count(no) FROM general WHERE npc >= 2');
|
||||
|
||||
switch($type) {
|
||||
case 0:
|
||||
return "현재 : {$admin['year']}年 {$admin['month']}月 (<font color=cyan>$termtype</font> 서버)<br> 등록 장수 : 유저 {$gencount} / {$admin['maxgeneral']} 명 + <font color=cyan>NPC {$npccount} 명</font>";
|
||||
case 1:
|
||||
return "현재 : {$admin['year']}年 {$admin['month']}月 (<font color=cyan>$termtype</font> 서버) 등록 장수 : 유저 {$gencount} / {$admin['maxgeneral']} 명 + <font color=cyan>NPC {$npccount} 명</font>";
|
||||
case 2:
|
||||
return "현재 : {$admin['year']}年 {$admin['month']}月 (<font color=cyan>$termtype</font> 서버)";
|
||||
case 3:
|
||||
return "등록 장수 : 유저 {$gencount} / {$admin['maxgeneral']} 명 + <font color=cyan>NPC {$npccount} 명</font>";
|
||||
switch ($type) {
|
||||
case 0:
|
||||
return "현재 : {$admin['year']}年 {$admin['month']}月 (<font color=cyan>$termtype</font> 서버)<br> 등록 장수 : 유저 {$gencount} / {$admin['maxgeneral']} 명 + <font color=cyan>NPC {$npccount} 명</font>";
|
||||
case 1:
|
||||
return "현재 : {$admin['year']}年 {$admin['month']}月 (<font color=cyan>$termtype</font> 서버) 등록 장수 : 유저 {$gencount} / {$admin['maxgeneral']} 명 + <font color=cyan>NPC {$npccount} 명</font>";
|
||||
case 2:
|
||||
return "현재 : {$admin['year']}年 {$admin['month']}月 (<font color=cyan>$termtype</font> 서버)";
|
||||
case 3:
|
||||
return "등록 장수 : 유저 {$gencount} / {$admin['maxgeneral']} 명 + <font color=cyan>NPC {$npccount} 명</font>";
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user