本文整理汇总了PHP中loca函数的典型用法代码示例。如果您正苦于以下问题:PHP loca函数的具体用法?PHP loca怎么用?PHP loca使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了loca函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: mainmenu
function mainmenu($select)
{
if ($select == 'home') {
echo " <div class=\"menupoint\">" . loca("MENU_START") . "</div>\n";
} else {
echo " <a href=\"home.php\">" . loca("MENU_START") . "</a>\n";
}
if ($select == 'about') {
echo " <div class=\"menupoint\">" . loca("MENU_ABOUT") . "</div>\n";
} else {
echo " <a href=\"about.php\">" . loca("MENU_ABOUT") . "</a>\n";
}
if ($select == 'preview') {
echo " <div class=\"menupoint\">" . loca("MENU_PICTURES") . "</div>\n";
} else {
echo " <a href=\"screenshots.php\">" . loca("MENU_PICTURES") . "</a>\n";
}
if ($select == 'reg') {
echo ' <div class="menupoint">' . loca("MENU_REG") . "</div>\n";
} else {
echo " <a href=\"register.php\">" . loca("MENU_REG") . "</a>\n";
}
if ($select == 'board') {
echo ' <div class="menupoint">' . loca("MENU_BOARD") . "</div>\n";
} else {
echo " <a href=\"" . loca("BOARDADDR") . "\" target=_top>" . loca("MENU_BOARD") . "</a>\n";
}
if ($select == 'wiki') {
echo ' <div class="menupoint">' . loca("MENU_WIKI") . "</div>\n";
} else {
echo " <a href=\"" . loca("WIKIADDR") . "\" target=_top>" . loca("MENU_WIKI") . "</a>\n";
}
}
示例2: UpdateNote
function UpdateNote($player_id, $note_id, $subj, $text, $prio)
{
global $db_prefix, $loca_lang;
// Чужие заметки трогать нельзя
$note = LoadNote($player_id, $note_id);
if ($note['owner_id'] != $player_id) {
return;
}
$user = LoadUser($player_id);
$loca_lang = $user['lang'];
loca_add("notes", $user['lang']);
// Проверить параметры.
if ($subj === "") {
$subj = loca("NOTE_NO_SUBJ");
}
if ($text === "") {
$text = loca("NOTE_NO_TEXT");
}
$text = mb_substr($text, 0, 5000, "UTF-8");
$subj = mb_substr($subj, 0, 30, "UTF-8");
if ($prio < 0) {
$prio = 0;
}
if ($prio > 2) {
$prio = 2;
}
$query = "UPDATE " . $db_prefix . "notes SET subj = '" . $subj . "', text = '" . $text . "', textsize = '" . mb_strlen($text, "UTF-8") . "', prio = '" . $prio . "', date = '" . time() . "' WHERE owner_id = {$player_id} AND note_id = {$note_id}";
dbquery($query);
}
示例3: OfficerLeft
function OfficerLeft($qcmd)
{
global $GlobalUser;
$now = time();
$end = GetOfficerLeft($GlobalUser['player_id'], $qcmd);
if ($end <= $now) {
return loca("PREM_INACTIVE");
} else {
$d = ceil(($end - $now) / (60 * 60 * 24));
return va(loca("PREM_ACTIVE"), $d);
}
}
示例4: ScreenShotName
function ScreenShotName($pic)
{
switch ($pic) {
case "overview":
return loca("PICS_WALL1");
case "buildings":
return loca("PICS_WALL2");
case "shipyard":
return loca("PICS_WALL3");
case "empire":
return loca("PICS_WALL4");
}
return "";
}
示例5: FleetMissionText
function FleetMissionText($num)
{
if ($num >= 200) {
$desc = "<a title=\"На планете\">(Д)</a>";
$num -= 200;
} else {
if ($num >= 100) {
$desc = "<a title=\"Возвращение к планете\">(В)</a>";
$num -= 100;
} else {
$desc = "<a title=\"Уход на задание\">(У)</a>";
}
}
echo " <a title=\"\">" . loca("FLEET_ORDER_{$num}") . "</a>\n{$desc}\n";
}
示例6: EditNote
function EditNote($note_id)
{
global $GlobalUser;
$note = LoadNote($GlobalUser['player_id'], $note_id);
if ($note == NULL) {
echo loca("NOTE_CANT_DO");
return;
}
$u = array("", "", "");
$u[$note['prio']] = " SELECTED";
echo "<form action=\"?page=notizen&session=" . $_GET['session'] . "\" method=post>\n";
echo "<input type=hidden name=s value=2>\n";
echo "<input type=hidden name=n value=" . $note['note_id'] . ">\n";
echo "<table width=519>\n";
echo "<tr><td class=c colspan=2>" . loca("NOTE_EDIT") . "</td></tr>\n";
echo "<tr><th>" . loca("NOTE_PRIORITY") . "</th><th><select name=u><option value=2" . $u[2] . ">" . loca("NOTE_PRIO_2") . "</option><option value=1" . $u[1] . ">" . loca("NOTE_PRIO_1") . "</option><option value=0" . $u[0] . ">" . loca("NOTE_PRIO_0") . "</option></select></th></tr>\n";
echo "<tr><th>" . loca("NOTE_EDIT_SUBJ") . "</th><th><input type=text name=betreff size=30 maxlength=30 value='" . stripslashes($note['subj']) . "'></th></tr>\n";
echo "<tr><th>" . loca("NOTE_EDIT_TEXT") . " (<span id=\"cntChars\">" . $note['textsize'] . "</span> / 5000 " . loca("NOTE_CHARS") . ")</th><th><textarea name=text cols=60 rows=10 onkeyup=\"javascript:cntchar(5000)\">" . stripslashes($note['text']) . "</textarea></th></tr>\n";
echo "<tr><td class=c><a href=?page=notizen&session=" . $_GET['session'] . ">" . loca("NOTE_BACK") . "</a></td><td class=c><input type=reset value='" . loca("NOTE_RESET") . "'><input type=submit value='" . loca("NOTE_APPLY") . "'></td></tr>\n";
echo "</table></form><br><br><br><br>\n";
}
示例7: Admin_Users
//.........这里部分代码省略.........
<?php
$oname = array('Командир ОГейма', 'Адмирал', 'Инженер', 'Геолог', 'Технократ');
$odesc = array('', '<font size=1 color=skyblue>&nbsp;Макс. кол-во флотов +2</font>', '<font size=1 color=skyblue>Сокращает вдвое потери в обороне+10% больше энергии</font>', '<font size=1 color=skyblue>+10% доход от шахты</font>', '<font size=1 color=skyblue>+2 уровень шпионажа, 25% меньше времени на исследования</font>');
$qname = array('CommanderOff', 'AdmiralOff', 'EngineerOff', 'GeologeOff', 'TechnocrateOff');
$imgname = array('commander', 'admiral', 'ingenieur', 'geologe', 'technokrat');
$now = time();
foreach ($qname as $i => $qcmd) {
$end = GetOfficerLeft($user['player_id'], $qname[$i]);
$img = "";
if ($end <= $now) {
$img = "_un";
$days = "";
} else {
$d = ($end - $now) / (60 * 60 * 24);
if ($d > 0) {
$days = "<font color=lime>Активен</font> ещё " . ceil($d) . " д.";
}
}
echo " <td align='center' width='35' class='header'>\n";
echo "\t<img border='0' src='img/" . $imgname[$i] . "_ikon" . $img . ".gif' width='32' height='32' alt='" . $oname[$i] . "'\n";
echo "\tonmouseover=\"return overlib('<center><font size=1 color=white><b>" . $days . "<br>" . $oname[$i] . "</font><br>" . $odesc[$i] . "<br></b></center>', LEFT, WIDTH, 150);\" onmouseout='return nd();'>\n";
echo " </td> <td><input type=\"text\" name=\"" . $qname[$i] . "\" size=\"3\" /></td>\n\n";
}
?>
</tr></table></th></tr>
<tr><th colspan=2><i>Чтобы продлить офицера укажите необходимое количество дней в полях ввода</i></th></tr>
</table></th>
<th valign=top><table>
<?php
foreach ($resmap as $i => $gid) {
echo "<tr><th>" . loca("NAME_{$gid}") . "</th><th><input type=\"text\" size=3 name=\"r{$gid}\" value=\"" . $user["r{$gid}"] . "\" /></th></tr>\n";
}
?>
<tr><th>Найденная Тёмная Материя</th><th><input type="text" size=5 name="dmfree" value="<?php
echo $user['dmfree'];
?>
" /></th></tr>
<tr><th>Покупная Тёмная Материя</th><th><input type="text" size=5 name="dm" value="<?php
echo $user['dm'];
?>
" /></th></tr>
</table></th>
<tr><th colspan=3><input type="submit" value="Сохранить" /></th></tr>
</form>
</table>
<br>
<table>
<form action="index.php?page=admin&session=<?php
echo $session;
?>
&mode=Users&action=create_planet&player_id=<?php
echo $user['player_id'];
?>
" method="POST" >
<tr><td class=c colspan=20>Список планет</td></tr>
<tr>
<?php
$query = "SELECT * FROM " . $db_prefix . "planets WHERE owner_id = '" . intval($_GET['player_id']) . "' ORDER BY g ASC, s ASC, p ASC, type DESC";
$result = dbquery($query);
$rows = dbrows($result);
$counter = 0;
while ($rows--) {
示例8: GetShipyardQueue
$result = GetShipyardQueue($aktplanet['planet_id']);
$rows = dbrows($result);
if ($rows) {
$first = true;
$c = "";
$b = "";
$a = "";
$total_time = 0;
while ($rows--) {
$queue = dbarray($result);
if ($first) {
$g = $now - $queue['start'];
$first = false;
}
$c .= $queue['end'] - $queue['start'] . ",";
$b .= "\"" . loca("NAME_" . $queue['obj_id']) . "\",";
$a .= "\"" . $queue['level'] . "\",";
$total_time += ($queue['end'] - $queue['start']) * $queue['level'];
}
$total_time -= $g;
?>
<br>Сейчас производится: <div id="bx" class="z"></div>
<!-- JAVASCRIPT -->
<script type="text/javascript">
v = new Date();
p = 0;
g = <?php
echo $g;
?>
示例9: Admin_Fleetlogs
//.........这里部分代码省略.........
?>
</th>
<th <?php
echo $style;
?>
>
<?php
$planet = GetPlanet($fleet_obj['start_planet']);
$user = LoadUser($planet['owner_id']);
echo AdminPlanetName($planet) . " " . AdminPlanetCoord($planet) . " <br>";
echo AdminUserName($user);
?>
</th>
<th <?php
echo $style;
?>
>
<?php
$planet = GetPlanet($fleet_obj['target_planet']);
$user = LoadUser($planet['owner_id']);
echo AdminPlanetName($planet) . " " . AdminPlanetCoord($planet) . " <br>";
echo AdminUserName($user);
?>
</th>
<th <?php
echo $style;
?>
>
<?php
$fleetmap = array(202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215);
foreach ($fleetmap as $i => $gid) {
$amount = $fleet_obj["ship" . $gid];
if ($amount > 0) {
echo loca("NAME_{$gid}") . ":" . nicenum($amount) . " ";
}
}
?>
</th>
<th <?php
echo $style;
?>
>
<?php
$total = $fleet_obj['m'] + $fleet_obj['k'] + $fleet_obj['d'];
if ($total > 0) {
echo "М: " . nicenum($fleet_obj['m']) . "<br>";
echo "К: " . nicenum($fleet_obj['k']) . "<br>";
echo "Д: " . nicenum($fleet_obj['d']);
} else {
echo "-";
}
?>
</th>
<th <?php
echo $style;
?>
>
<?php
echo nicenum($fleet_obj['fuel']);
?>
</th>
<th <?php
echo $style;
?>
>
<?php
示例10: loca
<div id="overDiv" style="position:absolute; visibility:hidden; z-index:1000;"></div>
<div class="mybody">
<form action="fa_pass.php" method="post">
<div align="center">
<h2><?php
echo loca("REG_MAIL_SEND");
?>
</h2>
<?php
echo loca("REG_MAIL_NOTE");
?>
<table align="center">
<tr>
<td><?php
echo loca("REG_MAIL_EMAIL");
?>
</td>
<td><input type="text" name="email"></td>
</tr>
<tr>
<td></td>
<td><input type="submit" name="send_pass" value="<?php
echo loca("REG_MAIL_SUBMIT");
?>
"></td>
</tr>
</table>
</form>
</body>
</html>
示例11: date
<tr height="20">
<th>Время возврата</th><th><?php
echo date("D M j G:i:s", $queue['end'] + $flighttime + $hold_time);
?>
</th>
</tr>
<tr height="20">
<td class="c" colspan="2">Корабли</td>
</tr>
<?php
// Список кораблей.
foreach ($fleet as $id => $amount) {
if ($amount > 0) {
echo " <tr height=\"20\">\n";
echo " <th width=\"50%\">" . loca("NAME_{$id}") . "</th><th>" . nicenum($amount) . "</th>\n";
echo " </tr>\n";
}
}
}
?>
</table>
<br><br><br><br>
</center>
</div>
<!-- END CONTENT AREA -->
<?php
PageFooter("", $PageError);
ob_end_flush();
示例12: foreach
]</a> </td>
</tr>
<tr>
<td class="c">
Кол-во ракет (<?php
echo $aktplanet["d503"];
?>
в наличии): <input type="text" name="anz" size="2" maxlength="2" /></td>
<td class="c">
Цель:
<select name="pziel">
<option value="0" selected>Все</option>
<?php
foreach ($defmap as $i => $gid) {
echo " <option value=\"{$gid}\">" . loca("NAME_{$gid}") . "</option>\n";
}
?>
</select>
</td>
</tr>
<tr>
<td class="c" colspan="2"><input type="submit" name="aktion" value="Атаковать"></td>
</tr>
</table>
</form>
<?php
}
/***** Заголовок таблицы *****/
示例13: rapidOut
function rapidOut($gid, $n)
{
return "<br/>Одним залпом поражает: <a href=\"index.php?page=infos&session=" . $_GET['session'] . "&gid={$gid}\">" . loca("NAME_{$gid}") . "</a> - <font color=\"lime\">{$n}</font> единиц\n";
}
示例14: DumpFleet
function DumpFleet($fleet)
{
$fleetmap = array(202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215);
$result = "";
foreach ($fleetmap as $i => $gid) {
$amount = $fleet[$gid];
if ($amount != 0) {
$result .= loca("NAME_{$gid}") . " " . nicenum($amount) . " ";
}
}
return $result;
}
示例15: RenamePlanet
function RenamePlanet($planet_id, $name)
{
// Найти планету.
global $db_prefix;
$query = "SELECT * FROM " . $db_prefix . "planets WHERE planet_id = '" . $planet_id . "'";
$result = dbquery($query);
if (dbrows($result) == 0) {
return;
}
// Планета не найдена
$planet = dbarray($result);
// Проверить название.
if ($planet['type'] == 0) {
$name = mb_substr($name, 0, 20 - mb_strlen(" (Луна)", "UTF-8"), "UTF-8");
} else {
$name = mb_substr($name, 0, 20, "UTF-8");
}
$pattern = '/[;,<>\\`]/';
if (preg_match($pattern, $name)) {
return;
}
// Запрещенные символы.
$pattern = '/[\\\\()*\\"\']/';
$name = preg_replace($pattern, '', $name);
$name = trim($name);
if (strlen($name) == 0) {
if ($planet['type'] == 0) {
$name = "Луна";
} else {
$name = "планета";
}
} else {
$name = preg_replace('/\\s\\s+/', ' ', $name);
// Вырезать лишние пробелы.
// Если планета -- луна, то добавить приставку.
if ($planet['type'] == 0) {
$name .= " (" . loca("MOON") . ")";
}
}
// Если всё нормально - сменить имя планеты.
$query = "UPDATE " . $db_prefix . "planets SET name = '" . $name . "' WHERE planet_id = {$planet_id}";
dbquery($query);
}