PHP网页游戏学习之Xnova(ogame)源码解读(八)_php实例

WBOY
Release: 2016-05-17 08:40:46
Original
843 people have browsed it

十一、公共函数(functions.php)

本来打算写建筑页面的分析,但是建筑页面东西比较多,一天时间也写不完;而且我们还有很多函数要经常用到,先简单介绍下这些函数还是有必要的;下面我们还是以注释方式说明。

// ------------------------------
//
//检查用户是否假期模式,这个函数没有被调用过
//
function check_urlaubmodus ($user)
//输出目前登陆用户假期模式剩余时间,这个函数没有被调用过
function check_urlaubmodus_time () 
// ------------------------------
//
// 判断一个Email地址是否合法
//
function is_email($email) 
// ------------------------------
//
// 输出一个管理员信息,调用的是display函数
//$mes -> 内容
//$title-> 标题
//$dest -> 返回页面
//$time -> 返回时间
function AdminMessage ($mes, $title = 'Error', $dest = "", $time = "3") 
// ------------------------------
//
// 输出普通用户信息,调用display函数
//$mes -> 内容
//$title-> 标题
//$dest -> 返回页面
//$time -> 返回时间
function message ($mes, $title = 'Error', $dest = "", $time = "3") 
// ------------------------------
//
// 输出信息
//
// $page   -> 页面
// $title   -> 页面标题
// $topnav  -> 是否包含头部资源显示文件
// $metatags -> meta标签值
// $AdminPage -> 是否为管理页面
function display($page,$title = '',$topnav = true,$metatags = '',$AdminPage = false)
// ------------------------------
//
// 定义用户的Meta值
//$title ->标题
//$metatags->Meta值
function StdUserHeader ($title = '', $metatags = '') 
// ------------------------------
//
// 定义管理员的meta值
//$title ->标题
//$metatags->Meta值
function AdminUserHeader ($title = '', $metatags = '') 
// ------------------------------
//
// 定义页脚页面
//
function StdFooter() 
// ------------------------------
//
// 计算当前星球的最大空间值,也算入地形改造值
//$planet -> 星球,注意是传址
function CalculateMaxPlanetFields (&$planet) 
Copy after login

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!