本文整理汇总了PHP中server::getWeekLength方法的典型用法代码示例。如果您正苦于以下问题:PHP server::getWeekLength方法的具体用法?PHP server::getWeekLength怎么用?PHP server::getWeekLength使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类server
的用法示例。
在下文中一共展示了server::getWeekLength方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: dirname
require_once dirname(__FILE__) . '/../statistics.php';
if ($_REQUEST['server_id'] && !$server) {
$server = new server($_REQUEST['server_id']);
}
echo '</span>';
echo ' | <a href="' . ($_REQUEST['server_id'] ? '/server/' . $_REQUEST['server_id'] : '') . '/user/' . $LOGIN_DATA['user_id'] . '"><img src="/images/user.png" alt="Your Profile" title="Your Profile" /></a> ';
echo ' <a href="/login/out.php"><img src="/images/door_out.png" alt="Logout" title="Logout" /></a> ';
}
//end if logged in
?>
<a href="http://pibb.com/go/theproject"><img src="/images/comment.png" alt="Discuss" title="Discuss" /></a>
<a href="/faq/"><img src="/images/information.png" alt="FAQ" title="FAQ" /></a>
<br />
<?php
if ($server) {
if (!$server->getWeekLength() || $server->getPreviousWeek() < time()) {
$day = $server->getPreviousDay();
$time_left = round(abs(time() - $server->getDayLength() - $day) / 60, 2);
echo '<span id="day-left">' . $time_left . '</span> minutes left in the day';
?>
<script type="text/javascript" src="/include/prototype.js"></script>
<script type="text/javascript" src="/include/ajax.js"></script>
<script type="text/javascript">
//<![CDATA[
var day_left_id = '';
function update_day_left() {
var block = document.getElementById('day-left');
block.innerHTML = Math.round((block.innerHTML - (1/60))*100)/100;
if(block.innerHTML < 0) block.innerHTML = 0;
day_left_id = setTimeout("update_day_left()", 1100);
示例2: dirname
<link rel="shortcut icon" href="/favicon.ico" />
<style type="text/css">
dt {float: left;}
dd {text-align:right; width: 15em;}
</style>
</head>
<body>
<?php
require dirname(__FILE__) . '/include/visible_header.php';
echo '<h3>' . $server->getName() . ' Rules</h3>';
echo '<dl>';
echo ' <dt>Gold players start with</dt>';
echo ' <dd>' . $server->getInitialGold() . '</dd>';
echo ' <dt>Cities players start with</dt>';
echo ' <dd>' . $server->getInitialCityCount() . '</dd>';
echo ' <dt>Cities start with population</dt>';
echo ' <dd>' . $server->getInitialCityPopulation() . '</dd>';
echo ' <dt>Gold needed to build a city</dt>';
echo ' <dd>' . $server->getCityCost() . '</dd>';
echo ' <dt>Maximum city population</dt>';
echo ' <dd>' . $server->getCityPopulationMax() . '</dd>';
echo ' <dt>Hours in game day</dt>';
echo ' <dd>' . $server->getDayLength() / (60 * 60) . '</dd>';
echo ' <dt>Game days per round</dt>';
echo ' <dd>' . $server->getWeekLength() / $server->getDayLength() . '</dd>';
echo '</dl>';
?>
</body>
</html>