本文整理汇总了PHP中server::getName方法的典型用法代码示例。如果您正苦于以下问题:PHP server::getName方法的具体用法?PHP server::getName怎么用?PHP server::getName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类server
的用法示例。
在下文中一共展示了server::getName方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: switch
$verb = $data[1];
$data = $data[2];
$reply = '';
switch ($verb) {
case 'list':
case 'show':
case 'cities':
$data = 'cities';
case 'near':
$mod = 'near';
case 'city':
case 'ls':
$data = trim(preg_replace('/^city[\\s]+/i', '', $data));
$data = trim(preg_replace('/^near[\\s]+/i', '', $data));
if (!$data || $data == 'cities') {
$reply = 'On ' . $server->getName() . ' your cities : ';
foreach ($user->getValue('cities') as $city) {
$reply .= $city->getValue('name') . '@' . $city->getValue('id') . ' ';
}
} else {
if ($mod == 'near') {
foreach ($user->getValue('cities') as $city) {
if ($city->getValue('id') == $data || @preg_match('/^' . $data . '$/i', $city->getValue('name'))) {
$close_upper_bound = intval($city->getValue('id')) + 30000;
$dbcities = mysql_query("SELECT city_id FROM server_cities WHERE server_id=" . $server->getID() . " AND city_id < {$close_upper_bound} ORDER BY city_id DESC LIMIT 10", $db) or die(mysql_error());
$reply = 'On ' . $server->getName() . ' near ' . $city->getValue('name') . '@' . $city->getValue('id') . ' : ';
while ($icity = mysql_fetch_assoc($dbcities)) {
$cityo = new city($icity['city_id']);
$reply .= $cityo->getValue('name') . '@' . $cityo->getValue('id') . ' ';
}
break;
示例2: dirname
<?php
require_once dirname(__FILE__) . '/include/server.php';
require_once dirname(__FILE__) . '/include/invisible_header.php';
if (!$server) {
$server = new server($_REQUEST['server_id']);
}
?>
<head>
<title>The Project - <?php
echo $server->getName();
?>
Rules</title>
<?php
$xhtmlSite->metaType();
?>
<link rel="stylesheet" href="/styles/main.css" type="text/css" media="screen" />
<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>';
示例3: htmlentities
?>
<div style="position:absolute;top:5em;left:250px;">
<object style="border-width:0px;width:490px;height:65px;overflow:hidden;" data="/ads.html" type="text/html"></object>
</div>
<?php
if ($server) {
?>
<div style="position:absolute;top:10em;left:240px;">
<a href="/"><Switch Server></a>
</div>
<?php
}
?>
<div>
<h1 style="display:inline;"><a href="/<?php
if ($_REQUEST['server_id']) {
echo 'server/' . $_REQUEST['server_id'];
}
?>
" rel="home"><img style="width:200px;" src="/images/theprojectlogotext.jpg" alt="The Project" /></a></h1>
<?php
if ($_REQUEST['server_id']) {
echo '<h2 style="display:inline;">' . htmlentities(ucwords($server->getName())) . ' Server</h2> [<a href="/server/' . $_REQUEST['server_id'] . '/rules">rules</a>]';
}
?>
</div>
<?php
if ($server && $server->getWeekLength() && $server->getPreviousWeek() > time()) {
die('<div style="text-align:center;margin-top:2em;">Server restarted, come back in ' . round(($server->getPreviousWeek() - time()) / (60 * 60), 2) . ' hours.</div></body></html>');
}
//end if
示例4: dirname
<?php
require_once dirname(__FILE__) . '/include/user.php';
require_once dirname(__FILE__) . '/include/server.php';
require_once dirname(__FILE__) . '/include/invisible_header.php';
if (!$LOGIN_DATA['user_id']) {
die('Please log in.');
}
if (!$server) {
$server = new server($_REQUEST['server_id']);
}
$current_user = new user($LOGIN_DATA['user_id'], $server);
?>
<head>
<title>The Project - <?php
echo $server->getName();
?>
Leaders</title>
<?php
$xhtmlSite->metaType();
?>
<link rel="stylesheet" href="/styles/main.css" type="text/css" media="screen" />
<link rel="stylesheet" href="/styles/login.css" type="text/css" media="screen" />
<link rel="shortcut icon" href="/favicon.ico" />
</head>
<body>
<?php
require dirname(__FILE__) . '/include/visible_header.php';
echo '<h3>Round Leaders</h3><ol style="list-style-type:none;padding:0px;">';
$close_players = mysql_query("SELECT user_id FROM server_data WHERE server_id=" . $server->getID() . " AND `key`='gold' ORDER BY value DESC LIMIT 50", $db) or die(mysql_error());