log 파일이 없을 때는 빈 텍스트를 리턴하도록

This commit is contained in:
2018-01-20 06:00:17 +09:00
parent 3e629c5c54
commit 1848af9f09
4 changed files with 41 additions and 13 deletions
+22 -1
View File
@@ -3000,6 +3000,9 @@ function pushHistory($connect, $history) {
}
function TrickLog($count, $skin) {
if(!file_exists("logs/_tricklog.txt")){
return '';
}
$fp = @fopen("logs/_tricklog.txt", "r");
@fseek($fp, -$count*150, SEEK_END);
$file = @fread($fp, $count*150);
@@ -3011,6 +3014,9 @@ function TrickLog($count, $skin) {
}
function AllLog($count, $skin) {
if(!file_exists("logs/_alllog.txt")){
return '';
}
$fp = @fopen("logs/_alllog.txt", "r");
@fseek($fp, -$count*300, SEEK_END);
$file = @fread($fp, $count*300);
@@ -3024,6 +3030,9 @@ function AllLog($count, $skin) {
}
function AuctionLog($count, $skin) {
if(!file_exists("logs/_auctionlog.txt")){
return '';
}
$fp = @fopen("logs/_auctionlog.txt", "r");
@fseek($fp, -$count*300, SEEK_END);
$file = @fread($fp, $count*300);
@@ -3035,8 +3044,11 @@ function AuctionLog($count, $skin) {
}
function History($count, $skin) {
if(!file_exists("logs/_history.txt")){
return '';
}
$fp = @fopen("logs/_history.txt", "r");
@fseek($fp, -$count*300, SEEK_END);
@fseek($fp, -300*$count, SEEK_END); //
$file = @fread($fp, $count*300);
@fclose($fp);
$log = explode("\r\n",$file);
@@ -3048,6 +3060,9 @@ function History($count, $skin) {
}
function MyLog($no, $count, $skin) {
if(!file_exists("logs/gen{$no}.txt")){
return '';
}
$fp = @fopen("logs/gen{$no}.txt", "r");
@fseek($fp, -$count*300, SEEK_END);
$file = @fread($fp, $count*300);
@@ -3061,6 +3076,9 @@ function MyLog($no, $count, $skin) {
}
function MyBatRes($no, $count, $skin) {
if(!file_exists("logs/batres{$no}.txt")){
return '';
}
$fp = @fopen("logs/batres{$no}.txt", "r");
@fseek($fp, -$count*300, SEEK_END);
$file = @fread($fp, $count*300);
@@ -3074,6 +3092,9 @@ function MyBatRes($no, $count, $skin) {
}
function MyBatLog($no, $count, $skin) {
if(!file_exists("logs/batlog{$no}.txt")){
return '';
}
$fp = @fopen("logs/batlog{$no}.txt", "r");
@fseek($fp, -$count*300, SEEK_END);
$file = @fread($fp, $count*300);
+9 -9
View File
@@ -50,7 +50,7 @@ if(!$token) {
<head>
<title>장수생성</title>
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
<link rel=stylesheet href=stylesheet.php type=text/css>
<link rel='stylesheet' href='stylesheet.php'>
<script type="text/javascript" src=<?="../e_lib/jquery-3.2.1.min.js";?>></script>
<script type="text/javascript">
@@ -70,16 +70,16 @@ function updateToken(type) {
location.replace("index.php");
//echo 'index.php';//TODO:debug all and replace
} else {
$("#leader").text(data.leader);
$("#power").text(data.power);
$("#intel").text(data.intel);
$("#leader").val(data.leader);
$("#power").val(data.power);
$("#intel").val(data.intel);
}
},
dataType: 'json',
error: function(jqXHR, textStatus, errorThrown) {
alert(jqXHR.status+", "+jqXHR.statusText+", "+jqXHR.responseText);
//location.replace("index.php");
echo 'index.php';//TODO:debug all and replace
location.replace("index.php");
//echo 'index.php';//TODO:debug all and replace
}
});
}
@@ -203,15 +203,15 @@ if($admin['img'] >= 1 && $member['grade'] >= 1 && $member['picture'] != "") {
</tr>
<tr>
<td width=498 align=right id=bg1>통솔</td>
<td colspan=2><font id=leader><?=$abil['leader'];?></font></td>
<td colspan=2><input type="text" name="leader" id="leader" value="<?=$abil['leader'];?>"></td>
</tr>
<tr>
<td width=498 align=right id=bg1>무력</td>
<td colspan=2><font id=power><?=$abil['power'];?></font></td>
<td colspan=2><input type="text" name="power" id="power" value="<?=$abil['power'];?>"></td>
</tr>
<tr>
<td width=498 align=right id=bg1>지력</td>
<td colspan=2><font id=intel><?=$abil['intel'];?></font></td>
<td colspan=2><input type="text" name="intel" id="intel" value="<?=$abil['intel'];?>"></td>
</tr>
<tr>
<td width=498 align=right id=bg1>능력치 조정</td>
+3 -2
View File
@@ -1,16 +1,17 @@
<?php
include "lib.php";
include "func.php";
require "../e_lib/util.php";
$id = $_POST['id'];
$pw = $_POST['pw'];
$name = $_POST['name'];
$name = _String::NoSpecialCharacter($name);
$pic = $_POST['pic'];
$pic = util::array_get($_POST['pic'],'');
$character = $_POST['character'];
$pwTemp = substr($pw, 0, 32);
$mylog = [];
$connect = dbConn("sammo");
//회원 테이블에서 정보확인
+7 -1
View File
@@ -8,7 +8,11 @@ $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""
$admin = MYDB_fetch_array($result);
$tmp_id = util::array_get($_SESSION['p_id'],0);
$tmp_id = util::array_get($_SESSION['p_id'],0);
//xxx:와 이게 뭐지
//TODO:p_id 관련 스킨 세팅 확인
$query = "select no,skin,con from general where user_id='$tmp_id'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
@@ -78,6 +82,8 @@ if($me['skin'] == 0) {
$bg0 = "background-color:#ff88c4;"; $bg1 = "background-color:#cc66ff;"; $bg2 = "background-color:#f5a2ff;";
}
header("Content-type: text/css");
?>
body { color:<?=$color;?>; background-color:<?=$backcolor;?>; border-width:1; border-color:gray; <?=$back;?> }