Exemplo n.º 1
0
//-----------------------------------------------------------------------------//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------//-----------------------------------------------------------------------------
if ($action == 'saveranks') {
    $guild_id = (int) $_REQUEST['guild'];
    if (empty($guild_errors)) {
        $guild = new Guild();
        $guild->load($guild_id);
        if (!$guild->isLoaded()) {
            $guild_errors[] = 'Guild with ID <b>' . $guild_id . '</b> doesn\'t exist.';
        }
    }
    if (empty($guild_errors)) {
        if ($logged) {
            $guild_leader_char = $guild->getOwner();
            $rank_list = $guild->getGuildRanksList();
            $guild_leader = FALSE;
            $account_players = $account_logged->getPlayers();
            foreach ($account_players as $player) {
                if ($guild_leader_char->getId() == $player->getId()) {
                    $guild_vice = TRUE;
                    $guild_leader = TRUE;
                    $level_in_guild = 3;
                }
            }
            if ($guild_leader) {
                foreach ($rank_list as $rank) {
                    $rank_id = $rank->getId();
                    $name = $_REQUEST[$rank_id . '_name'];
                    $level = (int) $_REQUEST[$rank_id . '_level'];
                    if (check_rank_name($name)) {
Exemplo n.º 2
0
        $main_content .= '<div class="SmallBox" >  <div class="MessageContainer" >    <div class="BoxFrameHorizontal" style="background-image:url(' . $layout_name . '/images/content/box-frame-horizontal.gif);" /></div>    <div class="BoxFrameEdgeLeftTop" style="background-image:url(' . $layout_name . '/images/content/box-frame-edge.gif);" /></div>    <div class="BoxFrameEdgeRightTop" style="background-image:url(' . $layout_name . '/images/content/box-frame-edge.gif);" /></div>    <div class="ErrorMessage" >      <div class="BoxFrameVerticalLeft" style="background-image:url(' . $layout_name . '/images/content/box-frame-vertical.gif);" /></div>      <div class="BoxFrameVerticalRight" style="background-image:url(' . $layout_name . '/images/content/box-frame-vertical.gif);" /></div>      <div class="AttentionSign" style="background-image:url(' . $layout_name . '/images/content/attentionsign.gif);" /></div><b>The Following Errors Have Occurred:</b><br/>';
        foreach ($guild_errors as $guild_error) {
            $main_content .= '<li>' . $guild_error . '</li>';
        }
        $main_content .= '</div>    <div class="BoxFrameHorizontal" style="background-image:url(' . $layout_name . '/images/content/box-frame-horizontal.gif);" /></div>    <div class="BoxFrameEdgeRightBottom" style="background-image:url(' . $layout_name . '/images/content/box-frame-edge.gif);" /></div>    <div class="BoxFrameEdgeLeftBottom" style="background-image:url(' . $layout_name . '/images/content/box-frame-edge.gif);" /></div>  </div></div><br>';
        unset($todo);
    }
    if ($todo == 'save') {
        $new_guild = new Guild();
        $new_guild->setCreationData(time());
        $new_guild->setName($new_guild_name);
        $new_guild->setOwner($player);
        $new_guild->setDescription('New guild. Leader must edit this text :)');
        $new_guild->setGuildLogo('image/gif', Website::getFileContents('./images/default_guild_logo.gif'));
        $new_guild->save();
        $ranks = $new_guild->getGuildRanksList(true);
        foreach ($ranks as $rank) {
            if ($rank->getLevel() == 3) {
                $player->setRank($rank);
                $player->save();
            }
        }
        $main_content .= '<TABLE BORDER=0 CELLSPACING=1 CELLPADDING=4 WIDTH=100%><TR BGCOLOR=' . $config['site']['vdarkborder'] . '><TD CLASS=white><B>Create guild</B></TD></TR><TR BGCOLOR=' . $config['site']['darkborder'] . '><TD WIDTH=100%><b>Congratulations!</b><br/>You have created guild <b>' . htmlspecialchars($new_guild_name) . '</b>. <b>' . htmlspecialchars($player->getName()) . '</b> is leader of this guild. Now you can invite players, change picture, description and motd of guild. Press submit to open guild manager.</TD></TR></TABLE><br/><TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0 WIDTH=100%><FORM ACTION="?subtopic=guilds&action=show&guild=' . $new_guild->getId() . '" METHOD=post><TR><TD><center><INPUT TYPE=image NAME="Submit" ALT="Submit" SRC="' . $layout_name . '/images/buttons/sbutton_submit.gif" BORDER=0 WIDTH=120 HEIGHT=18></center></TD></TR></FORM></TABLE>';
    } else {
        $main_content .= 'To play on ' . $config['server']['serverName'] . ' you need an account. 
		All you have to do to create your new account is to enter your email address, password to new account, verification code from picture and to agree to the terms presented below. 
		If you have done so, your account number, password and e-mail address will be shown on the following page and your account and password will be sent 
		to your email address along with further instructions.<BR><BR>
		<FORM ACTION="?subtopic=guilds&action=createguild&todo=save" METHOD=post>
		<TABLE WIDTH=100% BORDER=0 CELLSPACING=1 CELLPADDING=4>
		<TR><TD BGCOLOR="' . $config['site']['vdarkborder'] . '" CLASS=white><B>Create an ' . htmlspecialchars($config['server']['serverName']) . ' Account</B></TD></TR>