갠메를 이용하는 레거시 코드 제거

This commit is contained in:
2018-03-01 20:33:40 +09:00
parent a72452454c
commit c48cf824eb
5 changed files with 42 additions and 319 deletions
-134
View File
@@ -265,140 +265,6 @@ function getMailboxList(){
//Legacy
function genList($connect) {
$query = "select no,nation,level,msgindex,userlevel from general where owner='{$_SESSION['noMember']}'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$me = MYDB_fetch_array($result);
$you = [];
$query = "select msg{$me['msgindex']}_who as reply,msg{$me['msgindex']}_type as type from general where owner='{$_SESSION['noMember']}'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$reply = MYDB_fetch_array($result);
if($reply['type'] % 100 == 9) {
$reply['reply'] %= 10000;
$query = "select no,name from general where no={$reply['reply']}";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$you = MYDB_fetch_array($result);
} elseif($reply['type'] % 100 == 10) {
$reply['reply'] = floor($reply['reply']/10000);
$query = "select no,name from general where no={$reply['reply']}";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$you = MYDB_fetch_array($result);
}
$nation = getNationStaticInfo($me['nation']);
echo "
<select name=genlist size=1 style=color:white;background-color:black;font-size:13>
<optgroup label='즐겨찾기'>";
if($me['nation'] != 0) {
echo "
<option selected style=color:".newColor($nation['color']).";background-color:{$nation['color']} value="; echo $nation['nation']+9000; echo ">【 아국 메세지 】</option>";
} else {
echo "
<option selected style=color:".newColor($nation['color']).";background-color:{$nation['color']} value="; echo 9000; echo ">【 재야 】</option>";
}
echo "
<option value=9999>【 전체&nbsp;&nbsp;&nbsp;메세지 】</option>";
if($you) {
echo "
<option value={$you['no']}>{$you['name']}</option>";
}
echo "
<option value=1>운영자</option>";
if($me['level'] >= 5 || $me['userlevel'] >= 5) {
echo "
</optgroup>
<optgroup label='국가메세지'>
<option value=9000>【 재야 】</option>";
foreach(getAllNationStaticInfo() as $nation) {
$nationNation[$nation['nation']] = $nation['nation'];
$nationName[$nation['nation']] = $nation['name'];
$nationColor[$nation['nation']] = $nation['color'];
echo "
<option style=color:".newColor($nation['color']).";background-color:{$nation['color']} value="; echo $nation['nation']+9000; echo ">【 {$nation['name']} 】</option>";
}
echo "
</optgroup>";
}
echo "
<optgroup label='개인메세지'>
<optgroup label='재야'>";
$query = "select no,name,npc from general where nation=0 and owner!='{$_SESSION['noMember']}' and npc<2 order by npc,binary(name)";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$gencount = MYDB_num_rows($result);
for($i=0; $i < $gencount; $i++) {
$general = MYDB_fetch_array($result);
if($general['npc'] >= 2) { $color = "cyan"; }
elseif($general['npc'] == 1) { $color = "skyblue"; }
else { $color = "white"; }
echo "
<option value={$general['no']} style=color:{$color};background-color:black;>{$general['name']}</option>";
}
echo "
</optgroup>";
$query = "select nation,name,color from nation order by name";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$count = MYDB_num_rows($result);
for($i=1; $i <= $count; $i++) {
$nation = MYDB_fetch_array($result);
echo "
<optgroup label='【{$nation['name']}】' style=color:".newColor($nation['color']).";background-color:{$nation['color']};>";
$query = "select no,name,npc,level from general where nation='{$nation['nation']}' and owner!='{$_SESSION['noMember']}' and npc<2 order by npc,binary(name)";
$genresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$gencount = MYDB_num_rows($genresult);
for($j=0; $j < $gencount; $j++) {
$general = MYDB_fetch_array($genresult);
if($general['level'] >= 12) { $general['name'] = "*{$general['name']}*"; }
if($general['npc'] >= 2) { $color = "cyan"; }
elseif($general['npc'] == 1) { $color = "skyblue"; }
else { $color = "white"; }
echo "
<option value={$general['no']} style=color:{$color};background-color:black;>{$general['name']}</option>";
}
echo "
</optgroup>";
}
echo "
</select>
";
}
function MsgFile($skin, $bg, $nation=0, $level=0) {
switch($bg) {
case 1: $bgcolor = "000055"; $count = 10; $fl = "_all_msg.txt"; break;
case 3: $bgcolor = "336600"; $count = 20; $fl = "_nation_msg{$nation}.txt"; break;
}
if(!file_exists("logs/{$fl}")){
return;
}
$fp = @fopen("logs/{$fl}", "r");
@fseek($fp, -$count*300, SEEK_END);
$file = @fread($fp, $count*300);
@fclose($fp);
$code = explode("\n",$file);
for($i=0; $i < $count; $i++) {
$msg = isset($code[count($code)-2-$i]) ? explode("|", $code[count($code)-2-$i]) : array();
$cnt = count($msg);
if(!empty($cnt)){
for($k=0; $k < $cnt; $k++) {
$msg[$k] = trim($msg[$k]);
}
}
if(!empty($msg)){
ShowMsg($skin, $bgcolor, $msg[0], $msg[7], $msg[8], $msg[1], $msg[5], $msg[2], $msg[6], $msg[4], $msg[3]);
}
}
}
// type : xx,xx(불가침기간,타입)
// who : xxxx,xxxx(발신인, 수신인)