Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
phpdts
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Nemo Ma
phpdts
Commits
3d9f048d
Commit
3d9f048d
authored
Apr 02, 2023
by
Nemo Ma
Committed by
GitHub
Apr 02, 2023
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #105 from hikawiier/waaagh
kill newsinfo.php
parents
8bd8c01d
5b57c92c
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
17 additions
and
17 deletions
+17
-17
include/global.func.php
include/global.func.php
+2
-3
include/news.func.php
include/news.func.php
+1
-1
include/system.func.php
include/system.func.php
+3
-2
news.php
news.php
+10
-6
templates/default/news.htm
templates/default/news.htm
+1
-5
No files found.
include/global.func.php
View file @
3d9f048d
...
@@ -206,12 +206,11 @@ function compatible_json_encode($data){ //自动选择使用内置函数或者
...
@@ -206,12 +206,11 @@ function compatible_json_encode($data){ //自动选择使用内置函数或者
function
addnews
(
$t
=
0
,
$n
=
''
,
$a
=
''
,
$b
=
''
,
$c
=
''
,
$d
=
''
,
$e
=
''
)
{
function
addnews
(
$t
=
0
,
$n
=
''
,
$a
=
''
,
$b
=
''
,
$c
=
''
,
$d
=
''
,
$e
=
''
)
{
global
$now
,
$db
,
$tablepre
,
$gtablepre
;
global
$now
,
$db
,
$tablepre
,
$gtablepre
;
$t
=
$t
?
$t
:
$now
;
$t
=
$t
?
$t
:
$now
;
$newsfile
=
GAME_ROOT
.
'./gamedata/newsinfo.php'
;
/*
$newsfile = GAME_ROOT.'./gamedata/newsinfo.php';
touch
(
$newsfile
);
touch($newsfile);
*/
if
(
is_array
(
$a
)){
if
(
is_array
(
$a
)){
$a
=
implode
(
'_'
,
$a
);
$a
=
implode
(
'_'
,
$a
);
}
}
if
(
strpos
(
$n
,
'death11'
)
===
0
||
strpos
(
$n
,
'death32'
)
===
0
)
{
if
(
strpos
(
$n
,
'death11'
)
===
0
||
strpos
(
$n
,
'death32'
)
===
0
)
{
$result
=
$db
->
query
(
"SELECT lastword FROM
{
$gtablepre
}
users WHERE username = '
$a
'"
);
$result
=
$db
->
query
(
"SELECT lastword FROM
{
$gtablepre
}
users WHERE username = '
$a
'"
);
$e
=
$lastword
=
$db
->
result
(
$result
,
0
);
$e
=
$lastword
=
$db
->
result
(
$result
,
0
);
...
...
include/news.func.php
View file @
3d9f048d
...
@@ -65,7 +65,7 @@ function nparse_news($start = 0, $range = 0 ){//$type = '') {
...
@@ -65,7 +65,7 @@ function nparse_news($start = 0, $range = 0 ){//$type = '') {
$newsinfo
.=
"<li>
{
$hour
}
时
{
$min
}
分
{
$sec
}
秒,增加禁区:"
;
$newsinfo
.=
"<li>
{
$hour
}
时
{
$min
}
分
{
$sec
}
秒,增加禁区:"
;
$alist
=
explode
(
'_'
,
$a
);
$alist
=
explode
(
'_'
,
$a
);
foreach
(
$alist
as
$ar
)
{
foreach
(
$alist
as
$ar
)
{
$newsinfo
.=
"
$plsinfo[$ar]
"
;
$newsinfo
.=
"
{
$plsinfo
[
$ar
]
}
"
;
}
}
$newsinfo
.=
"<span class=
\"
yellow
\"
>【天气:
{
$wthinfo
[
$b
]
}
】</span><br>
\n
"
;
$newsinfo
.=
"<span class=
\"
yellow
\"
>【天气:
{
$wthinfo
[
$b
]
}
】</span><br>
\n
"
;
}
elseif
(
$news
==
'hack'
)
{
}
elseif
(
$news
==
'hack'
)
{
...
...
include/system.func.php
View file @
3d9f048d
...
@@ -17,13 +17,13 @@ function rs_game($mode = 0) {
...
@@ -17,13 +17,13 @@ function rs_game($mode = 0) {
$db
->
queries
(
$sql
);
$db
->
queries
(
$sql
);
//重设游戏进行状况的时间
//重设游戏进行状况的时间
if
(
$fp
=
fopen
(
"
{
$dir
}
newsinfo.php"
,
'wb'
))
{
/*
if($fp = fopen("{$dir}newsinfo.php", 'wb')) {
global $checkstr;
global $checkstr;
fwrite($fp, $checkstr);
fwrite($fp, $checkstr);
fclose($fp);
fclose($fp);
} else {
} else {
gexit('Can not write to cache files, please check directory ./gamedata/ and ./gamedata/cache/ .', __file__, __line__);
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
;
global
$hdamage
,
$hplayer
,
$noisetime
,
$noisepls
,
$noiseid
,
$noiseid2
,
$noisemode
,
$starttime
,
$gamevars
;
...
@@ -272,6 +272,7 @@ function rs_game($mode = 0) {
...
@@ -272,6 +272,7 @@ function rs_game($mode = 0) {
$qry
=
''
;
$qry
=
''
;
foreach
(
$shoplist
as
$lst
){
foreach
(
$shoplist
as
$lst
){
if
(
!
empty
(
$lst
)
&&
strpos
(
$lst
,
','
)
!==
false
){
if
(
!
empty
(
$lst
)
&&
strpos
(
$lst
,
','
)
!==
false
){
if
(
empty
(
$lst
[
8
]))
$lst
[
8
]
=
''
;
list
(
$kind
,
$num
,
$price
,
$area
,
$item
,
$itmk
,
$itme
,
$itms
,
$itmsk
)
=
explode
(
','
,
$lst
);
list
(
$kind
,
$num
,
$price
,
$area
,
$item
,
$itmk
,
$itme
,
$itms
,
$itmsk
)
=
explode
(
','
,
$lst
);
if
(
$kind
!=
0
){
if
(
$kind
!=
0
){
$qry
.=
"('
$kind
','
$num
','
$price
','
$area
','
$item
','
$itmk
','
$itme
','
$itms
','
$itmsk
'),"
;
$qry
.=
"('
$kind
','
$num
','
$price
','
$area
','
$item
','
$itmk
','
$itme
','
$itms
','
$itmsk
'),"
;
...
...
news.php
View file @
3d9f048d
...
@@ -9,6 +9,7 @@ require './include/game.func.php';
...
@@ -9,6 +9,7 @@ require './include/game.func.php';
require_once
GAME_ROOT
.
'./include/news.func.php'
;
require_once
GAME_ROOT
.
'./include/news.func.php'
;
include_once
GAME_ROOT
.
'./include/system.func.php'
;
include_once
GAME_ROOT
.
'./include/system.func.php'
;
/*
$newsfile = GAME_ROOT.'./gamedata/newsinfo.php';
$newsfile = GAME_ROOT.'./gamedata/newsinfo.php';
$newshtm = GAME_ROOT.TPLDIR.'/newsinfo.htm';
$newshtm = GAME_ROOT.TPLDIR.'/newsinfo.htm';
$lnewshtm = GAME_ROOT.TPLDIR.'/lastnews.htm';
$lnewshtm = GAME_ROOT.TPLDIR.'/lastnews.htm';
...
@@ -16,12 +17,14 @@ $lnewshtm = GAME_ROOT.TPLDIR.'/lastnews.htm';
...
@@ -16,12 +17,14 @@ $lnewshtm = GAME_ROOT.TPLDIR.'/lastnews.htm';
if(filemtime($newsfile) > filemtime($lnewshtm)) {
if(filemtime($newsfile) > filemtime($lnewshtm)) {
$lnewsinfo = nparse_news(0,$newslimit);
$lnewsinfo = nparse_news(0,$newslimit);
writeover($lnewshtm,$lnewsinfo);
writeover($lnewshtm,$lnewsinfo);
}
}*/
$last_newsinfo
=
nparse_news
(
0
,
50
);
if
(
!
isset
(
$newsmode
)){
$newsmode
=
''
;}
if
(
!
isset
(
$newsmode
)){
$newsmode
=
''
;}
if
(
$newsmode
==
'last'
)
{
if
(
$newsmode
==
'last'
)
{
echo
$last_newsinfo
;
include
template
(
'lastnews'
);
$newsdata
[
'innerHTML'
][
'newsinfo'
]
=
ob_get_contents
();
$newsdata
[
'innerHTML'
][
'newsinfo'
]
=
ob_get_contents
();
if
(
isset
(
$error
)){
$newsdata
[
'innerHTML'
][
'error'
]
=
$error
;}
if
(
isset
(
$error
)){
$newsdata
[
'innerHTML'
][
'error'
]
=
$error
;}
ob_clean
();
ob_clean
();
...
@@ -32,11 +35,12 @@ if($newsmode == 'last') {
...
@@ -32,11 +35,12 @@ if($newsmode == 'last') {
ob_end_flush
();
ob_end_flush
();
}
elseif
(
$newsmode
==
'all'
)
{
}
elseif
(
$newsmode
==
'all'
)
{
if
(
filemtime
(
$newsfile
)
>
filemtime
(
$newshtm
))
{
/*
if(filemtime($newsfile) > filemtime($newshtm)) {
$newsinfo = nparse_news(0,65535);
$newsinfo = nparse_news(0,65535);
writeover($newshtm,$newsinfo);
writeover($newshtm,$newsinfo);
}
}*/
include
template
(
'newsinfo'
);
$newsinfo
=
nparse_news
(
0
,
65535
);
echo
$newsinfo
;
$newsdata
[
'innerHTML'
][
'newsinfo'
]
=
ob_get_contents
();
$newsdata
[
'innerHTML'
][
'newsinfo'
]
=
ob_get_contents
();
if
(
isset
(
$error
)){
$newsdata
[
'innerHTML'
][
'error'
]
=
$error
;}
if
(
isset
(
$error
)){
$newsdata
[
'innerHTML'
][
'error'
]
=
$error
;}
ob_clean
();
ob_clean
();
...
...
templates/default/news.htm
View file @
3d9f048d
...
@@ -24,11 +24,7 @@
...
@@ -24,11 +24,7 @@
<div
id=
"newsinfo"
>
<div
id=
"newsinfo"
>
<!--{if $newsmode == 'all'}-->
{$last_newsinfo}
{template newsinfo}
<!--{else}-->
{template lastnews}
<!--{/if}-->
</div>
</div>
</div>
</div>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment