Home  >  Article  >  Backend Development  >  Xnova (ogame) source code interpretation for PHP web game learning (8)_PHP tutorial

Xnova (ogame) source code interpretation for PHP web game learning (8)_PHP tutorial

WBOY
WBOYOriginal
2016-07-13 10:26:03619browse

11. Public functions (functions.php)

I originally planned to write an analysis of the building page, but there are so many things on the building page that I can’t finish it in one day; and we still have many functions that we need to use frequently. It is necessary to briefly introduce these functions first; below we will Explain in comments.

// ------------------------------
//
//检查用户是否假期模式,这个函数没有被调用过
//
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) 

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/824839.htmlTechArticle11. Public functions (functions.php) I originally planned to write an analysis of the construction page, but there are many things on the construction page. , we can’t finish it in one day; and we still have many functions that we need to use frequently...
Statement:
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