Commit 3d9f048d authored by Nemo Ma's avatar Nemo Ma Committed by GitHub

Merge pull request #105 from hikawiier/waaagh

kill newsinfo.php
parents 8bd8c01d 5b57c92c
......@@ -206,12 +206,11 @@ function compatible_json_encode($data){ //自动选择使用内置函数或者
function addnews($t = 0, $n = '',$a='',$b='',$c = '', $d = '', $e = '') {
global $now,$db,$tablepre,$gtablepre;
$t = $t ? $t : $now;
$newsfile = GAME_ROOT.'./gamedata/newsinfo.php';
touch($newsfile);
/*$newsfile = GAME_ROOT.'./gamedata/newsinfo.php';
touch($newsfile);*/
if(is_array($a)){
$a=implode('_',$a);
}
if(strpos($n,'death11') === 0 || strpos($n,'death32') === 0) {
$result = $db->query("SELECT lastword FROM {$gtablepre}users WHERE username = '$a'");
$e = $lastword = $db->result($result, 0);
......
......@@ -65,7 +65,7 @@ function nparse_news($start = 0, $range = 0 ){//$type = '') {
$newsinfo .= "<li>{$hour}{$min}{$sec}秒,增加禁区:";
$alist = explode('_',$a);
foreach($alist as $ar) {
$newsinfo .= "$plsinfo[$ar] ";
$newsinfo .= "{$plsinfo[$ar]} ";
}
$newsinfo .= "<span class=\"yellow\">【天气:{$wthinfo[$b]}】</span><br>\n";
} elseif($news == 'hack') {
......
......@@ -17,13 +17,13 @@ function rs_game($mode = 0) {
$db->queries($sql);
//重设游戏进行状况的时间
if($fp = fopen("{$dir}newsinfo.php", 'wb')) {
/*if($fp = fopen("{$dir}newsinfo.php", 'wb')) {
global $checkstr;
fwrite($fp, $checkstr);
fclose($fp);
} else {
gexit('Can not write to cache files, please check directory ./gamedata/ and ./gamedata/cache/ .', __file__, __line__);
}
}*/
//清空战斗信息
global $hdamage,$hplayer,$noisetime,$noisepls,$noiseid,$noiseid2,$noisemode,$starttime,$gamevars;
......@@ -272,6 +272,7 @@ function rs_game($mode = 0) {
$qry = '';
foreach($shoplist as $lst){
if(!empty($lst) && strpos($lst,',')!==false){
if(empty($lst[8])) $lst[8] = '';
list($kind,$num,$price,$area,$item,$itmk,$itme,$itms,$itmsk)=explode(',',$lst);
if($kind != 0){
$qry .= "('$kind','$num','$price','$area','$item','$itmk','$itme','$itms','$itmsk'),";
......
......@@ -9,6 +9,7 @@ require './include/game.func.php';
require_once GAME_ROOT.'./include/news.func.php';
include_once GAME_ROOT.'./include/system.func.php';
/*
$newsfile = GAME_ROOT.'./gamedata/newsinfo.php';
$newshtm = GAME_ROOT.TPLDIR.'/newsinfo.htm';
$lnewshtm = GAME_ROOT.TPLDIR.'/lastnews.htm';
......@@ -16,12 +17,14 @@ $lnewshtm = GAME_ROOT.TPLDIR.'/lastnews.htm';
if(filemtime($newsfile) > filemtime($lnewshtm)) {
$lnewsinfo = nparse_news(0,$newslimit);
writeover($lnewshtm,$lnewsinfo);
}
}*/
$last_newsinfo = nparse_news(0,50);
if(!isset($newsmode)){$newsmode = '';}
if($newsmode == 'last') {
include template('lastnews');
echo $last_newsinfo;
$newsdata['innerHTML']['newsinfo'] = ob_get_contents();
if(isset($error)){$newsdata['innerHTML']['error'] = $error;}
ob_clean();
......@@ -32,11 +35,12 @@ if($newsmode == 'last') {
ob_end_flush();
} elseif($newsmode == 'all') {
if(filemtime($newsfile) > filemtime($newshtm)) {
/*if(filemtime($newsfile) > filemtime($newshtm)) {
$newsinfo = nparse_news(0,65535);
writeover($newshtm,$newsinfo);
}
include template('newsinfo');
}*/
$newsinfo = nparse_news(0,65535);
echo $newsinfo;
$newsdata['innerHTML']['newsinfo'] = ob_get_contents();
if(isset($error)){$newsdata['innerHTML']['error'] = $error;}
ob_clean();
......
......@@ -24,11 +24,7 @@
<div id="newsinfo">
<!--{if $newsmode == 'all'}-->
{template newsinfo}
<!--{else}-->
{template lastnews}
<!--{/if}-->
{$last_newsinfo}
</div>
</div>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment