아이콘, 게임 이미지 경로를 일괄 지정 가능하도록 변경
This commit is contained in:
+94
-60
@@ -10,11 +10,13 @@ $connect=$db->get();
|
||||
increaseRefresh("갱신정보", 2);
|
||||
|
||||
$query = "select year,month,refresh,maxrefresh,maxonline from game limit 1";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
|
||||
$game = MYDB_fetch_array($result);
|
||||
|
||||
$log = [];
|
||||
|
||||
$curonline = getOnlineNum();
|
||||
for($i=0; $i < 11; $i++) {
|
||||
for ($i=0; $i < 11; $i++) {
|
||||
$parse = explode("|", $log[count($log)-12+$i]);
|
||||
$date[$i] = trim($parse[0]);
|
||||
$year[$i] = trim($parse[1]);
|
||||
@@ -22,10 +24,18 @@ for($i=0; $i < 11; $i++) {
|
||||
$refresh[$i] = trim($parse[3]);
|
||||
$online[$i] = trim($parse[4]);
|
||||
}
|
||||
if($game['maxrefresh'] == 0) { $game['maxrefresh'] = 1; }
|
||||
if($game['maxrefresh'] < $game['refresh']) { $game['maxrefresh'] = $game['refresh']; }
|
||||
if($game['maxonline'] == 0) { $game['maxonline'] = 1; }
|
||||
if($game['maxonline'] < $curonline) { $game['maxonline'] = $curonline; }
|
||||
if ($game['maxrefresh'] == 0) {
|
||||
$game['maxrefresh'] = 1;
|
||||
}
|
||||
if ($game['maxrefresh'] < $game['refresh']) {
|
||||
$game['maxrefresh'] = $game['refresh'];
|
||||
}
|
||||
if ($game['maxonline'] == 0) {
|
||||
$game['maxonline'] = 1;
|
||||
}
|
||||
if ($game['maxonline'] < $curonline) {
|
||||
$game['maxonline'] = $curonline;
|
||||
}
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
@@ -45,97 +55,119 @@ if($game['maxonline'] < $curonline) { $game['maxonline'] = $curonline; }
|
||||
<table align=center border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; id=bg0>
|
||||
<tr><td colspan=4 align=center id=bg2><font size=5>접 속 량</font></td></tr>
|
||||
<?php
|
||||
for($i=0; $i < 11; $i++) {
|
||||
for ($i=0; $i < 11; $i++) {
|
||||
$w = round($refresh[$i] / $game['maxrefresh'] * 100, 1);
|
||||
if($w >= 100) { $w -= 0.1; }
|
||||
if($refresh[$i] < 10 && $w < 3) { $w = 3; }
|
||||
elseif($refresh[$i] < 100 && $w < 6) { $w = 6; }
|
||||
elseif($refresh[$i] < 1000 && $w < 9) { $w = 9; }
|
||||
if ($w >= 100) {
|
||||
$w -= 0.1;
|
||||
}
|
||||
if ($refresh[$i] < 10 && $w < 3) {
|
||||
$w = 3;
|
||||
} elseif ($refresh[$i] < 100 && $w < 6) {
|
||||
$w = 6;
|
||||
} elseif ($refresh[$i] < 1000 && $w < 9) {
|
||||
$w = 9;
|
||||
}
|
||||
$w2 = round(100 - $w, 1);
|
||||
$color = getColor($w);
|
||||
$dt = substr($date[$i], 11, 5);
|
||||
echo "
|
||||
$color = getTrafficColor($w);
|
||||
$dt = substr($date[$i], 11, 5); ?>
|
||||
<tr height=30>
|
||||
<td width=100 align=center>{$year[$i]}년 {$month[$i]}월</td>
|
||||
<td width=60 align=center id=bg2>{$dt}</td>
|
||||
<td width=100 align=center><?=$year[$i]?>년 <?=$month[$i]?>월</td>
|
||||
<td width=60 align=center id=bg2><?=$dt?></td>
|
||||
<td width=2 align=center id=bg1></td>
|
||||
<td width=320 align=center>
|
||||
<table align=center width=100% height=30 border=0 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; id=bg0>
|
||||
<tr>
|
||||
<td width={$w}% bgcolor={$color} align=right>{$refresh[$i]} </td>
|
||||
<td width={$w2}% id=bg0><font size=1> </font></td>
|
||||
<td width=<?=$w?>% bgcolor=<?=$color?> align=right><?=$refresh[$i]?> </td>
|
||||
<td width=<?=$w2?>% id=bg0><font size=1> </font></td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
";
|
||||
<?php
|
||||
}
|
||||
$w = round($game['refresh'] / $game['maxrefresh'] * 100, 1);
|
||||
if($w >= 100) { $w -= 0.1; }
|
||||
if($game['refresh'] < 10 && $w < 3) { $w = 3; }
|
||||
elseif($game['refresh'] < 100 && $w < 6) { $w = 6; }
|
||||
elseif($game['refresh'] < 1000 && $w < 9) { $w = 9; }
|
||||
if ($w >= 100) {
|
||||
$w -= 0.1;
|
||||
}
|
||||
if ($game['refresh'] < 10 && $w < 3) {
|
||||
$w = 3;
|
||||
} elseif ($game['refresh'] < 100 && $w < 6) {
|
||||
$w = 6;
|
||||
} elseif ($game['refresh'] < 1000 && $w < 9) {
|
||||
$w = 9;
|
||||
}
|
||||
$w2 = round(100 - $w, 1);
|
||||
$color = getColor($w);
|
||||
$color = getTrafficColor($w);
|
||||
$dt = date('H:i');
|
||||
echo "
|
||||
?>
|
||||
<tr height=30>
|
||||
<td width=100 align=center>{$game['year']}년 {$game['month']}월</td>
|
||||
<td width=60 align=center id=bg2>{$dt}</td>
|
||||
<td width=100 align=center><?=$game['year']?>년 <?=$game['month']?>월</td>
|
||||
<td width=60 align=center id=bg2><?=$dt?></td>
|
||||
<td width=2 align=center id=bg1></td>
|
||||
<td width=320 align=center>
|
||||
<table align=center width=100% height=30 border=0 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; id=bg0>
|
||||
<tr>
|
||||
<td width={$w}% bgcolor={$color} align=right>{$game['refresh']} </td>
|
||||
<td width={$w2}% id=bg0><font size=1> </font></td>
|
||||
<td width=<?=$w?>% bgcolor=<?=$color?> align=right><?=$game['refresh']?> </td>
|
||||
<td width=<?=$w2?>% id=bg0><font size=1> </font></td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
<tr><td colspan=4 height=5 align=center id=bg1></td></tr>
|
||||
<tr>
|
||||
<td colspan=4 height=30 align=center id=bg0>최고기록: {$game['maxrefresh']}</td>
|
||||
<td colspan=4 height=30 align=center id=bg0>최고기록: <?=$game['maxrefresh']?></td>
|
||||
</tr>
|
||||
";
|
||||
?>
|
||||
|
||||
|
||||
</table>
|
||||
</td>
|
||||
<td align=right>
|
||||
<table align=center border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; id=bg0>
|
||||
<tr><td colspan=4 align=center id=bg2><font size=5>접 속 자</font></td></tr>
|
||||
<?php
|
||||
for($i=0; $i < 11; $i++) {
|
||||
for ($i=0; $i < 11; $i++) {
|
||||
$w = round($online[$i] / $game['maxonline'] * 100, 1);
|
||||
if($w >= 100) { $w -= 0.1; }
|
||||
if($online[$i] < 10 && $w < 3) { $w = 3; }
|
||||
elseif($online[$i] < 100 && $w < 6) { $w = 6; }
|
||||
elseif($online[$i] < 1000 && $w < 9) { $w = 9; }
|
||||
if ($w >= 100) {
|
||||
$w -= 0.1;
|
||||
}
|
||||
if ($online[$i] < 10 && $w < 3) {
|
||||
$w = 3;
|
||||
} elseif ($online[$i] < 100 && $w < 6) {
|
||||
$w = 6;
|
||||
} elseif ($online[$i] < 1000 && $w < 9) {
|
||||
$w = 9;
|
||||
}
|
||||
$w2 = round(100 - $w, 1);
|
||||
$color = getColor($w);
|
||||
$dt = substr($date[$i], 11, 5);
|
||||
echo "
|
||||
$color = getTrafficColor($w);
|
||||
$dt = substr($date[$i], 11, 5); ?>
|
||||
<tr height=30>
|
||||
<td width=100 align=center>{$year[$i]}년 {$month[$i]}월</td>
|
||||
<td width=60 align=center id=bg2>{$dt}</td>
|
||||
<td width=100 align=center><?=$year[$i]?>년 <?=$month[$i]?>월</td>
|
||||
<td width=60 align=center id=bg2><?=$dt?></td>
|
||||
<td width=2 align=center id=bg1></td>
|
||||
<td width=320 align=center>
|
||||
<table align=center width=100% height=30 border=0 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; id=bg0>
|
||||
<tr>
|
||||
<td width={$w}% bgcolor={$color} align=right>{$online[$i]} </td>
|
||||
<td width={$w2}% id=bg0><font size=1> </font></td>
|
||||
<td width=<?=$w?>% bgcolor=<?=$color?> align=right><?=$online[$i]?> </td>
|
||||
<td width=<?=$w2?>% id=bg0><font size=1> </font></td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
";
|
||||
<?php
|
||||
}
|
||||
$w = round($curonline / $game['maxonline'] * 100, 1);
|
||||
if($w >= 100) { $w -= 0.1; }
|
||||
if($curonline < 10 && $w < 3) { $w = 3; }
|
||||
elseif($curonline < 100 && $w < 6) { $w = 6; }
|
||||
elseif($curonline < 1000 && $w < 9) { $w = 9; }
|
||||
if ($w >= 100) {
|
||||
$w -= 0.1;
|
||||
}
|
||||
if ($curonline < 10 && $w < 3) {
|
||||
$w = 3;
|
||||
} elseif ($curonline < 100 && $w < 6) {
|
||||
$w = 6;
|
||||
} elseif ($curonline < 1000 && $w < 9) {
|
||||
$w = 9;
|
||||
}
|
||||
$w2 = round(100 - $w, 1);
|
||||
$color = getColor($w);
|
||||
$color = getTrafficColor($w);
|
||||
$dt = date('H:i');
|
||||
echo "
|
||||
<tr height=30>
|
||||
@@ -165,14 +197,14 @@ echo "
|
||||
<tr><td colspan=3 align=center id=bg2><font size=5>주 의 대 상 자 (순간과도갱신)</font></td></tr>
|
||||
<?php
|
||||
$query = "select sum(refresh) as refresh,sum(connect) as connect from general";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
|
||||
$user = MYDB_fetch_array($result);
|
||||
$user['connect'] = round($user['connect'], 1);
|
||||
$maxrefresh = $user['refresh'];
|
||||
|
||||
$w = round($maxrefresh / $maxrefresh * 100, 1);
|
||||
$w2 = round(100 - $w, 1);
|
||||
$color = getColor($w);
|
||||
$color = getTrafficColor($w);
|
||||
echo "
|
||||
<tr id=bg2>
|
||||
<td width=98 align=center>주의대상자</td>
|
||||
@@ -194,14 +226,14 @@ echo "
|
||||
";
|
||||
|
||||
$query = "select name,refresh,connect from general order by refresh desc limit 0,5";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
|
||||
$count = MYDB_num_rows($result);
|
||||
for($i=0; $i < $count; $i++) {
|
||||
for ($i=0; $i < $count; $i++) {
|
||||
$user = MYDB_fetch_array($result);
|
||||
|
||||
$w = round($user['refresh'] / $maxrefresh * 100, 1);
|
||||
$w2 = round(100 - $w, 1);
|
||||
$color = getColor($w);
|
||||
$color = getTrafficColor($w);
|
||||
echo "
|
||||
<tr>
|
||||
<td width=98 align=center>{$user['name']}</td>
|
||||
@@ -229,26 +261,28 @@ for($i=0; $i < $count; $i++) {
|
||||
</html>
|
||||
|
||||
<?php
|
||||
function getColor($per) {
|
||||
function getTrafficColor($per)
|
||||
{
|
||||
$r = getHex($per);
|
||||
$b = getHex(100 - $per);
|
||||
$color = $r . "00" . $b;
|
||||
return $color;
|
||||
}
|
||||
|
||||
function getHex($dec) {
|
||||
function getHex($dec)
|
||||
{
|
||||
$hex = floor($dec * 255 / 100);
|
||||
$code = getHexCode(floor($hex / 16));
|
||||
$code .= getHexCode($hex % 16);
|
||||
return $code;
|
||||
}
|
||||
|
||||
function getHexCode($hex) {
|
||||
switch($hex) {
|
||||
function getHexCode($hex)
|
||||
{
|
||||
switch ($hex) {
|
||||
case 0: return "0"; case 1: return "1"; case 2: return "2"; case 3: return "3";
|
||||
case 4: return "4"; case 5: return "5"; case 6: return "6"; case 7: return "7";
|
||||
case 8: return "8"; case 9: return "9"; case 10: return "A"; case 11: return "B";
|
||||
case 12: return "C"; case 13: return "D"; case 14: return "E"; case 15: return "F";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user