string 내의 $ 호출들 일괄 변환.

This commit is contained in:
2018-01-16 03:56:50 +09:00
parent c73a3bcf95
commit 28eaf7b0d7
119 changed files with 6485 additions and 6479 deletions
+43 -43
View File
@@ -10,18 +10,18 @@ $query = "select conlimit from game where no=1";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$admin = MYDB_fetch_array($result);
$query = "select skin,no,nation,level,userlevel,con,turntime,belong from general where user_id='$_SESSION[p_id]'";
$query = "select skin,no,nation,level,userlevel,con,turntime,belong from general where user_id='$_SESSION['p_id']'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$me = MYDB_fetch_array($result);
$query = "select level,secretlimit from nation where nation='$me[nation]'";
$query = "select level,secretlimit from nation where nation='$me['nation']'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$nation = MYDB_fetch_array($result);
$con = checkLimit($me[userlevel], $me[con], $admin[conlimit]);
if($con >= 2) { printLimitMsg($me[turntime]); exit(); }
$con = checkLimit($me['userlevel'], $me['con'], $admin['conlimit']);
if($con >= 2) { printLimitMsg($me['turntime']); exit(); }
if($me[level] == 0 || ($me[level] == 1 && $me[belong] < $nation[secretlimit])) {
if($me['level'] == 0 || ($me['level'] == 1 && $me['belong'] < $nation['secretlimit'])) {
echo "수뇌부가 아니거나 사관년도가 부족합니다.";
exit();
}
@@ -31,7 +31,7 @@ if($type == 0) {
}
$sel[$type] = "selected";
if($me[skin] < 1) {
if($me['skin'] < 1) {
$tempColor = $_basecolor; $tempColor2 = $_basecolor2; $tempColor3 = $_basecolor3; $tempColor4 = $_basecolor4;
$_basecolor = "000000"; $_basecolor2 = "000000"; $_basecolor3 = "000000"; $_basecolor4 = "000000";
}
@@ -63,26 +63,26 @@ if($me[skin] < 1) {
</td></tr>
</table>
<?php
$query = "select troop,name from troop where nation='$me[nation]'";
$query = "select troop,name from troop where nation='$me['nation']'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$troopCount = MYDB_num_rows($result);
for($i=0; $i < $troopCount; $i++) {
$troop = MYDB_fetch_array($result);
$troopName[$troop[troop]] = $troop[name];
$troopName[$troop['troop']] = $troop['name'];
}
$cityname = CityNameArray();
switch($type) {
case 1: $query = "select npc,mode,no,level,troop,city,injury,leader,power,intel,experience,name,gold,rice,crewtype,crew,train,atmos,killturn,turntime,term,turn0,turn1,turn2,turn3,turn4 from general where nation='$me[nation]' order by gold desc"; break;
case 2: $query = "select npc,mode,no,level,troop,city,injury,leader,power,intel,experience,name,gold,rice,crewtype,crew,train,atmos,killturn,turntime,term,turn0,turn1,turn2,turn3,turn4 from general where nation='$me[nation]' order by rice desc"; break;
case 3: $query = "select npc,mode,no,level,troop,city,injury,leader,power,intel,experience,name,gold,rice,crewtype,crew,train,atmos,killturn,turntime,term,turn0,turn1,turn2,turn3,turn4 from general where nation='$me[nation]' order by city"; break;
case 4: $query = "select npc,mode,no,level,troop,city,injury,leader,power,intel,experience,name,gold,rice,crewtype,crew,train,atmos,killturn,turntime,term,turn0,turn1,turn2,turn3,turn4 from general where nation='$me[nation]' order by crewtype desc"; break;
case 5: $query = "select npc,mode,no,level,troop,city,injury,leader,power,intel,experience,name,gold,rice,crewtype,crew,train,atmos,killturn,turntime,term,turn0,turn1,turn2,turn3,turn4 from general where nation='$me[nation]' order by crew desc"; break;
case 6: $query = "select npc,mode,no,level,troop,city,injury,leader,power,intel,experience,name,gold,rice,crewtype,crew,train,atmos,killturn,turntime,term,turn0,turn1,turn2,turn3,turn4 from general where nation='$me[nation]' order by killturn"; break;
case 7: $query = "select npc,mode,no,level,troop,city,injury,leader,power,intel,experience,name,gold,rice,crewtype,crew,train,atmos,killturn,turntime,term,turn0,turn1,turn2,turn3,turn4 from general where nation='$me[nation]' order by turntime"; break;
case 8: $query = "select npc,mode,no,level,troop,city,injury,leader,power,intel,experience,name,gold,rice,crewtype,crew,train,atmos,killturn,turntime,term,turn0,turn1,turn2,turn3,turn4 from general where nation='$me[nation]' order by troop desc"; break;
case 1: $query = "select npc,mode,no,level,troop,city,injury,leader,power,intel,experience,name,gold,rice,crewtype,crew,train,atmos,killturn,turntime,term,turn0,turn1,turn2,turn3,turn4 from general where nation='$me['nation']' order by gold desc"; break;
case 2: $query = "select npc,mode,no,level,troop,city,injury,leader,power,intel,experience,name,gold,rice,crewtype,crew,train,atmos,killturn,turntime,term,turn0,turn1,turn2,turn3,turn4 from general where nation='$me['nation']' order by rice desc"; break;
case 3: $query = "select npc,mode,no,level,troop,city,injury,leader,power,intel,experience,name,gold,rice,crewtype,crew,train,atmos,killturn,turntime,term,turn0,turn1,turn2,turn3,turn4 from general where nation='$me['nation']' order by city"; break;
case 4: $query = "select npc,mode,no,level,troop,city,injury,leader,power,intel,experience,name,gold,rice,crewtype,crew,train,atmos,killturn,turntime,term,turn0,turn1,turn2,turn3,turn4 from general where nation='$me['nation']' order by crewtype desc"; break;
case 5: $query = "select npc,mode,no,level,troop,city,injury,leader,power,intel,experience,name,gold,rice,crewtype,crew,train,atmos,killturn,turntime,term,turn0,turn1,turn2,turn3,turn4 from general where nation='$me['nation']' order by crew desc"; break;
case 6: $query = "select npc,mode,no,level,troop,city,injury,leader,power,intel,experience,name,gold,rice,crewtype,crew,train,atmos,killturn,turntime,term,turn0,turn1,turn2,turn3,turn4 from general where nation='$me['nation']' order by killturn"; break;
case 7: $query = "select npc,mode,no,level,troop,city,injury,leader,power,intel,experience,name,gold,rice,crewtype,crew,train,atmos,killturn,turntime,term,turn0,turn1,turn2,turn3,turn4 from general where nation='$me['nation']' order by turntime"; break;
case 8: $query = "select npc,mode,no,level,troop,city,injury,leader,power,intel,experience,name,gold,rice,crewtype,crew,train,atmos,killturn,turntime,term,turn0,turn1,turn2,turn3,turn4 from general where nation='$me['nation']' order by troop desc"; break;
}
$genresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$gencount = MYDB_num_rows($genresult);
@@ -107,13 +107,13 @@ echo"
</tr>";
for($j=0; $j < $gencount; $j++) {
$general = MYDB_fetch_array($genresult);
$city = $cityname[$general[city]];
$troop = $troopName[$general[troop]] == "" ? "-" : $troopName[$general[troop]];
$city = $cityname[$general['city']];
$troop = $troopName[$general['troop']] == "" ? "-" : $troopName[$general['troop']];
if($general[level] == 12) {
$lbonus = $nation[level] * 2;
} elseif($general[level] >= 5) {
$lbonus = $nation[level];
if($general['level'] == 12) {
$lbonus = $nation['level'] * 2;
} elseif($general['level'] >= 5) {
$lbonus = $nation['level'];
} else {
$lbonus = 0;
}
@@ -123,24 +123,24 @@ for($j=0; $j < $gencount; $j++) {
$lbonus = "";
}
if($general[injury] > 0) {
$leader = floor($general[leader] * (100 - $general[injury])/100);
$power = floor($general[power] * (100 - $general[injury])/100);
$intel = floor($general[intel] * (100 - $general[injury])/100);
if($general['injury'] > 0) {
$leader = floor($general['leader'] * (100 - $general['injury'])/100);
$power = floor($general['power'] * (100 - $general['injury'])/100);
$intel = floor($general['intel'] * (100 - $general['injury'])/100);
$leader = "<font color=red>{$leader}</font>{$lbonus}";
$power = "<font color=red>{$power}</font>";
$intel = "<font color=red>{$intel}</font>";
} else {
$leader = "{$general[leader]}{$lbonus}";
$power = "{$general[power]}";
$intel = "{$general[intel]}";
$leader = "{$general['leader']}{$lbonus}";
$power = "{$general['power']}";
$intel = "{$general['intel']}";
}
if($general[npc] >= 2) { $name = "<font color=cyan>$general[name]</font>"; }
elseif($general[npc] == 1) { $name = "<font color=skyblue>$general[name]</font>"; }
else { $name = "$general[name]"; }
if($general['npc'] >= 2) { $name = "<font color=cyan>$general['name']</font>"; }
elseif($general['npc'] == 1) { $name = "<font color=skyblue>$general['name']</font>"; }
else { $name = "$general['name']"; }
switch($general[mode]) {
switch($general['mode']) {
case 0: $mode = "×"; break;
case 1: $mode = "○"; break;
case 2: $mode = "◎"; break;
@@ -148,18 +148,18 @@ for($j=0; $j < $gencount; $j++) {
echo "
<tr>
<td align=center>$name<br>Lv ".getExpLevel($general[experience])."</td>
<td align=center>$name<br>Lv ".getExpLevel($general['experience'])."</td>
<td align=center>{$leader}∥{$power}∥{$intel}</td>
<td align=center>$troop</td>
<td align=center>$general[gold]</td>
<td align=center>$general[rice]</td>
<td align=center>$general['gold']</td>
<td align=center>$general['rice']</td>
<td align=center>$city</td>
<td align=center>$mode</td>
<td align=center>".getTypename($general[crewtype])."</td>
<td align=center>$general[crew]</td>
<td align=center>$general[train]</td>
<td align=center>$general[atmos]</td>";
if($general[npc] >= 2) {
<td align=center>".getTypename($general['crewtype'])."</td>
<td align=center>$general['crew']</td>
<td align=center>$general['train']</td>
<td align=center>$general['atmos']</td>";
if($general['npc'] >= 2) {
echo "
<td>
<font size=3>NPC 장수";
@@ -179,8 +179,8 @@ for($j=0; $j < $gencount; $j++) {
echo "
</font>
</td>
<td align=center>$general[killturn]</td>
<td align=center>".substr($general[turntime],14,5)."</td>
<td align=center>$general['killturn']</td>
<td align=center>".substr($general['turntime'],14,5)."</td>
</tr>";
}
echo "