function AllyPage_Home()
{
    global $GlobalUser;
    global $session;
    global $ally;
    $now = time();
    $members = CountAllyMembers($ally['ally_id']);
    $rank = LoadRank($GlobalUser['ally_id'], $GlobalUser['allyrank']);
    $result = EnumApplications($ally['ally_id']);
    $apps = dbrows($result);
    ?>
<script src="js/cntchar.js" type="text/javascript"></script><script src="js/win.js" type="text/javascript"></script>
<?php 
    if ($ally['imglogo'] !== "") {
        ?>
<tr><th colspan=2><img src="/game/img/preload.gif" class="reloadimage" title="pic.php?url=<?php 
        echo $ally['imglogo'];
        ?>
"></td></tr>
<?php 
    }
    ?>
<table width=519>
<tr><td class=c colspan=2>Ваш альянс</td></tr>
<tr><th>Аббревиатура</th><th><?php 
    echo $ally['tag'];
    if ($now < $ally['tag_until']) {
        echo " (бывш. " . $ally['old_tag'] . ")";
    }
    ?>
</th></tr>
<tr><th>Имя</th><th><?php 
    echo $ally['name'];
    if ($now < $ally['name_until']) {
        echo " (бывш. " . $ally['old_name'] . ")";
    }
    ?>
</th></tr>
<tr><th>Члены</th><th><?php 
    echo $members;
    if ($rank['rights'] & 0x8) {
        echo " (<a href=\"index.php?page=allianzen&session={$session}&a=4\">список членов</a>)";
    }
    ?>
</th></tr>
<tr><th>Ваш ранг</th><th><?php 
    echo $rank['name'];
    if ($rank['rights'] & 0x20) {
        echo " (<a href=\"index.php?page=allianzen&session={$session}&a=5\">управление альянсом</a>)";
    }
    ?>
</th></tr>
<?php 
    if ($apps > 0) {
        ?>
<tr><th>Заявки</th><th><a href="index.php?page=bewerbungen&session=<?php 
        echo $session;
        ?>
"><?php 
        echo $apps;
        ?>
 Заявление (-я)</a></th></tr>
<?php 
    }
    if ($rank['rights'] & 0x80) {
        ?>
<tr><th>Общее сообщение</th><th><a href="index.php?page=allianzen&session=<?php 
        echo $session;
        ?>
&a=17">Послать общее сообщение</a></th></tr>
<?php 
    }
    ?>
<tr><th colspan=2 height=100><?php 
    echo bb($ally['exttext']);
    ?>
</th></tr>
<tr><th>Домашняя страница</th><th><a href="redir.php?url=<?php 
    echo $ally['homepage'];
    ?>
" target="_blank"><?php 
    echo $ally['homepage'];
    ?>
</a></th></tr>
<tr><td class=c colspan=2>Внутренняя компетенция</th></tr><tr><th colspan=2 height=100><?php 
    echo bb($ally['inttext']);
    ?>
</th></tr>
</table><br>
<?php 
    if ($GlobalUser['allyrank'] != 0) {
        ?>
<table width=519>
<form action="index.php?page=allianzen&session=<?php 
        echo $session;
        ?>
&a=3" method=POST>
<tr><td class=c colspan=2>Покинуть этот альянс</td></tr><tr><th colspan=2><input type=submit value="Да!"></th></tr></table></form>
<?php 
    }
}
Esempio n. 2
0
<?php

// Описание альянса.
// Попытаться получить сессию из реферера.
//echo $_SERVER['HTTP_REFERER'];
$now = time();
$allyid = intval($_GET['allyid']);
$ally = LoadAlly($allyid);
$members = CountAllyMembers($ally['ally_id']);
?>

<html> 
 <head> 
  <link rel='stylesheet' type='text/css' href='css/default.css' />
  <link rel="stylesheet" type="text/css" href="<?php 
echo UserSkin();
?>
formate.css" />
  <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
  <link rel="stylesheet" type="text/css" href="css/combox.css">
  
  <script language="JavaScript">
function onBodyLoad() {
    window.setTimeout("reloadImages()", 100);
}

function reloadImages() {
    for (var i = 0; i < document.images.length; ++i) {
      if ((document.images[i].className == 'reloadimage') && (document.images[i].title != "")) {
        document.images[i].src = document.images[i].title;
      }
Esempio n. 3
0
                 $stat .= "<span class='vacation'>РО</span>";
                 $pstat = "vacation";
             }
         }
     }
     echo "<span class=\"{$pstat}\">" . $user['oname'] . "</span></a>\n";
     if ($pstat !== "normal") {
         echo "({$stat})\n";
     }
 }
 echo "</th>\n";
 // Альянс
 if ($user['ally_id'] && !($planet['type'] == 10001 || $planet['type'] == 10004)) {
     $ally = LoadAlly($user['ally_id']);
     $allytext = "<a style=\"cursor:pointer\"\n";
     $allytext .= "         onmouseover=\"return overlib('<table width=240 ><tr><td class=c >Альянс " . $ally['tag'] . ". Место в рейтинге - " . $ally['place1'] . ", численность - " . CountAllyMembers($user['ally_id']) . " чел.</td></tr><th><table><tr><td><a href=ainfo.php?allyid=" . $ally['ally_id'] . " target=_ally>Представление альянса</a></td></tr><tr><td><a href=index.php?page=statistics&session={$session}&start=" . (floor($ally['place1'] / 100) * 100 + 1) . "&who=ally >Статистика</a></td></tr></table></th></table>', STICKY, MOUSEOFF, DELAY, 750, CENTER, OFFSETY, -50 );\" onmouseout=\"return nd();\">\n";
     $allytext .= "   " . $ally['tag'] . " </a>";
 } else {
     $allytext = "";
 }
 echo "<th width=\"80\">{$allytext}</th>\n";
 // Действия
 echo "<th width=\"125\" style='white-space: nowrap;'>\n";
 if (!($planet['type'] == 10001 || $planet['type'] == 10004) && !$own) {
     echo "<a style=\"cursor:pointer\" onclick=\"javascript:doit(6, " . $planet['g'] . "," . $planet['s'] . "," . $planet['p'] . ", 1, " . $GlobalUser['maxspy'] . ");\"><img src=\"" . UserSkin() . "img/e.gif\" border=\"0\" alt=\"Шпионаж\" title=\"Шпионаж\" /></a>\n";
     echo "<a href=\"index.php?page=writemessages&session=" . $_GET['session'] . "&messageziel=" . $planet['owner_id'] . "\"><img src=\"" . UserSkin() . "img/m.gif\" border=\"0\" alt=\"Написать сообщение\" title=\"Написать сообщение\" /></a>\n";
     echo "<a href=\"index.php?page=buddy&session=" . $_GET['session'] . "&action=7&buddy_id=" . $planet['owner_id'] . "\"><img src=\"" . UserSkin() . "img/b.gif\" border=\"0\" alt=\"Предложение подружиться\" title=\"Предложение подружиться\" /></a>\n";
     if ($show_ipm_button) {
         echo "<a href=\"index.php?page=galaxy&session={$session}&mode=1&p1=" . $planet['g'] . "&p2=" . $planet['s'] . "&p3=" . $planet['p'] . "&pdd=" . $planet['planet_id'] . "&zp=" . $planet['owner_id'] . "\"><img src=\"" . UserSkin() . "img/r.gif\" border=\"0\" alt=\"Ракетная атака\" title=\"Ракетная атака\" /></a>";
     }
 }
function PageAlly_MemberSettings()
{
    global $db_prefix;
    global $session;
    global $ally;
    global $GlobalUser;
    global $AllianzenError;
    $selected_user = 0;
    if (key_exists('u', $_GET)) {
        $selected_user = intval($_GET['u']);
    }
    if (method() === "GET" && $_GET['a'] == 13 && $selected_user) {
        $leaver = LoadUser($selected_user);
        $query = "UPDATE " . $db_prefix . "users SET ally_id = 0 WHERE player_id = {$selected_user}";
        dbquery($query);
        // Разослать сообщения членам альянса об исключении игрока
        $result = EnumerateAlly($ally['ally_id']);
        $rows = dbrows($result);
        while ($rows--) {
            $user = dbarray($result);
            SendMessage($user['player_id'], va("Альянс [#1]", $ally['tag']), "Общее сообщение", va("Игрок #1 исключён из альянса.", $leaver['oname']), 0);
        }
        // Сообщение игроку об исключении.
        SendMessage($leaver['player_id'], va("Альянс [#1]", $ally['tag']), va("Членство в альянсе [#1] окончено", $ally['tag']), va("Игрок #1 исключает Вас из альянса [#2] .<br>Теперь Вы можете зарегистрироваться снова", $GlobalUser['oname'], $ally['tag']), 0);
    }
    if (method() === "POST" && $_GET['a'] == 16 && $selected_user) {
        $newrank = intval($_POST['newrang']);
        $query = "UPDATE " . $db_prefix . "users SET allyrank = {$newrank} WHERE player_id = {$selected_user}";
        dbquery($query);
    }
    $now = time();
    $members = CountAllyMembers($ally['ally_id']);
    $sort1 = intval($_GET['sort1']);
    $sort2 = intval($_GET['sort2']) ^ 1;
    ?>
<script src="js/cntchar.js" type="text/javascript"></script><script src="js/win.js" type="text/javascript"></script><br>
<a href="index.php?page=allianzen&session=<?php 
    echo $session;
    ?>
&a=5">Назад к обзору</a>
<table width=519>
<tr><td class='c' colspan='10'>Список членов (кол-во: <?php 
    echo $members;
    ?>
)</td></tr>
<tr>
    <th>N</th>
    <th><a href="index.php?page=allianzen&session=<?php 
    echo $session;
    ?>
&a=7&sort1=1&sort2=<?php 
    echo $sort2;
    ?>
">Имя</a></th>
    <th> </th>
    <th><a href="index.php?page=allianzen&session=<?php 
    echo $session;
    ?>
&a=7&sort1=2&sort2=<?php 
    echo $sort2;
    ?>
">Статус</a></th>
    <th><a href="index.php?page=allianzen&session=<?php 
    echo $session;
    ?>
&a=7&sort1=3&sort2=<?php 
    echo $sort2;
    ?>
">Очки</a></th>
    <th><a href="index.php?page=allianzen&session=<?php 
    echo $session;
    ?>
&a=7&sort1=0&sort2=<?php 
    echo $sort2;
    ?>
">Координаты</a></th>
    <th><a href="index.php?page=allianzen&session=<?php 
    echo $session;
    ?>
&a=7&sort1=4&sort2=<?php 
    echo $sort2;
    ?>
">Вступление</a></th>
    <th><a href="index.php?page=allianzen&session=<?php 
    echo $session;
    ?>
&a=7&sort1=5&sort2=<?php 
    echo $sort2;
    ?>
">Неактивный</a></th>
    <th>Функция</th></tr>

<?php 
    $result = EnumerateAlly($ally['ally_id'], intval($_GET['sort1']), intval($_GET['sort2']));
    for ($i = 0; $i < $members; $i++) {
        $user = dbarray($result);
        $rank = LoadRank($user['ally_id'], $user['allyrank']);
        $hplanet = GetPlanet($user['hplanetid']);
        $days = floor(($now - $user['lastclick']) / (60 * 60 * 24));
        echo "<tr>";
        echo "<th>" . ($i + 1) . "</th>";
        echo "<th>" . $user['oname'] . "</th>";
        if ($GlobalUser['player_id'] != $user['player_id']) {
            echo "<th><a href=\"index.php?page=writemessages&session={$session}&messageziel=" . $user['player_id'] . "\"><img src=\"" . UserSkin() . "img/m.gif\" border=0 alt=\"Написать сообщение\"></a></th>";
        } else {
            echo "<th></th>";
        }
        echo "<th>" . $rank['name'] . "</th>";
        echo "<th>" . nicenum($user['score1'] / 1000) . "</th>";
        echo "<th><a href=\"index.php?page=galaxy&galaxy=" . $hplanet['g'] . "&system=" . $hplanet['s'] . "&position=" . $hplanet['p'] . "&session={$session}\" >[" . $hplanet['g'] . ":" . $hplanet['s'] . ":" . $hplanet['p'] . "]</a></th>";
        echo "<th>" . date("Y-m-d H:i:s", $user['joindate']) . "</th>";
        echo "<th>" . $days . "d</th>";
        if ($user['allyrank'] > 0) {
            echo "<th>";
            echo "<a onmouseover='return overlib(\"<font color=white>Выгнать игрока</font>\", WIDTH, 100);' onmouseout='return nd();' alt='Выгнать игрока' href='javascript:if(confirm(\"Вы уверены, что игрок " . $user['oname'] . " должен покинуть альянс?\"))document.location=\"index.php?page=allianzen&session={$session}&a=13&u=" . $user['player_id'] . "\"';>";
            echo "<img src='" . UserSkin() . "pic/abort.gif' alt='Выгнать игрока' border='0' ></a>";
            echo "<a onmouseover=\"return overlib('<font color=white>Назначить ранг</font>', WIDTH, 100);\" onmouseout='return nd();' alt='Назначить ранг' href=\"index.php?page=allianzen&session={$session}&a=7&u=" . $user['player_id'] . "\">";
            echo "<img src=\"" . UserSkin() . "pic/key.gif\" alt='Назначить ранг' border=0></a>&nbsp;&nbsp;&nbsp;&nbsp;";
            echo "</th>";
            echo "</tr>\n";
            if ($user['player_id'] == $selected_user) {
                $rank_result = EnumRanks($ally['ally_id']);
                $rows = dbrows($rank_result);
                echo "<form action=\"index.php?page=allianzen&session={$session}&a=16&u={$selected_user}\" method=POST><tr><th colspan=3>Ранг для " . $user['oname'] . ":</th><th><select name=\"newrang\">";
                while ($rows--) {
                    $user_rank = dbarray($rank_result);
                    if ($user_rank['rank_id'] == 0) {
                        continue;
                    }
                    echo "<option value=\"" . $user_rank['rank_id'] . "\"";
                    if ($user_rank['rank_id'] == $user['allyrank']) {
                        echo " SELECTED";
                    }
                    echo ">" . $user_rank['name'] . "\n";
                }
                echo "</th><th colspan=5><input type=submit value=\"Сохранить\"></th></tr></form>\n";
            }
        } else {
            echo "<th>&nbsp;</th></tr>\n";
        }
    }
    ?>

</table>
<?php 
}