本文整理汇总了PHP中city::build方法的典型用法代码示例。如果您正苦于以下问题:PHP city::build方法的具体用法?PHP city::build怎么用?PHP city::build使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类city
的用法示例。
在下文中一共展示了city::build方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: city
$this_city = new city($_REQUEST['city_id']);
$is_owner = $LOGIN_DATA['user_id'] == $this_city->getValue('user')->getValue('userid');
$can_edit = $this_city->getValue('user_' . $LOGIN_DATA['user_id'] . '_edit');
$can_edit = $can_edit === true || intval($can_edit) > time();
if ($can_edit !== true && intval($can_edit) > time()) {
$can_edit_time = ceil(($can_edit - time()) / 60);
}
$can_access = $this_city->getValue('user_' . $LOGIN_DATA['user_id'] . '_access');
if ($can_access !== true && intval($can_access) > time()) {
$can_access_time = ceil(($can_access - time()) / 60);
}
$can_access = $can_access === true || intval($can_access) > time();
//if(!$can_access) die('<head><title>Cannot View City</title></head><body><h2>You cannot view this city.</h2></body></html>');
$server = new server($_REQUEST['server_id']);
if ($can_edit && $_POST['building_id']) {
$message = $this_city->build(intval($_POST['building_id']));
if ($message) {
$message = '<b style="padding:3px;border:1px solid red;display:block;"><img src="/images/error.png" alt="" /> ' . htmlentities($message) . '</b>';
} else {
$message = '<div style="padding:3px;border:1px solid #ccc;display:block;"><img src="/images/information.png" alt="" /> Building started.</div>';
}
if (isset($_REQUEST['ajax'])) {
exit($message);
}
}
//end if POST building_id
if ($can_edit && $_POST['unit_id']) {
$message = $this_city->create_units(intval($_POST['unit_id']), intval($_POST['unit_count']));
if ($message) {
$message = '<b style="padding:3px;border:1px solid red;display:block;"><img src="/images/error.png" alt="" /> ' . htmlentities($message) . '</b>';
} else {