コード例 #1
0
ファイル: guilds.php プロジェクト: s3kk/Gesior1.x
        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->getOwner()->getId() == $player->getId()) {
                    $guild_vice = TRUE;
                    $guild_leader = TRUE;
                    $level_in_guild = 3;
                }
            }
            if ($guild_leader) {
                if ($_REQUEST['todo'] == 'save') {
                    $motd = htmlspecialchars(substr(trim($_REQUEST['motd']), 0, $config['site']['guild_motd_chars_limit']));
                    $guild->set('motd', $motd);
                    $guild->save();
                    $saved = TRUE;
                }
                $main_content .= '<center><h2>Change guild MOTD</h2></center>';
                if ($saved) {
                    $main_content .= '<center><font color="red" size="3"><b>CHANGES HAS BEEN SAVED!</b></font></center><br>';
                }
                $main_content .= 'Here you can change MOTD (Message of the Day, showed in game!) of your guild.<BR>';
                $main_content .= '<form enctype="multipart/form-data" action="?subtopic=guilds&guild=' . $guild_id . '&action=changemotd" method="POST">
				<input type="hidden" name="todo" value="save" />
				    <textarea name="motd" cols="60" rows="3">' . $guild->get('motd') . '</textarea><br>
				    (max. ' . $config['site']['guild_motd_chars_limit'] . ' chars) <input type="submit" value="Save MOTD" /></form><br>';
                $main_content .= '<br/><center><form action="?subtopic=guilds&guild=' . $guild_id . '&action=manager" METHOD=post><div class="BigButton" style="background-image:url(' . $layout_name . '/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url(' . $layout_name . '/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Back" alt="Back" src="' . $layout_name . '/images/buttons/_sbutton_back.gif" ></div></div></form></center>';
            } else {
                $guild_errors[] = 'You are not a leader of guild!';