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
3697e24a
Commit
3697e24a
authored
May 11, 2023
by
hisuinohoshi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update in-game newsinfo
新增: - 在游戏内聊天框界面切换显示聊天讯息/进行状况的功能;
parent
f01f4d15
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
71 additions
and
13 deletions
+71
-13
gamedata/cache/style_20190718.css
gamedata/cache/style_20190718.css
+13
-0
include/common.inc.php
include/common.inc.php
+1
-0
include/game20130526.js
include/game20130526.js
+8
-3
news.php
news.php
+10
-2
templates/default/chat.htm
templates/default/chat.htm
+35
-6
templates/default/templates.lang.php
templates/default/templates.lang.php
+3
-1
winner.php
winner.php
+1
-1
No files found.
gamedata/cache/style_20190718.css
View file @
3697e24a
...
...
@@ -369,6 +369,19 @@ word-break:break-all;
overflow
:
auto
;
position
:
relative
;
}
#newslist
{
MARGIN
:
0px
;
height
:
120px
;
width
:
100%
;
word-break
:
normal
;
overflow
:
auto
;
position
:
relative
;
}
.newslist
ul
{
margin
:
0
;
padding
:
2px
;
padding-left
:
20px
;
}
#sendchat
{
MARGIN
:
0px
;
padding
:
0px
;
...
...
include/common.inc.php
View file @
3697e24a
...
...
@@ -44,6 +44,7 @@ unset($dbhost, $dbuser, $dbpw, $dbname, $pconnect);
require
GAME_ROOT
.
'./gamedata/system.php'
;
require
GAME_ROOT
.
'./include/init.func.php'
;
require
GAME_ROOT
.
'./include/news.func.php'
;
require
GAME_ROOT
.
'./include/resources.func.php'
;
require
GAME_ROOT
.
'./include/roommng.func.php'
;
require
GAME_ROOT
.
'./include/game/revclubskills.func.php'
;
...
...
include/game20130526.js
View file @
3697e24a
...
...
@@ -375,7 +375,8 @@ function chat(mode,reftime) {
clearTimeout
(
refchat
);
var
oXmlHttp
=
zXmlHttp
.
createRequest
();
var
sBody
=
getRequestBody
(
document
.
forms
[
'
sendchat
'
]);
oXmlHttp
.
open
(
"
post
"
,
"
chat.php
"
,
true
);
if
(
mode
==
'
news
'
)
oXmlHttp
.
open
(
"
post
"
,
"
news.php
"
,
true
);
else
oXmlHttp
.
open
(
"
post
"
,
"
chat.php
"
,
true
);
oXmlHttp
.
setRequestHeader
(
"
Content-Type
"
,
"
application/x-www-form-urlencoded
"
);
oXmlHttp
.
onreadystatechange
=
function
()
{
if
(
oXmlHttp
.
readyState
==
4
)
{
...
...
@@ -389,7 +390,8 @@ function chat(mode,reftime) {
oXmlHttp
.
send
(
sBody
);
if
(
mode
==
'
send
'
){
$
(
'
chatmsg
'
).
value
=
''
;
$
(
'
sendmode
'
).
value
=
'
ref
'
;}
rtime
=
reftime
;
refchat
=
setTimeout
(
"
chat('ref',rtime)
"
,
rtime
);
if
(
mode
==
'
news
'
)
refchat
=
setTimeout
(
"
chat('news',rtime)
"
,
rtime
);
else
refchat
=
setTimeout
(
"
chat('ref',rtime)
"
,
rtime
);
}
...
...
@@ -403,9 +405,12 @@ function showChatdata(jsonchat) {
newchat
+=
chatdata
[
'
msg
'
][
cid
];
}
$
(
'
chatlist
'
).
innerHTML
=
newchat
+
$
(
'
chatlist
'
).
innerHTML
;
}
}
else
{
$
(
'
newslist
'
).
innerHTML
=
jsonchat
;
}
}
function
openShutManager
(
oSourceObj
,
oTargetObj
,
shutAble
,
oOpenTip
,
oShutTip
){
var
sourceObj
=
typeof
oSourceObj
==
"
string
"
?
document
.
getElementById
(
oSourceObj
)
:
oSourceObj
;
var
targetObj
=
typeof
oTargetObj
==
"
string
"
?
document
.
getElementById
(
oTargetObj
)
:
oTargetObj
;
...
...
news.php
View file @
3697e24a
...
...
@@ -6,7 +6,7 @@ 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'
;
//
require_once GAME_ROOT.'./include/news.func.php';
//include_once GAME_ROOT.'./include/system.func.php';
/*
...
...
@@ -23,7 +23,15 @@ $last_newsinfo = nparse_news(0,50);
if
(
!
isset
(
$newsmode
)){
$newsmode
=
''
;}
if
(
$newsmode
==
'last'
)
{
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
;}
...
...
templates/default/chat.htm
View file @
3697e24a
<table
id=
"chat"
border=
"0"
width=
"720"
cellspacing=
"0"
cellpadding=
"0"
style=
"valign:top"
>
<tr>
<td
height=
"20px"
width=
"100%"
class=
"b1"
><span>
{lang chat}
</span></td>
<td
height=
"20px"
width=
"100%"
class=
"b1"
><span
id=
"chattitle"
>
{lang chat}
</span></td>
</tr>
<tr>
<td
valign=
"top"
class=
"b3"
style=
"text-align: left"
height=
"1px"
>
...
...
@@ -9,6 +9,10 @@
$msg
<!--{/loop}-->
</div>
<div
id=
"newslist"
style=
"display:none"
class=
"newslist"
>
<!--{eval $chat_news = nparse_news(0,$newslimit);}-->
$chat_news
</div>
</td>
</tr>
<tr>
...
...
@@ -30,14 +34,39 @@
</select>
</span>
<input
type=
"text"
id=
"chatmsg"
name=
"chatmsg"
maxlength=
"60"
>
<input
type=
"button"
id=
"send"
onClick=
"document['sendchat']['sendmode'].value='send';chat('send',$chatrefresh);return false;"
<input
type=
"button"
id=
"send"
onClick=
"
if($('sendmode').value=='ref')
{
document['sendchat']['sendmode'].value='send';
chat('send',$chatrefresh);
}
return false;"
value=
"{lang send}"
>
<input
type=
"button"
id=
"ref"
onClick=
"document['sendchat']['sendmode'].value='ref';chat('ref',$chatrefresh);return false;"
<input
type=
"button"
id=
"ref"
onClick=
"
if($('sendmode').value=='news'){
chat('news',$chatrefresh);
}else{
document['sendchat']['sendmode'].value='ref';chat('ref',$chatrefresh);
}
return false;"
value=
"{lang refresh}"
>
<!-- 迷你进行状况 -->
<input
type=
"button"
id=
"switch"
onClick=
"
if($('sendmode').value=='news'){
$('sendmode').value='ref';
$('chatlist').style.display='';
$('newslist').style.display='none';
$('chattitle').innerHTML='聊天讯息';
}else{
$('sendmode').value='news';
$('chatlist').style.display='none';
$('newslist').style.display='';
$('chattitle').innerHTML='进行状况';
}
chat($('sendmode').value,$chatrefresh);
return false;"
value=
"{lang chatswitch}"
>
<!-- 表情 -->
<input
type=
"button"
id=
"embtn"
value=
"
表情
"
>
<input
type=
"button"
id=
"embtn"
value=
"
{lang emoji}
"
>
<div
id=
"empanel"
style=
"display:none;"
>
<!--{loop $emdata $em}-->
$em
...
...
templates/default/templates.lang.php
View file @
3697e24a
...
...
@@ -138,7 +138,7 @@ $language = array
'arb'
=>
'防具'
,
'effect'
=>
'攻击'
,
'cmd_choice'
=>
'你想要做什么?'
,
'chat'
=>
'
消
息'
,
'chat'
=>
'
聊天讯
息'
,
'moneyunit'
=>
'元'
,
'wp'
=>
'殴'
,
'wk'
=>
'斩'
,
...
...
@@ -154,6 +154,8 @@ $language = array
'end'
=>
'游戏结束!'
,
'send'
=>
'发送'
,
'refresh'
=>
'刷新'
,
'emoji'
=>
'表情'
,
'chatswitch'
=>
'切换'
,
'maptitle'
=>
'虚拟世界地图'
,
);
...
...
winner.php
View file @
3697e24a
...
...
@@ -17,7 +17,7 @@ if($command == 'info') {
init_playerdata
();
init_profile
();
}
elseif
(
$command
==
'news'
)
{
include
GAME_ROOT
.
'./include/news.func.php'
;
//
include GAME_ROOT.'./include/news.func.php';
$hnewsfile
=
GAME_ROOT
.
"./gamedata/bak/
{
$gnum
}
_newsinfo.html"
;
if
(
file_exists
(
$hnewsfile
)){
$hnewsinfo
=
readover
(
$hnewsfile
);
...
...
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