|
五、 用戶登錄(login.php)
在開始的時候,我們說過游戲的入口是index.php文件;我們已經安裝好了,自然轉向登錄流程,開始看。
前面照例是一段我們前進介紹過的代碼,我們就不再詳細講了;不同的是使用的語言文件是login.mo,還有一個LOGIN的常量。如下
define('INSIDE' , true);define('INSTALL' , false);define('LOGIN' , true);$InLogin = true;$xnova_root_path = './';include($xnova_root_path . 'extension.inc');include($xnova_root_path . 'common.' . $phpEx);includeLang('login');
接下來又是我們前面講過的結構,我們看初次進入的分支是下面代碼:
$parse = $lang;$Count = doquery('SELECT COUNT(*) as `players` FROM {{table}} WHERE 1', 'users', true);$LastPlayer = doquery('SELECT `username` FROM {{table}} ORDER BY `register_time` DESC', 'users', true);$parse['last_user'] = $LastPlayer['username'];$PlayersOnline = doquery("SELECT COUNT(DISTINCT(id)) as `onlinenow` FROM {{table}} WHERE `onliNETime` > '" . (time()-900) ."';", 'users', true);$parse['online_users'] = $PlayersOnline['onlinenow'];$parse['users_amount'] = $Count['players'];$parse['servername'] = $game_config['game_name'];$parse['forum_url'] = $game_config['forum_url'];$parse['PasswordLost'] = $lang['PasswordLost'];$page = parsetemplate(gettemplate('login_body'), $parse);// Test pour prendre le nombre total de joueur et le nombre de joueurs connect 主站蜘蛛池模板: 通州区| 嘉善县| 亳州市| 庄河市| 林周县| 兴城市| 白城市| 莆田市| 白沙| 错那县| 濮阳市| 临颍县| 株洲县| 库伦旗| 宕昌县| 永济市| 罗源县| 报价| 云梦县| 石首市| 内江市| 临夏市| 都昌县| 油尖旺区| 泗洪县| 类乌齐县| 呈贡县| 衡阳市| 虞城县| 沈丘县| 英吉沙县| 衡南县| 五常市| 简阳市| 宿迁市| 东阳市| 南木林县| 资兴市| 南涧| 昌宁县| 错那县|