Beispiel #1
0
    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>
		<TR><TD BGCOLOR="' . $config['site']['darkborder'] . '"><TABLE BORDER=0 CELLSPACING=8 CELLPADDING=0>
		  <TR><TD>
		    <TABLE BORDER=0 CELLSPACING=5 CELLPADDING=0>';
        $main_content .= '<TR><TD width="150" valign="top"><B>Leader: </B></TD><TD><SELECT name="name">';
        if (count($array_of_player_nig) > 0) {
            sort($array_of_player_nig);
            foreach ($array_of_player_nig as $nick) {
Beispiel #2
0
         $main_content .= "<s>Canceled invitation</s><br />Sent invite on " . date("M d Y, H:i:s", $war['declaration_date']) . ", canceled on " . date("M d Y, H:i:s", $war['end_date']) . ".";
         break;
     case 2:
         $main_content .= "Rejected invitation<br />Invited on " . date("M d Y, H:i:s", $war['declaration_date']) . ", rejected on " . date("M d Y, H:i:s", $war['end_date']) . ".";
         break;
     case 1:
         $main_content .= "<span style=\"color: red;\"><font size=\"5\">" . $war['guild_frags'] . " : " . $war['opponent_frags'] . "</font><br /><br /><b>On a brutal war</b></span><br />Began on " . date("M d Y, H:i:s", $war['declaration_date']) . ($war['end_date'] > 1471497823 ? ", will end up at " . date("M d Y, H:i:s", $war['end_date']) : "") . ".<br />The frag limit is set to " . $war['frag_limit'] . " frags, " . ($war['guild_fee'] > 0 ? "with payment of " . $war['guild_fee'] . " gold coins." : "without any payment.");
         break;
     case 5:
         $main_content .= "<i>Ended</i><br />Began on " . date("M d Y, H:i:s", $war['declaration_date']) . ", ended on " . date("M d Y, H:i:s", $war['end_date']) . ". Frag statistics: " . $war['guild_frags'] . " to " . $war['opponent_frags'] . ".";
         break;
     default:
         $main_content .= "Unknown, please contact with gamemaster.";
         break;
 }
 $main_content .= "<br /><br /><a onclick=\"show_hide('war-details:" . $war['id'] . "'); return false;\" style=\"cursor: pointer;\">&raquo; Details &laquo;</a></td>\n<td align=\"center\"><a href=\"?subtopic=guilds&action=show&guild=" . $e->getId() . "\"><img src=\"" . $e->getGuildLogoLink() . "\" width=\"64\" height=\"64\" border=\"0\"/><br />" . htmlspecialchars($e->getName()) . "</a></td>\n</tr>\n<tr id=\"war-details:" . $war['id'] . "\" style=\"display: none; background: " . (is_int($count / 2) ? $config['site']['darkborder'] : $config['site']['lightborder']) . ";\">\n<td colspan=\"3\">";
 if (in_array($war['status'], array(1, 4, 5))) {
     $deaths = $SQL->query('SELECT ' . $SQL->tableName('pd') . '.' . $SQL->fieldName('id') . ', ' . $SQL->tableName('pd') . '.' . $SQL->fieldName('date') . ', ' . $SQL->tableName('gk') . '.' . $SQL->fieldName('guild_id') . ' AS ' . $SQL->fieldName('enemy') . ', ' . $SQL->tableName('p') . '.' . $SQL->fieldName('name') . ', ' . $SQL->tableName('pd') . '.' . $SQL->fieldName('level') . ' FROM ' . $SQL->tableName('guild_kills') . ' gk LEFT JOIN ' . $SQL->tableName('player_deaths') . ' pd ON ' . $SQL->tableName('gk') . '.' . $SQL->fieldName('death_id') . ' = ' . $SQL->tableName('pd') . '.' . $SQL->fieldName('id') . ' LEFT JOIN ' . $SQL->tableName('players') . ' p ON ' . $SQL->tableName('pd') . '.' . $SQL->fieldName('player_id') . ' = ' . $SQL->tableName('p') . '.' . $SQL->fieldName('id') . ' WHERE ' . $SQL->tableName('gk') . '.' . $SQL->fieldName('war_id') . ' = ' . $SQL->quote($war['id']) . ' AND ' . $SQL->tableName('p') . '.' . $SQL->fieldName('deleted') . ' = 0 ORDER BY ' . $SQL->tableName('pd') . '.' . $SQL->fieldName('date') . ' DESC')->fetchAll();
     if (!empty($deaths)) {
         foreach ($deaths as $death) {
             $killers = $SQL->query('SELECT ' . $SQL->tableName('p') . '.' . $SQL->fieldName('name') . ' AS ' . $SQL->fieldName('player_name') . ', ' . $SQL->tableName('p') . '.' . $SQL->fieldName('deleted') . ' AS ' . $SQL->fieldName('player_exists') . ', ' . $SQL->fieldName('k') . '.' . $SQL->fieldName('war') . ' AS ' . $SQL->fieldName('is_war') . ' FROM ' . $SQL->fieldName('killers') . ' k LEFT JOIN ' . $SQL->tableName('player_killers') . ' pk ON ' . $SQL->tableName('k') . '.' . $SQL->fieldName('id') . ' = ' . $SQL->tableName('pk') . '.' . $SQL->fieldName('kill_id') . ' LEFT JOIN ' . $SQL->tableName('players') . ' p ON ' . $SQL->tableName('p') . '.' . $SQL->fieldName('id') . ' = ' . $SQL->tableName('pk') . '.' . $SQL->fieldName('player_id') . ' WHERE ' . $SQL->tableName('k') . '.' . $SQL->fieldName('death_id') . ' = ' . $SQL->quote($death['id']) . ' ORDER BY ' . $SQL->tableName('k') . '.' . $SQL->fieldName('final_hit') . ' DESC, ' . $SQL->tableName('k') . '.' . $SQL->fieldName('id') . ' ASC')->fetchAll();
             $count = count($killers);
             $i = 0;
             $others = false;
             $main_content .= date("j M Y, H:i", $death['date']) . " <span style=\"font-weight: bold; color: " . ($death['enemy'] == $war['guild_id'] ? "red" : "lime") . ";\">+</span>\n<a href=\"?subtopic=characters&name=" . urlencode($death['name']) . "\"><b>" . htmlspecialchars($death['name']) . "</b></a> ";
             foreach ($killers as $killer) {
                 $i++;
                 if ($killer['is_war'] != 0) {
                     if ($i == 1) {
                         $main_content .= "killed at level <b>" . $death['level'] . "</b> by ";
                     } else {