Commit 5dc5bd38 authored by Nemo Ma's avatar Nemo Ma Committed by GitHub

Merge pull request #146 from hikawiier/waaagh

update useradvdata
parents 839ee813 73cde7cc
...@@ -714,7 +714,8 @@ ob_clean(); ...@@ -714,7 +714,8 @@ ob_clean();
$jgamedata = compatible_json_encode($gamedata); $jgamedata = compatible_json_encode($gamedata);
//$json = new Services_JSON(); //$json = new Services_JSON();
//$jgamedata = $json->encode($gamedata); //$jgamedata = $json->encode($gamedata);
if (!strstr($_SERVER['HTTP_REFERER'], 'php')) { //if(!strstr($_SERVER['HTTP_REFERER'], 'php')) {
if($udata['u_templateid'] == 1 && !strstr($_SERVER['HTTP_REFERER'], 'php') && $_SERVER['HTTP_REFERER'] != ''){
include './api.php'; include './api.php';
} else { } else {
echo $jgamedata; echo $jgamedata;
......
...@@ -169,7 +169,8 @@ if(isset($opendialog)) ...@@ -169,7 +169,8 @@ if(isset($opendialog))
</script>"; </script>";
} }
if (!strstr($_SERVER['HTTP_REFERER'], 'php') && $_SERVER['HTTP_REFERER'] != '') { //if (!strstr($_SERVER['HTTP_REFERER'], 'php') && $_SERVER['HTTP_REFERER'] != '') {
if($udata['u_templateid'] == 1 && !strstr($_SERVER['HTTP_REFERER'], 'php') && $_SERVER['HTTP_REFERER'] != ''){
include './api.php'; include './api.php';
} else { } else {
include template('game'); include template('game');
......
...@@ -173,6 +173,12 @@ $ip_max_rooms = 2; ...@@ -173,6 +173,12 @@ $ip_max_rooms = 2;
$login_exit_room = 0; $login_exit_room = 0;
//版本更新时是否需要检查增补数据库字段 //版本更新时是否需要检查增补数据库字段
$need_update_db_structrue = 0; $need_update_db_structrue = 1;
//使用新版UI时,访问旧页面时重定向至新版UI界面的完整路径
$u_templateid_url = Array
(
1 => '',
);
?> ?>
...@@ -681,7 +681,6 @@ div.ach_box ...@@ -681,7 +681,6 @@ div.ach_box
{ {
background-color:rgba(20,22,24,0.5); *BACKGROUND: rgb(20,22,24); *filter:alpha(opacity=50); background-color:rgba(20,22,24,0.5); *BACKGROUND: rgb(20,22,24); *filter:alpha(opacity=50);
display:Inline-block; display:Inline-block;
overflow-y: auto;
width:320px; min-height:106px;text-align:left; vertical-align:middle; width:320px; min-height:106px;text-align:left; vertical-align:middle;
margin:5px; border:1px solid rgba(225, 124, 226, 0.4); border-radius:7px; margin:5px; border:1px solid rgba(225, 124, 226, 0.4); border-radius:7px;
} }
......
...@@ -384,6 +384,7 @@ CREATE TABLE `acbra2_users` ( ...@@ -384,6 +384,7 @@ CREATE TABLE `acbra2_users` (
`motto` char(30) NOT NULL DEFAULT '', `motto` char(30) NOT NULL DEFAULT '',
`killmsg` char(30) NOT NULL DEFAULT '', `killmsg` char(30) NOT NULL DEFAULT '',
`lastword` char(30) NOT NULL DEFAULT '', `lastword` char(30) NOT NULL DEFAULT '',
`u_templateid` tinyint(3) unsigned NOT NULL DEFAULT '0',
PRIMARY KEY (`uid`), PRIMARY KEY (`uid`),
UNIQUE KEY `username` (`username`) UNIQUE KEY `username` (`username`)
) ENGINE=MyISAM AUTO_INCREMENT=17725 DEFAULT CHARSET=utf8; ) ENGINE=MyISAM AUTO_INCREMENT=17725 DEFAULT CHARSET=utf8;
......
...@@ -34,6 +34,13 @@ function roommng_verify_db_game_structure() ...@@ -34,6 +34,13 @@ function roommng_verify_db_game_structure()
echo "向game表中添加了字段groomownid<br>"; echo "向game表中添加了字段groomownid<br>";
} }
$result = $db->query("DESCRIBE {$gtablepre}users u_templateid");
if(!$db->num_rows($result))
{
$db->query("ALTER TABLE {$gtablepre}users ADD u_templateid tinyint(3) unsigned NOT NULL DEFAULT '0' AFTER lastword");
echo "向users表中添加了字段u_templateid<br>";
}
$result = $db->query("SHOW INDEX FROM {$gtablepre}game"); $result = $db->query("SHOW INDEX FROM {$gtablepre}game");
$gr = $db->fetch_array($result); $gr = $db->fetch_array($result);
if($gr['Column_name'] != 'groomid') if($gr['Column_name'] != 'groomid')
......
...@@ -73,6 +73,7 @@ CREATE TABLE bra_users ( ...@@ -73,6 +73,7 @@ CREATE TABLE bra_users (
`motto` char(30) NOT NULL DEFAULT '', `motto` char(30) NOT NULL DEFAULT '',
`killmsg` char(30) NOT NULL DEFAULT '', `killmsg` char(30) NOT NULL DEFAULT '',
`lastword` char(30) NOT NULL DEFAULT '', `lastword` char(30) NOT NULL DEFAULT '',
`u_templateid` tinyint(3) unsigned NOT NULL DEFAULT '0',
PRIMARY KEY (uid), PRIMARY KEY (uid),
UNIQUE KEY username (username) UNIQUE KEY username (username)
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
<!-- 对白分段显示 --> <!-- 对白分段显示 -->
<!--{loop $dialogues[$dialogue_id] $dkey $dinfo}--> <!--{loop $dialogues[$dialogue_id] $dkey $dinfo}-->
<div id="d{$dkey}" <!--{if $dkey == 0}--> class="ach_box" style="border:0; text-align: center; min-height: min-content; width: max-content; max-width: 560px;" <!--{else}--> style="display: none;" <!--{/if}-->> <div id="d{$dkey}" <!--{if $dkey == 0}--> class="ach_box" style="overflow-y: auto; border:0; text-align: center; min-height: min-content; width: max-content; max-width: 560px;" <!--{else}--> style="display: none;" <!--{/if}-->>
<table> <table>
<tr> <tr>
<!-- 带头像对白 --> <!-- 带头像对白 -->
......
...@@ -57,7 +57,7 @@ $language = array ...@@ -57,7 +57,7 @@ $language = array
'motto_comment' => '写下彰显个性的台词,30个字以内。', 'motto_comment' => '写下彰显个性的台词,30个字以内。',
'killmsg_comment' => '写下你杀死对手的留言,30个字以内', 'killmsg_comment' => '写下你杀死对手的留言,30个字以内',
'lastword_comment' => '写下你不幸被害时的台词,30个字以内', 'lastword_comment' => '写下你不幸被害时的台词,30个字以内',
'bgmvolume_comment' => '设置游戏内背景音乐的默认音量,刷新页面后生效', 'bgmvolume_comment' => '设置游戏内背景音乐的默认音量',
'credits' => '战斗力', 'credits' => '战斗力',
'credits2' => '切糕', 'credits2' => '切糕',
'lastgame' => '最后游戏', 'lastgame' => '最后游戏',
......
...@@ -8,24 +8,26 @@ ...@@ -8,24 +8,26 @@
<span id="info" class="yellow"></span> <span id="info" class="yellow"></span>
</p> </p>
<center> <center>
<form method="post" action="user.php" name="userdata"> <form method="post" action="user.php" name="userdata">
<input type="hidden" name="mode" value="edit"> <input type="hidden" name="mode" value="edit">
<table style="text-align: center"> <div>
<tr> <div style="display:inline-block;">
<td style="vertical-align:top"><span class ="yellow">{lang basicdata}</span>{template userbasicdata}</td> <span class ="yellow b">{lang basicdata}</span>
<td rowspan="2"style="vertical-align:top"><span class ="yellow">{lang advanceddata}</span>{template useradvdata}</td> {template userbasicdata}
</tr> </div>
<tr> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<td><span class ="yellow">{lang creditsdata}</span>{template usercrdtsdata}</td> <div style="display:inline-block;">
</tr> <span class ="yellow b">{lang advanceddata}</span>
</table> {template useradvdata}
</div>
</div>
<div id="postdata"> <div id="postdata">
<input type="submit" id="post" onClick="postCmd('userdata','user.php');return false;" value="{lang submit}"> <input type="submit" id="post" onClick="postCmd('userdata','user.php');return false;" value="{lang submit}">
<input type="reset" id="reset" name="reset" value="{lang reset}"> <input type="reset" id="reset" name="reset" value="{lang reset}">
</div> </div>
</form> </form>
</center> </center>
<br /> <br />
{template footer} {template footer}
\ No newline at end of file
<table align="center"> <table>
<tr> <tr>
<td>{lang gender}</td> <td align="center">
<td> <table>
<input type="radio" id="male" name="gender" onclick="userIconMover()" value="m" <!--{if $gender != "f"}-->checked<!--{/if}--> >$sexinfo['m'] <tr><td>{template usergdicon}<br /></td><td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
<input type="radio" name="gender" onclick="userIconMover()" value="f" <!--{if $gender == "f"}-->checked<!--{/if}-->>$sexinfo['f'] <td>{template userwords}<br /></td></tr>
</table>
</td> </td>
</tr> </tr>
<tr> </table>
<td>{lang icon}</td> \ No newline at end of file
<td>
<select id="icon" name="icon" onchange="userIconMover()">
<!--{loop $iconarray $icon}-->
{$icon}
<!--{/loop}-->
</select>(0为随机)
<div id="userIconImg" class="iconImg" >
<img src="img/<!--{if $gender != 'f'}-->m<!--{else}-->f<!--{/if}-->_{$select_icon}.gif" alt="$select_icon">
</div>
</td>
</tr>
<tr>
<td>{lang motto}</td>
<td><input size="30" type="text" name="motto" maxlength="30" value="{$motto}">{lang motto_comment}</td>
</tr>
<tr>
<tr>
<td>{lang killmsg}</td>
<td><input size="30" type="text" name="killmsg" maxlength="30" value="{$killmsg}">{lang killmsg_comment}</td>
</tr>
<tr>
<td>{lang lastword}</td>
<td><input size="30" type="text" name="lastword" maxlength="30" value="{$lastword}">{lang lastword_comment}</td>
</tr>
<tr>
<td>{lang usertitle}</td>
<td>
<!--{eval $utlist = !empty($utlist) ? $utlist : Array(0 => '参展者');}-->
<select name="nick">
<!--{loop $utlist $key $val}-->
<option value="{$val}" <!--{if $udata['nick'] == $val}-->selected<!--{/if}-->>$val</option>
<!--{/loop}-->
</select>
</td>
</tr>
<tr>
<td>{lang bgmvolume}</td>
<!--{eval $volume = isset($_COOKIE["volume"]) ? filter_var($_COOKIE["volume"],FILTER_VALIDATE_FLOAT)*100 : 20; $v = isset($volume) ? $volume : 20;}-->
<td><input style="width: 45px;" size="2" type="number" name="volume" min="0" max="100" value="{$v}">% {lang bgmvolume_comment}</td>
</tr>
</table>
\ No newline at end of file
...@@ -36,6 +36,12 @@ ...@@ -36,6 +36,12 @@
<td><input type="password" id="rnpass" name="rnpass" size="15" maxlength="24" value=""></td> <td><input type="password" id="rnpass" name="rnpass" size="15" maxlength="24" value=""></td>
<td>{lang password_comment}</td> <td>{lang password_comment}</td>
</tr> </tr>
<tr>
<td>{lang bgmvolume}</td>
<!--{eval $volume = isset($_COOKIE["volume"]) ? filter_var($_COOKIE["volume"],FILTER_VALIDATE_FLOAT)*100 : 20; $v = isset($volume) ? $volume : 20;}-->
<td><input type="number" name="volume" min="0" max="100" value="{$v}">%</td>
<td>{lang bgmvolume_comment}</td>
</tr>
<!--{else}--> <!--{else}-->
<tr> <tr>
<td>{lang username}</td> <td>{lang username}</td>
......
...@@ -26,4 +26,11 @@ ...@@ -26,4 +26,11 @@
</div> </div>
</td> </td>
</tr> </tr>
<tr>
<td>当前界面</td>
<td>
<input type="radio" id="template_1" name="templateid" value="0" <!--{if !$u_templateid}-->checked<!--{/if}-->><a onclick="sl('template_1')">经典界面</a> &nbsp;&nbsp;
<input type="radio" id="template_2" name="templateid" value="1" <!--{if $u_templateid == 1}-->checked<!--{/if}-->><a onclick="sl('template_2')">LULUXIA(未开放)</span>
</td>
</tr>
</table> </table>
\ No newline at end of file
<table align="center"> <table align="center">
<!--{if !empty($udata)}--> <!--{if !empty($udata)}-->
<tr> <tr>
<td>{lang usertitle}</td> <td>{lang usertitle}</td>
<td> <td>
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
选择一个有趣的头衔,部分头衔存在特殊的入场效果。 选择一个有趣的头衔,部分头衔存在特殊的入场效果。
</td> </td>
</tr> </tr>
<!--{if !empty($t1_list) && !empty($t2_list)}-->
<tr> <tr>
<td>内定称号</td> <td>内定称号</td>
<td> <td>
...@@ -31,6 +32,7 @@ ...@@ -31,6 +32,7 @@
</td> </td>
</tr> </tr>
<!--{/if}--> <!--{/if}-->
<!--{/if}-->
<tr> <tr>
<td>{lang motto}</td> <td>{lang motto}</td>
<td><input size="30" type="text" name="motto" maxlength="30" value="{$motto}">{lang motto_comment}</td> <td><input size="30" type="text" name="motto" maxlength="30" value="{$motto}">{lang motto_comment}</td>
......
...@@ -16,8 +16,11 @@ ...@@ -16,8 +16,11 @@
<tr> <tr>
<td align="center"> <td align="center">
<table> <table>
<tr><td>{template usergdicon}<br /></td><td>&nbsp;&nbsp;&nbsp;&nbsp;</td> <tr>
<td>{template userwords}<br /></td></tr> <td>{template usergdicon}<br /></td>
<td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
<td>{template userwords}<br /></td>
</tr>
</table> </table>
</td> </td>
</tr> </tr>
......
...@@ -46,7 +46,7 @@ if($mode == 'edit') { ...@@ -46,7 +46,7 @@ if($mode == 'edit') {
$gamedata['innerHTML']['info'] .= $_INFO['pass_failure'].'<br />'; $gamedata['innerHTML']['info'] .= $_INFO['pass_failure'].'<br />';
} }
$credits = $udata['credits'];$credits2 = $udata['credits2']; $credits = $udata['credits'];$credits2 = $udata['credits2'];
if($exchg12||$exchg21){ /*if($exchg12||$exchg21){
//if(!is_numeric($exchg12)||$exchg12<0){$gamedata['innerHTML']['info'] .= $_INFO['credits_failure'];} //if(!is_numeric($exchg12)||$exchg12<0){$gamedata['innerHTML']['info'] .= $_INFO['credits_failure'];}
if(!is_numeric($exchg12)||!is_numeric($exchg21)||$exchg12<0||$exchg21<0){$gamedata['innerHTML']['info'] .= $_INFO['credits_failure'];} if(!is_numeric($exchg12)||!is_numeric($exchg21)||$exchg12<0||$exchg21<0){$gamedata['innerHTML']['info'] .= $_INFO['credits_failure'];}
elseif($exchg12 && $exchg21){$gamedata['innerHTML']['info'] .= $_INFO['credits_conflicts'];} elseif($exchg12 && $exchg21){$gamedata['innerHTML']['info'] .= $_INFO['credits_conflicts'];}
...@@ -71,11 +71,24 @@ if($mode == 'edit') { ...@@ -71,11 +71,24 @@ if($mode == 'edit') {
} }
} }
} }
} }*/
# 头像编辑
if ($icon>$iconlimit) $icon=0; if ($icon>$iconlimit) $icon=0;
# 入场音量编辑
$volume = round($volume/100,2); $volume = round(min(1,max(0,$volume)),2); $volume = round($volume/100,2); $volume = round(min(1,max(0,$volume)),2);
gsetcookie('volume',$volume,86400*30,0); gsetcookie('volume',$volume,86400*30,0);
$db->query("UPDATE {$gtablepre}users SET gender='$gender', icon='$icon',{$passqry}motto='$motto', killmsg='$killmsg', lastword='$lastword', credits='$credits', credits2='$credits2' ,nick='$nick' WHERE username='$cuser'"); # 切换用户界面
if(!empty($templateid))
{
if($templateid != 1) $templateid = 1;
# 暂时只允许管理员账户切换至新界面
if($udata['groupid'] < 9)
{
$templateid = 0;
$gamedata['innerHTML']['info'] .= '界面切换失败,新版界面暂未实装。<br>';
}
}
$db->query("UPDATE {$gtablepre}users SET gender='$gender', icon='$icon',{$passqry}motto='$motto', killmsg='$killmsg', lastword='$lastword', credits='$credits', credits2='$credits2' ,nick='$nick', u_templateid='$templateid' WHERE username='$cuser'");
if($db->affected_rows()){ if($db->affected_rows()){
$gamedata['innerHTML']['info'] .= $_INFO['data_success']; $gamedata['innerHTML']['info'] .= $_INFO['data_success'];
}else{ }else{
......
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