示例#1
0
文件: guilds.php 项目: s3kk/Gesior1.x
                    } else {
                        $upload_errors[] = 'You didn\'t send file or file is too big. Limit: <b>' . $config['site']['guild_image_size_kb'] . ' KB</b>.';
                    }
                    //show errors or save file
                    if (!empty($upload_errors)) {
                        $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 ($upload_errors as $guild_error) {
                            $main_content .= '<li>' . $guild_error;
                        }
                        $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>';
                    } else {
                        $guild->setGuildLogo($info['mime'], file_get_contents($file['tmp_name']));
                        $guild->save();
                    }
                }
                $main_content .= '<center><h2>Change guild logo</h2></center>Here you can change logo of your guild.<BR>Current logo: <img src="' . $guild->getGuildLogoLink() . '" HEIGHT="64" WIDTH="64"><BR><BR>';
                $main_content .= '<form enctype="multipart/form-data" action="?subtopic=guilds&guild=' . $guild_id . '&action=changelogo" method="POST">
				<input type="hidden" name="todo" value="save" />
				<input type="hidden" name="MAX_FILE_SIZE" value="' . $max_image_size_b . '" />
				    Select new logo: <input name="newlogo" type="file" />
				    <input type="submit" value="Send new logo" /></form>Only <b>jpg, gif, png, bmp</b> pictures. Max. size: <b>' . $config['site']['guild_image_size_kb'] . ' KB</b><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!';
            }
        } else {
            $guild_errors[] = 'You are not logged. You can\'t manage guild.';
        }
    }
    if (!empty($guild_errors)) {
        $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/>';
示例#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 {