-
Notifications
You must be signed in to change notification settings - Fork 11
/
news.php
81 lines (71 loc) · 2.25 KB
/
news.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
<?php
define('CURSCRIPT', 'news');
require './include/common.inc.php';
require './include/game.func.php';
//$t_s=getmicrotime();
//require_once GAME_ROOT.'./include/JSON.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';
if(filemtime($newsfile) > filemtime($lnewshtm)) {
$lnewsinfo = nparse_news(0,$newslimit);
writeover($lnewshtm,$lnewsinfo);
}*/
$last_newsinfo = nparse_news(0,50);
if(!isset($newsmode)){$newsmode = '';}
if (isset($sendmode) && $sendmode == 'news') {//游戏页面查看进行状况的调用
//$lastnid = (int)$lastnid;
$newsinfo = nparse_news(0,$newslimit);
ob_clean();
//$jgamedata = gencode($newsinfo);
$jgamedata = $newsinfo;
echo $jgamedata;
ob_end_flush();
} elseif($newsmode == 'last') {
echo $last_newsinfo;
$newsdata['innerHTML']['newsinfo'] = ob_get_contents();
if(isset($error)){$newsdata['innerHTML']['error'] = $error;}
ob_clean();
$jgamedata = compatible_json_encode($newsdata);
// $json = new Services_JSON();
// $jgamedata = $json->encode($newsdata);
echo $jgamedata;
ob_end_flush();
} elseif($newsmode == 'all') {
/*if(filemtime($newsfile) > filemtime($newshtm)) {
$newsinfo = nparse_news(0,65535);
writeover($newshtm,$newsinfo);
}*/
$newsinfo = nparse_news(0,65535);
echo $newsinfo;
$newsdata['innerHTML']['newsinfo'] = ob_get_contents();
if(isset($error)){$newsdata['innerHTML']['error'] = $error;}
ob_clean();
$jgamedata = compatible_json_encode($newsdata);
//$json = new Services_JSON();
//$jgamedata = $json->encode($newsdata);
echo $jgamedata;
ob_end_flush();
} elseif($newsmode == 'chat') {
$newsdata['innerHTML']['newsinfo'] = '';
$chats = getchat(0,'',$chatinnews);
$chatmsg = $chats['msg'];
foreach($chatmsg as $val){
$newsdata['innerHTML']['newsinfo'] .= $val;
}
if(isset($error)){$newsdata['innerHTML']['error'] = $error;}
ob_clean();
$jgamedata = compatible_json_encode($newsdata);
// $json = new Services_JSON();
// $jgamedata = $json->encode($newsdata);
echo $jgamedata;
ob_end_flush();
} else {
include template('news');
}
//$t_e=getmicrotime();
//putmicrotime($t_s,$t_e,'news_time');
?>