Ejemplo n.º 1
0
function logbook_pagination($start, $n_count, $n_per_page)
{
    global $game;
    $page_html = '';
    $n_pages = ceil($n_count / $n_per_page);
    $current_page = $start > 0 ? $start / $n_per_page + 1 : 1;
    $next_start = 0;
    if ($current_page > 1) {
        $page_html .= '[<a href="' . parse_link('a=logbook') . '">' . constant($game->sprache("TEXT0")) . '</a>]&nbsp;';
        $page_html .= '[<a href="' . parse_link('a=logbook&start=' . ($start - $n_per_page)) . '">' . constant($game->sprache("TEXT1")) . '</a>]&nbsp;';
    }
    for ($i = 1; $i <= $n_pages; ++$i) {
        if ($i == $current_page) {
            $page_html .= '[' . $i . ']&nbsp;';
        } else {
            $page_html .= '[<a href="' . parse_link('a=logbook&start=' . $next_start) . '">' . $i . '</a>]&nbsp;';
        }
        $_div = $i / 10;
        if ($_div == (int) $_div) {
            $page_html .= '<br>';
        }
        $next_start = $next_start + $n_per_page;
    }
    if ($current_page < $n_pages) {
        $page_html .= '[<a href="' . parse_link('a=logbook&start=' . ($start + $n_per_page)) . '">' . constant($game->sprache("TEXT2")) . '</a>]&nbsp;';
        $page_html .= '[<a href="' . parse_link('a=logbook&start=' . ($n_pages - 1) * $n_per_page) . '">' . constant($game->sprache("TEXT3")) . '</a>]';
    }
    return $page_html;
}
function display_logbook($log)
{
    global $game;
    $game->out('
<br>
<table width="450" align="center" border="0" cellpadding="2" cellspacing="2" class="style_outer">
  <tr>
    <td>
      <table width="450" align="center" border="0" cellpadding="2" cellspacing="2" class="style_inner">
        <tr>
          <td width="450">
    ');
    switch ($log['log_data']['what']) {
        case 'break':
            $game->out(constant($game->sprache("TEXT138")) . ' <a href="' . parse_link('a=stats&a2=viewplayer&id=' . $log['log_data']['who_id']) . '">' . $log['log_data']['who_name'] . '</a> ' . constant($game->sprache("TEXT139")));
            break;
    }
    $game->out('
          </td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<br>
    ');
}
Ejemplo n.º 3
0
function taxes_pagination($start, $n_count, $n_per_page)
{
    global $game;
    $page_html = '';
    $n_pages = ceil($n_count / $n_per_page);
    $current_page = $start > 0 ? $start / $n_per_page + 1 : 1;
    $next_start = 0;
    if ($current_page > 1) {
        $page_html .= '[<a href="' . parse_link('a=alliance_taxes') . '">' . constant($game->sprache("TEXT0")) . '</a>]&nbsp;';
        $page_html .= '[<a href="' . parse_link('a=alliance_taxes&start=' . ($start - $n_per_page)) . '">' . constant($game->sprache("TEXT1")) . '</a>]<br>&nbsp;';
    }
    if ($current_page > 5) {
        $page_html .= '[<a href="' . parse_link('a=alliance_taxes') . '">1</a>]&nbsp;...&nbsp;';
    }
    for ($i = 1; $i <= $n_pages; ++$i) {
        if ($i == $current_page) {
            $page_html .= '<b><span style="color: #00FF00;">[' . $i . ']</span></b>&nbsp;';
        } elseif ($i >= $current_page - 4 && $i <= $current_page + 4) {
            $page_html .= '[<a href="' . parse_link('a=alliance_taxes&start=' . $next_start) . '">' . $i . '</a>]&nbsp;';
        }
        $_div = $i / 25;
        if ($_div == (int) $_div && $n_pages < $div) {
            $page_html .= '&nbsp;';
        }
        $next_start = $next_start + $n_per_page;
    }
    if ($current_page < $n_pages - 5) {
        $page_html .= '&nbsp;...&nbsp[<a href="' . parse_link('a=alliance_taxes&start=' . ($n_pages - 1) * $n_per_page) . '">' . $n_pages . '</a>]';
    }
    if ($current_page < $n_pages) {
        $page_html .= '<br>[<a href="' . parse_link('a=alliance_taxes&start=' . ($start + $n_per_page)) . '">' . constant($game->sprache("TEXT2")) . '</a>]&nbsp;';
        $page_html .= '[<a href="' . parse_link('a=alliance_taxes&start=' . ($n_pages - 1) * $n_per_page) . '">' . constant($game->sprache("TEXT3")) . '</a>]';
    }
    return $page_html;
}
function display_logbook($log)
{
    global $game, $BUILDING_NAME;
    $game->out('
<br>
<table align="center" border="0" cellpadding="2" cellspacing="2" class="style_outer">
  <tr>
    <td>
      <table align="center" border="0" cellpadding="2" cellspacing="2" class="style_inner">
        <tr>
          <td width="450">
            <table border="0" cellpadding="0" cellspacing="0">
              <tr>
                <td width="450">
                  <table border=0 cellpadding=0 cellspacing=0>
                    <tr>
                      <td width="330" align="left"><b><u>' . $log['log_title'] . '</u></b></td>
                      <td width="120" align="right"><b>' . date('d.m.y H:i:s', $log['log_date']) . '</b></td>
                    </tr>
                  </table>
                  <br>
                  ' . constant($game->sprache("TEXT136")) . ' <a href="' . parse_link('a=tactical_cartography&planet_id=' . encode_planet_id($log['log_data']['planet_id'])) . '"><b>' . $log['log_data']['planet_name'] . '</a></b> ' . constant($game->sprache("TEXT137")) . '
                </td>
              </tr>
            </table>
          </td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<br>
    ');
}
function display_fleets_map()
{
    global $game;
    if ($game->option_retr('show_fleets_map') == 0) {
        $html_code = '<b>[&nbsp;<a href="' . parse_link('a=ship_fleets_display&sfmap=1') . '"><i>' . constant($game->sprache("TEXT102")) . '</i></a>&nbsp;]</b>';
    } else {
        $html_code = '<b>[&nbsp;<a href="' . parse_link('a=ship_fleets_display&sfmap=0') . '"><i>' . constant($game->sprache("TEXT103")) . '</i></a>&nbsp;]</b><br><br>
    <a href="userfleets.php?size=6&map" target=_blank><img src="userfleets.php?size=2" border=0></a><br>';
    }
    $game->out('
<table width="90%" align="center" border="0" cellpadding="2" cellspacing="2" class="style_outer"><tr><td>
<table width="100%" align="center" border="0" cellpadding="4" cellspacing="2" class="style_inner"><tr><td align="center">
' . constant($game->sprache("TEXT101")) . ' ' . $html_code . '
</tr><td></table></tr></td></table><br>');
}
function display_logbook($log)
{
    global $game, $BUILDING_NAME;
    $game->out('
<br>
<table align="center" border="0" cellpadding="2" cellspacing="2" class="style_outer">
  <tr>
    <td>
      <table align="center" border="0" cellpadding="2" cellspacing="2" class="style_inner">
        <tr>
          <td width="450">
            <table border="0" cellpadding="0" cellspacing="0">
              <tr>
                <td width="450">
                  <table border=0 cellpadding=0 cellspacing=0>
                    <tr>
                      <td width="330" align="left"><b><u>' . $log['log_title'] . '</u></b></td>
                      <td width="120" align="right"><b>' . date('d.m.y H:i:s', $log['log_date']) . '</b></td>
                    </tr>
                  </table>
                  <br>
                  ' . constant($game->sprache("TEXT120")) . ', ' . $game->player['user_name'] . '!<br>
                  ' . constant($game->sprache("TEXT121")) . ' "<a href="' . parse_link('&a=trade&view=view_bidding_detail&id=' . $log['log_data']['auction_id']) . '">' . $log['log_data']['auction_name'] . '</a>" ' . constant($game->sprache("TEXT122")) . '
                  <img src="' . $game->GFX_PATH . 'menu_metal_small.gif">&nbsp;' . $log['log_data']['resource_1'] . '
                  &nbsp;&nbsp;<img src="' . $game->GFX_PATH . 'menu_mineral_small.gif">&nbsp;' . $log['log_data']['resource_2'] . '
                  &nbsp;&nbsp;<img src="' . $game->GFX_PATH . 'menu_latinum_small.gif">&nbsp;' . $log['log_data']['resource_3'] . '&nbsp;&nbsp;<img src="' . $game->GFX_PATH . 'menu_unit1_small.gif">&nbsp;' . $log['log_data']['unit_1'] . '&nbsp;&nbsp;<img src="' . $game->GFX_PATH . 'menu_unit2_small.gif">&nbsp;' . $log['log_data']['unit_2'] . '&nbsp;&nbsp;<img src="' . $game->GFX_PATH . 'menu_unit3_small.gif">&nbsp;' . $log['log_data']['unit_3'] . '&nbsp;&nbsp;<img src="' . $game->GFX_PATH . 'menu_unit4_small.gif">&nbsp;' . $log['log_data']['unit_4'] . '&nbsp;&nbsp;<img src="' . $game->GFX_PATH . 'menu_unit5_small.gif">&nbsp;' . $log['log_data']['unit_5'] . '&nbsp;&nbsp;<img src="' . $game->GFX_PATH . 'menu_unit6_small.gif">&nbsp;' . $log['log_data']['unit_6'] . '<br><br>
                  ' . constant($game->sprache("TEXT123")) . '
                </td>
              </tr>
            </table>
          </td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<br>
    ');
}
    (at your option) any later version.

    STFC is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/
$magic_split = 9;
// Must be commented out, because otherwise this tool cannot be used without the planet
//$game->init_player();
check_auth(STGC_DEVELOPER);
if (!isset($_GET['sure'])) {
    $game->out('<br><center>Do you really want to rebuild all star systems slots?<br><br><b>The old must be deleted before!</b><br><br><a href="' . parse_link('a=tools/world/create_starsystem_slots&sure') . '">Create new</a></center>');
    return;
}
$system_slots = $processed_sector_slots = array();
$n_slots = 0;
$n_sectors = pow($magic_split * 2, 2);
$systems_per_sector = pow($magic_split, 2);
for ($i = 1; $i <= $n_sectors; ++$i) {
    $system_slots[$i] = array();
    $processed_sector_slots[$i] = 0;
    for ($j = 1; $j <= $magic_split; ++$j) {
        for ($k = 1; $k <= $magic_split; ++$k) {
            $system_slots[$i][] = array($j, $k);
            ++$n_slots;
        }
    }
Ejemplo n.º 8
0
 /**
  * Fetches information from the url by getting the contents of the
  * webpage, parse the webpage and extract the information from the
  * opengraph meta-tags.
  * If the site doesn't have any opengraph-metatags it is in fact no
  * opengraph node and thus no data will be stored in the database.
  * Only $url['is_opengraph'] === '0' indicates that the site is no
  * opengraph node at all.
  *
  * @todo The combination of parse_link() and the following request
  *       leads to two requests for the open graph data. This should
  *       be fixed due to performance reasons.
  */
 public function fetch()
 {
     if (!Config::get()->OPENGRAPH_ENABLE) {
         return;
     }
     $response = parse_link($this['url']);
     if ($response['response_code'] == 200 && strpos($response['Content-Type'], 'html') !== false) {
         if (preg_match('/(?<=charset=)[^;]*/i', $response['Content-Type'], $match)) {
             $currentEncoding = $match[0];
         } else {
             $currentEncoding = 'ISO-8859-1';
         }
         $context = stream_context_create(array('http' => array('method' => 'GET', 'header' => sprintf("User-Agent: Stud.IP v%s OpenGraph Parser\r\n", $GLOBALS['SOFTWARE_VERSION']))));
         $content = file_get_contents($this['url'], false, $context);
         $content = mb_encode_numericentity($content, array(0x80, 0xffff, 0, 0xffff), $currentEncoding);
         $old_libxml_error = libxml_use_internal_errors(true);
         $doc = new DOMDocument();
         $doc->loadHTML($content);
         libxml_use_internal_errors($old_libxml_error);
         $metatags = $doc->getElementsByTagName('meta');
         $reservedTags = array('url', 'chdate', 'mkdate', 'last_update', 'is_opengraph', 'data');
         $isOpenGraph = false;
         $ogTags = array();
         $data = array();
         foreach ($metatags as $tag) {
             $key = false;
             if ($tag->hasAttribute('property') && strpos($tag->getAttribute('property'), 'og:') === 0) {
                 $key = strtolower(substr($tag->getAttribute('property'), 3));
             }
             if (!$key && $tag->hasAttribute('name') && strpos($tag->getAttribute('name'), 'og:') === 0) {
                 $key = strtolower(substr($tag->getAttribute('name'), 3));
             }
             if ($key) {
                 $content = studip_utf8decode($tag->getAttribute('content'));
                 $data[] = array('og:' . $key => $content);
                 $ogTags[$key] = $content;
                 $isOpenGraph = true;
             }
         }
         foreach ($ogTags as $key => $tag) {
             if ($this->isField($key) && !in_array($key, $reservedTags)) {
                 $this[$key] = $tag;
             }
         }
         if (!$this['title'] && $isOpenGraph) {
             $titles = $doc->getElementsByTagName('title');
             if ($titles->length > 0) {
                 $this['title'] = studip_utf8decode($titles->item(0)->textContent);
             }
         }
         if (!$this['description'] && $isOpenGraph) {
             foreach ($metatags as $tag) {
                 if (stripos($tag->getAttribute('name'), "description") !== false || stripos($tag->getAttribute('property'), "description") !== false) {
                     $this['description'] = studip_utf8decode($tag->getAttribute('content'));
                 }
             }
         }
         $this['data'] = $data;
     }
     $this['is_opengraph'] = (int) $isOpenGraph;
 }
Ejemplo n.º 9
0
</fieldset></tr>');
// Options for sorting etc.:
$game->out('</table></td></tr></table><br><br>
<table border=0 cellpadding=1 cellspacing=1 class="style_outer"><tr><td>
<table border=0 cellpadding=1 cellspacing=1 class="style_inner">
<tr valign=top><td width=120><b>' . constant($game->sprache("TEXT41")) . '</b><br>
<a href="' . parse_link('a=planetlist&s_o=0') . '">' . ($game->option_retr('planetlist_order') == 0 ? '<u>' : '') . '' . constant($game->sprache("TEXT42")) . '</u></a><br>
<a href="' . parse_link('a=planetlist&s_o=1') . '">' . ($game->option_retr('planetlist_order') == 1 ? '<u>' : '') . '' . constant($game->sprache("TEXT43")) . '</u></a><br>
<a href="' . parse_link('a=planetlist&s_o=2') . '">' . ($game->option_retr('planetlist_order') == 2 ? '<u>' : '') . '' . constant($game->sprache("TEXT44")) . '</u></a><br>
<a href="' . parse_link('a=planetlist&s_o=3') . '">' . ($game->option_retr('planetlist_order') == 3 ? '<u>' : '') . '' . constant($game->sprache("TEXT45")) . '</u></a><br>
<a href="' . parse_link('a=planetlist&s_o=4') . '">' . ($game->option_retr('planetlist_order') == 4 ? '<u>' : '') . '' . constant($game->sprache("TEXT46")) . '</u></a><br>
<a href="' . parse_link('a=planetlist&s_o=5') . '">' . ($game->option_retr('planetlist_order') == 5 ? '<u>' : '') . '' . constant($game->sprache("TEXT47")) . '</u></a><br>
<a href="' . parse_link('a=planetlist&s_o=6') . '">' . ($game->option_retr('planetlist_order') == 6 ? '<u>' : '') . '' . constant($game->sprache("TEXT48")) . '</u></a><br>

</td><td width=120><b>' . constant($game->sprache("TEXT49")) . '</b><br>
<a href="' . parse_link('a=planetlist&s_s=0') . '">' . ($game->option_retr('planetlist_show') == 0 ? '<u>' : '') . '' . constant($game->sprache("TEXT50")) . '</u></a><br>
<a href="' . parse_link('a=planetlist&s_s=1') . '">' . ($game->option_retr('planetlist_show') == 1 ? '<u>' : '') . '' . constant($game->sprache("TEXT51")) . '</u></a><br>
<a href="' . parse_link('a=planetlist&s_s=2') . '">' . ($game->option_retr('planetlist_show') == 2 ? '<u>' : '') . '' . constant($game->sprache("TEXT48")) . '</u></a><br>
<a href="' . parse_link('a=planetlist&s_s=3') . '">' . ($game->option_retr('planetlist_show') == 3 ? '<u>' : '') . '' . constant($game->sprache("TEXT52")) . '</u></a><br>
</td>
</td><td width=120><b>' . constant($game->sprache("TEXT53")) . '</b><br>
' . ($game->SITTING_MODE ? '' : '<a href="' . parse_link('a=planetlist&s_op=0') . '">') . ($game->option_retr('redalert_options') == 0 ? '<u>' : '') . '' . constant($game->sprache("TEXT54")) . '</u>' . ($game->SITTING_MODE ? '' : '</a>') . '<br>
' . ($game->SITTING_MODE ? '' : '<a href="' . parse_link('a=planetlist&s_op=1') . '">') . ($game->option_retr('redalert_options') == 1 ? '<u>' : '') . '' . constant($game->sprache("TEXT55")) . '</u>' . ($game->SITTING_MODE ? '' : '</a>') . '<br>
' . ($game->SITTING_MODE ? '' : '<a href="' . parse_link('a=planetlist&s_op=2') . '">') . ($game->option_retr('redalert_options') == 2 ? '<u>' : '') . '' . constant($game->sprache("TEXT56")) . '</u>' . ($game->SITTING_MODE ? '' : '</a>') . '
</td>
</tr>
</table>
</td>
</tr>
</table>
');
Ejemplo n.º 10
0
        echo '</div>';
    }
} else {
    ?>
                        <div style="font-size:0.7em; float:right">
                            <a href="<?php 
    echo SITE;
    ?>
/index.php?a=edit&q=<?php 
    echo htmlspecialchars($url);
    ?>
" style="color:white">编辑</a>
                        </div>
                    <?php 
    echo '<div style="padding-right:1em">';
    echo parse_link(parse_template($content));
    if ($special) {
        require __DIR__ . '/special.php';
    }
    echo '</div>';
}
?>
                </td>
            </tr>
            <tr style="height:0">
                <td style="height:0">
                    <footer>符文工房中文百科的全部文字在<a href="https://creativecommons.org/licenses/by-sa/3.0/deed.zh">知识共享 署名-相同方式共享 3.0</a>协议之条款下提供。</footer>
                </td>
            </tr>
        </table>
    </body>
Ejemplo n.º 11
0
<table width="450" align="center" border="0" cellpadding="1" cellspacing="1" class="style_outer"><tr><td>
<table width="450" align="center" border="0" cellpadding="2" cellspacing="2" class="style_inner">
  <form name="minerals_form" method="post" action="' . parse_link('a=mines') . '" onSubmit="return deactivate_buttons();">
  <tr>
    <td width="350"><b>' . $BUILDING_NAME[$game->player['user_race']][2] . '</b> (<img src="' . $game->GFX_PATH . 'menu_mineral_small.gif">&nbsp;<b>' . ($ress_tax != 0 ? '' . $ress_tax * ResourcesPerTickMineral() . '' : '' . ResourcesPerTickMineral() . '') . '</b> <i>' . constant($game->sprache("TEXT11")) . '</i> / <b>' . ($ress_tax != 0 ? '' . $ress_tax * ResourcesPerHourMineral() . '' : '' . ResourcesPerHourMineral() . '') . '</b> <i>' . constant($game->sprache("TEXT12")) . '</i>)</td>
    <td width="100" rowspan="2" align="center" valign="middle"><input class="button" type="submit" name="submit" value="' . constant($game->sprache("TEXT13")) . '"></td>
  </tr>
  <tr>
    <td width="300">' . constant($game->sprache("TEXT14")) . ' <select name="worker">' . $minerals_option_html . '</select></td>
  </tr>
  <input type="hidden" name="type" value="2">
  </form>
</table>
</td></tr></table>
<br><br>
<table width="450" align="center" border="0" cellpadding="1" cellspacing="1" class="style_outer"><tr><td>
<table width="450" align="center" border="0" cellpadding="2" cellspacing="2" class="style_inner">
  <form name="latinum_form" method="post" action="' . parse_link('a=mines') . '" onSubmit="return deactivate_buttons();">
  <tr>
    <td width="350"><b>' . $BUILDING_NAME[$game->player['user_race']][3] . '</b> (<img src="' . $game->GFX_PATH . 'menu_latinum_small.gif">&nbsp;<b>' . ($ress_tax != 0 ? '' . $ress_tax * ResourcesPerTickLatinum() . '' : '' . ResourcesPerTickLatinum() . '') . '</b> <i>' . constant($game->sprache("TEXT11")) . '</i> / <b>' . ($ress_tax != 0 ? '' . $ress_tax * ResourcesPerHourLatinum() . '' : '' . ResourcesPerHourLatinum() . '') . '</b> <i>' . constant($game->sprache("TEXT12")) . '</i>)</td>
    <td width="100" rowspan="2" align="center" valign="middle"><input class="button" type="submit" name="submit" value="' . constant($game->sprache("TEXT13")) . '"></td>
  </tr>
  <tr>
    <td width="300">' . constant($game->sprache("TEXT14")) . ' <select name="worker">' . $latinum_option_html . '</select></td>
  </tr>
  <input type="hidden" name="type" value="3">
  </form>
</table>
</td></tr></table>
    ');
}
Ejemplo n.º 12
0
    <td>
      <table class="style_inner" width="450" align="center" border="0" cellpadding="2" cellspacing="2">
        <tr>
          <td><b>' . constant($game->sprache("TEXT20")) . '</b></td><td align="center"><b>' . constant($game->sprache("TEXT21")) . '</b></td><td align="center"><b>' . constant($game->sprache("TEXT22")) . '</b></td><td align="center"><b>' . constant($game->sprache("TEXT23")) . '</b></td><td align="center"><b>' . constant($game->sprache("TEXT24")) . '</b></td><td align="center"><b>' . constant($game->sprache("TEXT25")) . '</b></td><td align="center"><b>' . constant($game->sprache("TEXT26")) . '</b></td><td align="center"><b>' . constant($game->sprache("TEXT27")) . '</b></td><td align="center"><b>' . constant($game->sprache("TEXT28")) . '</b></td><td><b>' . constant($game->sprache("TEXT29")) . '</b></td>
        </tr>

');
while (($user_rights = $db->fetchrow($listquery)) != false) {
    if ($user_rights['user_id'] == $alliance['alliance_owner']) {
        $game->out('

<td><a href="' . parse_link('a=stats&a2=viewplayer&id=' . $user_rights['user_id'] . '') . '">' . $user_rights['user_name'] . '</a></td><td align="center"></td><td align="center"></td><td align="center"></td><td align="center"></td><td align="center"></td><td align="center"></td><td align="center"></td><td align="center"></td><td>' . constant($game->sprache("TEXT30")) . '</td>

');
    } else {
        $game->out(' <form action="' . parse_link('a=alliance_rights') . '" method="post"><input type="hidden" name="user_id" value="' . $user_rights['user_id'] . '"><tr><td><a href="' . parse_link('a=stats&a2=viewplayer&id=' . $user_rights['user_id'] . '') . '">' . $user_rights['user_name'] . '</a></td> ');
        if ($user_rights['user_alliance_rights1'] == 1) {
            $game->out('<td><input type="checkbox" name="rights1" size="1" value="1" checked></td>');
        } else {
            $game->out('<td><input type="checkbox" name="rights1" size="1" value="1"></td>');
        }
        if ($user_rights['user_alliance_rights2'] == 1) {
            $game->out('<td><input type="checkbox" name="rights2" size="1" value="1" checked></td>');
        } else {
            $game->out('<td><input type="checkbox" name="rights2" size="1" value="1"></td>');
        }
        if ($user_rights['user_alliance_rights3'] == 1) {
            $game->out('<td><input type="checkbox" name="rights3" size="1" value="1" checked></td>');
        } else {
            $game->out('<td><input type="checkbox" name="rights3" size="1" value="1"></td>');
        }
Ejemplo n.º 13
0
        $sql = 'UPDATE user
            SET unread_messages = unread_messages + 1
            WHERE user_id IN (' . implode(',', $user_ids) . ')';
        if (!$db->query($sql)) {
            message(DATABASE_ERROR, 'Could not update user unread messages');
        }
        redirect('a=alliance_main');
    }
    $game->out('
<table class="style_outer" width="350" align="center" border="0" cellpadding="2" cellspacing="2">
  <tr>
    <td align="center">
      <span style="font-size: 12pt; font-weight: bold;">' . $game->player['alliance_name'] . ' [' . $game->player['alliance_tag'] . ']</span><br><br>

      <table class="style_inner" width="350" align="center" border="0" cellpadding="2" cellspacing="2">
        <form method="post" action="' . parse_link('a=alliance_massmail') . '">
        <tr>
          <td colspan="2" width="350">' . constant($game->sprache("TEXT4")) . '</td>
        </tr>
        <tr height="10"><td></td></tr>
        <tr>
          <td width="50">' . constant($game->sprache("TEXT5")) . '</td>
          <td width="300"><input class="field" type="text" name="mail_subject" maxlength="32" style="width: 280px;"></td>
        </tr>
        <tr height="5"><td></td></tr>
        <tr>
          <td width="50">' . constant($game->sprache("TEXT6")) . '</td>
          <td width="300"><textarea name="mail_text" cols="45" rows="8" style="width: 280px;"></textarea>
        </tr>
        <tr>
          <td width="50">' . constant($game->sprache("TEXT7")) . '</td>
Ejemplo n.º 14
0
            // Check if the last system shouldn't be filled
            if ($planets_to_go == 0) {
                break;
            }
        }
    }
    $sql = 'UPDATE user
            SET user_planets = ' . $n_planets . '
            WHERE user_id = ' . $user_id;
    if (!$db->query($sql)) {
        message(DATABASE_ERROR, 'Could not update user data!');
    }
    //
} else {
    $game->out('
        <form method="post" action="' . parse_link('a=tools/players/encourage_user') . '">
        <table border="0" cellpadding="2" cellspacing="2" class="style_outer">
        <tr>
            <td>
            <table border="0" cellpadding="2" cellspacing="2" class="style_inner">
            <tr>
                <td>User ID:</td>
                <td><input class="field" type="text" name="user_id" value=""></td>
            </tr>
            <tr>
                <td colspan=2" align="center"><input class="button" type="submit" name="submit" value="Submit"><td>
            </tr>
            </table>
            </td>
        </tr>
        </table>
Ejemplo n.º 15
0
</script>

<table class="style_outer" align="center" border="0" cellpadding="2" cellspacing="2" width="450"><tr><td>
<table class="style_inner" align="center" border="0" cellpadding="2" cellspacing="2" width="450">
  <form name="send_form" method="post" action="' . parse_link('a=ship_send') . '">
  <input type="hidden" name="dest" value="' . encode_planet_id($dest) . '">
        ');
        $fleet_option_html = '';
        for ($i = 0; $i < $n_fleets; ++$i) {
            $fleet_option_html .= '<option>' . $fleets[$i]['fleet_name'] . ' (' . $fleets[$i]['n_ships'] . ')</option>';
            $game->out('<input type="hidden" name="fleets[]" value="' . $fleets[$i]['fleet_id'] . '">');
        }
        $game->out('
  <tr>
    <td>
      ' . constant($game->sprache("TEXT28")) . ' <a href="' . parse_link('a=tactical_cartography&planet_id=' . encode_planet_id($start)) . '"><b>' . $start_planet['planet_name'] . '</b></a> (' . $game->get_sector_name($start_planet['sector_id']) . ':' . $game->get_system_cname($start_planet['system_x'], $start_planet['system_y']) . ':' . ($start_planet['planet_distance_id'] + 1) . ')' . ($start_planet['user_id'] != $game->player['user_id'] ? ' ' . constant($game->sprache("TEXT26")) . ' <a href="' . parse_link('a=stats&a2=viewplayer&id=' . $start_planet['user_id']) . '"><b>' . $start_planet['user_name'] . '</b></a>' : '') . '<br>
        ');
        if ($free_planet) {
            $game->out(constant($game->sprache("TEXT29")) . ' <i>' . constant($game->sprache("TEXT51")) . '</i> (' . $game->get_sector_name($dest_planet['sector_id']) . ':' . $game->get_system_cname($dest_planet['system_x'], $dest_planet['system_y']) . ':' . ($dest_planet['planet_distance_id'] + 1) . ')<br><br>');
        } else {
            $game->out(constant($game->sprache("TEXT29")) . $dest_str . '<br><br>');
        }
        $game->out('
      ' . constant($game->sprache("TEXT30")) . ' <select style="width: 200px;">' . $fleet_option_html . '</select><br><br>
      ' . constant($game->sprache("TEXT52")) . ' <b>' . $max_speed_str . '</b><br>
      ' . constant($game->sprache("TEXT53")) . ' ' . $min_stardate . '</b><br><br>
      ' . constant($game->sprache("TEXT31")) . ' <input class="field" style="width: 45px;" type="text" name="higher_arrival_stardate" value="' . $min_stardate_split[0] . '" maxlength="5" onBlur="return update_times();">&nbsp;.&nbsp;<input class="field" style="width: 15px;" type="text" name="lower_arrival_stardate" value="' . $min_stardate_split[1] . '" maxlength="1" onBlur="return update_times();">&nbsp;&nbsp;<input class="button" style="width: 20px;" type="button" value="+" onClick="return increment_arrival();"">&nbsp;<input class="button" style="width: 20px;" type="button" value="-" onClick="return decrement_arrival();"><br><br>
      ' . constant($game->sprache("TEXT54")) . ' <input class="field" style="width: 25px;" type="text" name="arrival_days" value="" disabled="disabled">&nbsp;<i>' . constant($game->sprache("TEXT55")) . '</i>&nbsp;&nbsp;<input class="field" style="width: 25px;" name="arrival_hours" value="" disabled="disabled">&nbsp;<i>' . constant($game->sprache("TEXT56")) . '</i>&nbsp;&nbsp;<input class="field" style="width: 25px;" name="arrival_minutes" value="" disabled="disabled">&nbsp;<i>' . constant($game->sprache("TEXT57")) . ' +</i>&nbsp;<i id="timer2" title="time1_' . $NEXT_TICK . '_type1_4">&nbsp;</i><br><br>

      <table width="440" align="center" border="0" cellpadding="0" cellspacing="0"><tr><td width="220">
        ');
Ejemplo n.º 16
0
function Ship_Details()
{
    global $db, $game, $SHIP_TORSO, $RACE_DATA, $ship_rank_bonus, $ship_ranks, $ship_components;
    $sql = 'SELECT s.*, st.*,
	               f.fleet_name, f.planet_id, f.move_id,
	               p.planet_name
	        FROM (ships s)
	        INNER JOIN (ship_templates st) ON st.id = s.template_id
	        LEFT JOIN (ship_fleets f) ON f.fleet_id = s.fleet_id
	        LEFT JOIN (planets p) ON p.planet_id = -s.fleet_id
	        WHERE s.ship_id = ' . $_REQUEST['id'];
    if (($ship = $db->queryrow($sql)) === false) {
        message(DATABASE_ERROR, 'Could not query ship data');
    }
    if (empty($ship['ship_id'])) {
        message(NOTICE, constant($game->sprache("TEXT55")));
    }
    if ($ship['user_id'] != $game->player['user_id']) {
        message(NOTICE, constant($game->sprache("TEXT55")));
    }
    // Schiffsdaten ausgeben:
    $rank_nr = 1;
    if ($ship['experience'] >= $ship_ranks[0]) {
        $rank_nr = 1;
    }
    if ($ship['experience'] >= $ship_ranks[1]) {
        $rank_nr = 2;
    }
    if ($ship['experience'] >= $ship_ranks[2]) {
        $rank_nr = 3;
    }
    if ($ship['experience'] >= $ship_ranks[3]) {
        $rank_nr = 4;
    }
    if ($ship['experience'] >= $ship_ranks[4]) {
        $rank_nr = 5;
    }
    if ($ship['experience'] >= $ship_ranks[5]) {
        $rank_nr = 6;
    }
    if ($ship['experience'] >= $ship_ranks[6]) {
        $rank_nr = 7;
    }
    if ($ship['experience'] >= $ship_ranks[7]) {
        $rank_nr = 8;
    }
    if ($ship['experience'] >= $ship_ranks[8]) {
        $rank_nr = 9;
    }
    if ($ship['experience'] >= $ship_ranks[9]) {
        $rank_nr = 10;
    }
    $game->out('

<table width="450" align="center" border="0" cellpadding="2" cellspacing="2" class="style_outer">

  <tr>

    <td><span class="sub_caption2">' . constant($game->sprache("TEXT56")) . ' (' . $ship['name'] . ')</span><br>

      <table width="450" align="center" cellpadding="0" cellspacing="0" border="0" class="style_inner">

        <tr>

          <td align="left" valign="top" width="120">

            ' . ($ship['fleet_id'] > 0 ? constant($game->sprache("TEXT57")) : constant($game->sprache("TEXT58"))) . '<br><br>

            ' . constant($game->sprache("TEXT59")) . '<br>

            ' . constant($game->sprache("TEXT60")) . '<br>

            ' . constant($game->sprache("TEXT61")) . '<br><br>

            ' . constant($game->sprache("TEXT6")) . '<br>

            ' . constant($game->sprache("TEXT62")) . '<br>

            ' . constant($game->sprache("TEXT63")) . '<br><br>

            ' . constant($game->sprache("TEXT73")) . '<br>

            ' . constant($game->sprache("TEXT64")) . '<br>

            ' . constant($game->sprache("TEXT44")) . '<br><br>

            ' . constant($game->sprache("TEXT49")) . '<br><br>

            ' . constant($game->sprache("TEXT41")) . '<br>

            ' . constant($game->sprache("TEXT42")) . '<br>

            ' . constant($game->sprache("TEXT43")) . '<br><br>

            ' . constant($game->sprache("TEXT46")) . '<br>

            ' . constant($game->sprache("TEXT47")) . '<br>

            ' . constant($game->sprache("TEXT48")) . '<br><br>

            ' . constant($game->sprache("TEXT50")) . '<br>

            ' . constant($game->sprache("TEXT51")) . '<br>

            ' . constant($game->sprache("TEXT52")) . '<br><br>

            ' . constant($game->sprache("TEXT65")) . '<br><br>

            ' . constant($game->sprache("TEXT10")) . '

          </td>

          <td align="left" valign="top" width="160">

            [' . ($ship['fleet_id'] > 0 ? '<a href="' . parse_link('a=ship_fleets_display&' . (!empty($ship['planet_id']) ? 'p' : 'm') . 'fleet_details=' . $ship['fleet_id']) . '">' . $ship['fleet_name'] . '</a>' : '<a href="' . parse_link('a=spacedock') . '">' . $ship['planet_name'] . '</a>') . ']<br><br>

            <b>' . $ship['name'] . '</b><br>

            <b><a href="javascript:void(0);" onmouseover="return overlib(\'' . CreateShipInfoText($SHIP_TORSO[$ship['race']][$ship['ship_torso']]) . '\', CAPTION, \'' . $SHIP_TORSO[$ship['race']][$ship['ship_torso']][29] . '\', WIDTH, 400, ' . OVERLIB_STANDARD . ');" onmouseout="return nd();">' . $SHIP_TORSO[$ship['race']][$ship['ship_torso']][29] . '</a></b><br>

            <b>' . $RACE_DATA[$ship['race']][0] . '</b><br><br>

            <b>' . $ship['ship_name'] . '</b><br>

            <b>' . $ship['ship_ncc'] . '</b><br>

            <b>' . date('d/m/y H:i:s', $ship['construction_time']) . '</b><br><br>

            <b>' . (!empty($ship['last_refit_time']) ? date('d/m/y H:i:s', $ship['last_refit_time']) : constant($game->sprache("TEXT74"))) . '</b><br>

            <b>' . $ship['hitpoints'] . '</b> / <b>' . $ship['value_5'] . '</b><br>

            <b>' . $ship['value_4'] . '</b><br><br>

            <b><span style="color: yellow">' . $ship['experience'] . '</span></b> <img src="' . $game->GFX_PATH . 'rank_' . $rank_nr . '.jpg" width="47" height="12"><br><br>

            <b>' . $ship['value_1'] . ' + <span style="color: yellow">' . round($ship['value_1'] * $ship_rank_bonus[$rank_nr - 1], 0) . '</span></b><br>

            <b>' . $ship['value_2'] . ' + <span style="color: yellow">' . round($ship['value_2'] * $ship_rank_bonus[$rank_nr - 1], 0) . '</span></b><br>

            <b>' . $ship['value_3'] . ' + <span style="color: yellow">' . round($ship['value_3'] * $ship_rank_bonus[$rank_nr - 1], 0) . '</span></b><br><br>

            <b>' . $ship['value_6'] . ' + <span style="color: yellow">' . round($ship['value_6'] * $ship_rank_bonus[$rank_nr - 1], 0) . '</span></b><br>

            <b>' . $ship['value_7'] . ' + <span style="color: yellow">' . round($ship['value_7'] * $ship_rank_bonus[$rank_nr - 1], 0) . '</span></b><br>

            <b>' . $ship['value_8'] . ' + <span style="color: yellow">' . round($ship['value_8'] * $ship_rank_bonus[$rank_nr - 1], 0) . '</span></b><br><br>

            <b>' . $ship['value_10'] . '</b><br>

            <b>' . $ship['value_11'] . '</b><br>

            <b>' . $ship['value_12'] . '</b><br><br>

            <b>' . $ship['value_14'] . '</b> / <b>' . $ship['value_13'] . '</b><br><br>

            <img src=' . $game->GFX_PATH . 'menu_unit1_small.gif>' . $ship['unit_1'] . '&nbsp;&nbsp;<img src=' . $game->GFX_PATH . 'menu_unit2_small.gif>' . $ship['unit_2'] . '&nbsp;&nbsp;<img src=' . $game->GFX_PATH . 'menu_unit3_small.gif>' . $ship['unit_3'] . '&nbsp;&nbsp;<img src=' . $game->GFX_PATH . 'menu_unit4_small.gif>' . $ship['unit_4'] . '&nbsp;&nbsp;<img src=' . $game->GFX_PATH . 'menu_unit5_small.gif>' . $ship['unit_5'] . '&nbsp;&nbsp;<img src=' . $game->GFX_PATH . 'menu_unit6_small.gif>' . $ship['unit_6'] . '

          </td>

          <td align="center>" valign="top" width="170"><img src="' . FIXED_GFX_PATH . 'ship' . $ship['race'] . '_' . $ship['ship_torso'] . '.jpg"><br><br>

    ');
    for ($t = 0; $t < 10; $t++) {
        if ($ship['component_' . ($t + 1)] >= 0) {
            $game->out('-&nbsp;<a href="javascript:void(0);" onmouseover="return overlib(\'' . CreateCompInfoText($ship_components[$ship['race']][$t][$ship['component_' . ($t + 1)]]) . '\', CAPTION, \'' . $ship_components[$ship['race']][$t][$ship['component_' . ($t + 1)]]['name'] . '\', WIDTH, 400, ' . OVERLIB_STANDARD . ');" onmouseout="return nd();">' . $ship_components[$ship['race']][$t][$ship['component_' . ($t + 1)]]['name'] . '</a><br>');
        } else {
            $game->out(constant($game->sprache("TEXT66")));
        }
    }
    $game->out('

          </td>

        </tr>

      </table>

    </td>

  </tr>

</table>

    ');
}
Ejemplo n.º 17
0
<img src="' . FIXED_GFX_PATH . 'planet_type_b.png" width="20" height="20" border="0"> <a href="' . parse_link('a=database&planet_type=B#B') . '">B</a>,
<img src="' . FIXED_GFX_PATH . 'planet_type_g.png" width="20" height="20" border="0"> <a href="' . parse_link('a=database&planet_type=G#G') . '">G</a>,
<img src="' . FIXED_GFX_PATH . 'planet_type_i.png" width="20" height="20" border="0"> <a href="' . parse_link('a=database&planet_type=I#I') . '">I</a>,
<img src="' . FIXED_GFX_PATH . 'planet_type_j.png" width="20" height="20" border="0"> <a href="' . parse_link('a=database&planet_type=J#J') . '">J</a>,
<img src="' . FIXED_GFX_PATH . 'planet_type_l.png" width="20" height="20" border="0"> <a href="' . parse_link('a=database&planet_type=L#L') . '">L</a> e
<img src="' . FIXED_GFX_PATH . 'planet_type_y.png" width="20" height="20" border="0"> <a href="' . parse_link('a=database&planet_type=Y#Y') . '">Y</a>;</li><br>
<li>pianeti &quot;<u>lavoratori</u>&quot;: di questa categoria fanno parte i pianeti simili alla Terra, ossia principalmente le classi
<img src="' . FIXED_GFX_PATH . 'planet_type_m.png" width="20" height="20" border="0"> <a href="' . parse_link('a=database&planet_type=M#M') . '">M</a> ed
<img src="' . FIXED_GFX_PATH . 'planet_type_n.png" width="20" height="20" border="0"> <a href="' . parse_link('a=database&planet_type=N#N') . '">N</a> seguiti
dalle classi <img src="' . FIXED_GFX_PATH . 'planet_type_e.png" width="20" height="20" border="0"> <a href="' . parse_link('a=database&planet_type=E#E') . '">E</a>,
<img src="' . FIXED_GFX_PATH . 'planet_type_f.png" width="20" height="20" border="0"> <a href="' . parse_link('a=database&planet_type=F#F') . '">F</a>,
<img src="' . FIXED_GFX_PATH . 'planet_type_k.png" width="20" height="20" border="0"> <a href="' . parse_link('a=database&planet_type=K#K') . '">K</a>,
<img src="' . FIXED_GFX_PATH . 'planet_type_h.png" width="20" height="20" border="0"> <a href="' . parse_link('a=database&planet_type=H#H') . '">H</a> e
in minor misura dalle classi
<img src="' . FIXED_GFX_PATH . 'planet_type_c.png" width="20" height="20" border="0"> <a href="' . parse_link('a=database&planet_type=C#C') . '">C</a> e
<img src="' . FIXED_GFX_PATH . 'planet_type_d.png" width="20" height="20" border="0"> <a href="' . parse_link('a=database&planet_type=D#D') . '">D</a>;
questi pianeti hanno miniere che fruttano una quantit&agrave; media di risorse ma permettono di ottenere un gran numero di
<img src ="' . $game->GFX_PATH . 'menu_worker_small.gif"> lavoratori, specialmente
se &quot;terraformati&quot; (si discuter&agrave; pi&ugrave; avanti di cosa sia il &quot;terraforming&quot;;</li>
</ul>
</p>
<p align="justify">
I pianeti &quot;lavoratori&quot; costituiscono un buon compromesso tra le risorse ottenute ed il tempo impiegato per ottenerle (anche se le classi
C e D sono piuttosto lenti nel progredire, ossia nel costruire strutture e ricercare sviluppi tecnologici), tuttavia da soli non sono in grado di
produrre le ingenti quantit&agrave; di risorse necessarie a sviluppare le tecnologie migliori o le navi pi&ugrave; potenti in breve tempo.<br>
Per questo &egrave; bene ricorrere ai pianeti &quot;miniera&quot;, molto lenti nello sviluppare tecnologie e strutture ma fenomenali nel produrre
un determinato tipo di risorsa (ad eccezione della classe Y che fornisce una grande quantit&agrave; di tutte le risorse, anche se &egrave;
la pi&ugrave; lenta a svilupparsi).</p>
<p align="justify">
I pianeti &quot;miniera&quot; solitamente producono pochissimi lavoratori, il che rende necessario nelle prime
fasi di sviluppo l&#146;apporto di lavoratori da altri pianeti.</p>';
Ejemplo n.º 18
0
        $dest_sum_sensors = !empty($friendly_ships['sum_sensors']) ? (int) $friendly_ships['sum_sensors'] : 0;
        $dest_sum_cloak = !empty($friendly_ships['sum_cloak']) ? (int) $friendly_ships['sum_cloak'] : 0;
        $flight_duration = $move['move_finish'] - $move['move_begin'];
        $visibility = GetVisibility($move_sum_sensors, $move_sum_cloak, $move['n_ships'], $dest_sum_sensors, $dest_sum_cloak, ($move['dest_building_7'] + 1) * PLANETARY_SENSOR_VALUE, $flight_duration);
        $travelled = 100 / $flight_duration * ($ACTUAL_TICK - $move['move_begin']);
        if ($travelled < $visibility + (100 - $visibility) / 4) {
            $move['n_ships'] = 0;
        }
        if ($travelled < $visibility + 2 * ((100 - $visibility) / 4)) {
            $move['action_code'] = 0;
        }
        $attack = time() + ($move['move_finish'] - $ACTUAL_TICK) * 300;
        $game->out('<tr><td>' . $move['planet_name'] . '</td><td>' . $move['defender'] . '</td><td>' . $move['attacker'] . '</td><td>' . date('d.m.y H:i', $attack) . '</td><td>' . $move['action_code'] . '</td></tr>');
        /*        $sql = 'UPDATE planets
                        SET planet_next_attack = '.(time() + ($move['move_finish'] - $ACTUAL_TICK) * 300).',
                            planet_attack_ships = '.$move['n_ships'].',
                            planet_attack_type= '.$move['action_code'].'
                        WHERE planet_id= '.$move['dest'];
        
                if(!$db->query($sql)) {
                    message(DATABASE_ERROR,'- Warning: Could not update planet attacked data! CONTINUED');
                }*/
    }
    $game->out('
            </table>
            </td>
        </tr>
        </table>');
}
$game->out('<br><br><a href="' . parse_link('a=tools/attacked_test') . '"><span class="sub_caption2">Refresh</span></a><br>');
Ejemplo n.º 19
0
    the Free Software Foundation; either version 3 of the License, or
    (at your option) any later version.

    STFC is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/
include_once 'include/global.php';
include_once 'include/sql.php';
include_once 'include/functions.php';
$game->init_player();
global $game;
$game->out('<span class="caption">' . constant($game->sprache("TEXT0")) . '</span><br><br>[<a href="' . parse_link('a=tactical_cartography') . '">' . constant($game->sprache("TEXT1")) . '</a>]&nbsp;&nbsp;[<a href="' . parse_link('a=tactical_moves') . '">' . constant($game->sprache("TEXT2")) . '</a>]&nbsp;&nbsp;[<b>' . constant($game->sprache("TEXT3")) . '</b>]&nbsp;&nbsp;[<a href="' . parse_link('a=tactical_kolo') . '">' . constant($game->sprache("TEXT4")) . '</a>]&nbsp;&nbsp;[<a href="' . parse_link('a=tactical_known') . '">' . constant($game->sprache("TEXT4a")) . '</a>]&nbsp;&nbsp;[<a href="' . parse_link('a=tactical_sensors') . '">' . constant($game->sprache("TEXT5")) . '</a>]<br><br>

<table border="0" cellpadding="2" cellspacing="2" width="450" class="style_outer">
  <tr>
    <td>
      <table border="0" cellpadding="2" cellspacing="2" width="450" class="style_inner">
	    <tr>
          <td align="center">
            <a href="usermap.php?user='******'user_name'] . '&size=6&map" target=_blank><img src="usermap.php?user='******'user_name'] . '&size=2" border=0></a>
          </td>
        </tr>
      </table>
    </td>
  </tr>
</table');
Ejemplo n.º 20
0
    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/
$game->init_player();
$game->out('<span class="caption">Reset galaxy</span><br><br>');
check_auth(STGC_DEVELOPER);
if (!isset($_GET['sure'])) {
    $game->out('<br><center>Do you really want to reset the galaxy COMPLETELY?<br><b><h3>All the data will be LOST FOREVER!</h3></b><br><a href="' . parse_link('a=tools/world/reset_galaxy&sure') . '">Reset galaxy</a></center>');
    return;
}
if (!isset($_GET['supersure'])) {
    $game->out('<br><center>Let me ask you a second time: do you really, <B>REALLY</b> want to reset the galaxy COMPLETELY?<br><b><h2>All the data will be LOST FOREVER!</h2></b><br><a href="' . parse_link('a=tools/world/reset_galaxy&sure&supersure') . '">Reset galaxy</a></center>');
    return;
}
if (!isset($_GET['hypersure'])) {
    $game->out('<br><center>Just to be sure, a third time: do you really, <b>REALLY</b>, <b><u>R E A L L Y</u></b> want to reset the galaxy COMPLETELY?<br><b><H1>ALL THE DATA WILL BE LOST FOREVER!</H1></b><br><a href="' . parse_link('a=tools/world/reset_galaxy&sure&supersure&hypersure') . '">Reset galaxy</a></center>');
    return;
}
// ###########################################################################
// ###########################################################################
// Ok, let's nuke the galaxy!
$game->out('<b>Beginning galaxy big crunch...</b><br>');
// First of all stop the tick execution and the game:
$sql = 'UPDATE config SET tick_stopped = 1,game_stopped = 1';
if (!$db->query($sql)) {
    message(DATABASE_ERROR, 'Cannot stop tick execution!');
}
$game->out('Tick stopped<br>');
// Then truncate all the existing tables except for config, FHB_debug, and skins:
$game->out('Truncating DB tables...');
$tables = array('account_observe', 'alliance', 'alliance_application', 'alliance_bposts', 'alliance_bthreads', 'alliance_diplomacy', 'alliance_logs', 'alliance_shoutbox', 'alliance_taxes', 'bidding', 'bidding_owed', 'borg_bot', 'borg_target', 'borg_npc_target', 'click_ids', 'FHB_bid_meldung', 'FHB_Bot', 'FHB_cache_trupp_trade', 'FHB_Handels_Lager', 'FHB_handel_log', 'FHB_logging_ship', 'FHB_news', 'FHB_ship_Lager', 'FHB_ship_templates', 'FHB_sperr_list', 'FHB_stats', 'FHB_temp_Grundpreis', 'FHB_truppen_lib', 'FHB_warteschlange', 'future_human_reward', 'ip_link', 'logbook', 'message', 'message_archiv', 'message_removed', 'planets', 'planet_details', 'portal_news', 'portal_poll', 'portal_poll_voted', 'resource_trade', 'scheduler_instbuild', 'scheduler_research', 'scheduler_resourcetrade', 'scheduler_shipbuild', 'scheduler_shipmovement', 'schulden_table', 'settlers_relations', 'ships', 'ship_ccategory', 'ship_components', 'ship_fleets', 'ship_templates', 'ship_trade', 'shoutbox', 'spenden', 'starsystems', 'starsystems_details', 'starsystems_slots', 'tc_coords_memo', 'trade_settings', 'transport_logs', 'treuhandkonto', 'user', 'userally_history', 'user_diplomacy', 'user_iplog', 'user_logs', 'user_sitter_iplog', 'user_templates');
Ejemplo n.º 21
0
            <b>' . $RACE_DATA[$ship['race']][0] . '</b><br><br>

            <b>' . $ship['ship_name'] . '</b><br>

            <b>' . $ship['ship_ncc'] . '</b><br>

            <b>' . date('d/m/y H:i:s', $ship['construction_time']) . '</b><br><br>

            <b>' . (!empty($ship['last_refit_time']) ? date('d/m/y H:i:s', $ship['last_refit_time']) : constant($game->sprache("TEXT58"))) . '</b><br>

            <b>(' . $ship['hitpoints'] . '</b> / <b>' . $ship['value_5'] . ')</b> + <b><span style="color: yellow">' . $buff_value_5 . '</span></b><br>

            <b>' . $ship['value_4'] . ' + <span style="color: yellow">' . $buff_value_4 . '</span></b><br><br>

            <b>' . (intval($ship['awayteam']) == 0 ? ' <a href="' . parse_link('a=tactical_cartography&planet_id=' . encode_planet_id($ship['awayteamplanet_id'])) . '"><b>' . $ship['mission_planet_name'] . '</b></a> ' : intval($ship['awayteam'])) . '</b><br><br>

            <b><span style="color: yellow">' . $ship['experience'] . '</span></b> <img src="' . $game->GFX_PATH . 'rank_' . $rank_nr . '.jpg" width="47" height="12"><br><br>

            <b>(' . ($ship['value_1'] + $buff_value_1) . ' + <span style="color: yellow">' . round(($ship['value_1'] + $buff_value_1) * $ship_rank_bonus[$rank_nr - 1], 0) . '</span>)</b> x<b><span style="color: yellow">' . $rof . '</span></b><br>

            <b>(' . ($ship['value_2'] + $buff_value_2) . ' + <span style="color: yellow">' . round(($ship['value_2'] + $buff_value_2) * $ship_rank_bonus[$rank_nr - 1], 0) . '</span>)</b> x<b><span style="color: yellow">' . $rof2 . '</span></b><br>

            <b>' . ($ship['value_3'] + $buff_value_3) . ' + <span style="color: yellow">' . round(($ship['value_3'] + $buff_value_3) * $ship_rank_bonus[$rank_nr - 1], 0) . '</span></b><br>

            <b>' . $ship['torp'] . ' / ' . $ship['max_torp'] . '</b><br><br>

            <b>' . ($ship['value_6'] + $buff_value_6) . ' + <span style="color: yellow">' . round(($ship['value_6'] + $buff_value_6) * $ship_rank_bonus[$rank_nr - 1], 0) . '</span></b><br>

            <b>' . $ship['value_7'] . ' + <span style="color: yellow">' . round($ship['value_7'] * $ship_rank_bonus[$rank_nr - 1], 0) . '</span></b><br>
Ejemplo n.º 22
0
function own_bids()
{
    global $db;
    global $game, $ACTUAL_TICK, $NEXT_TICK;
    $per_page = 20;
    if (isset($_GET['trigger']) && $_GET['trigger'] == 1) {
        $game->option_store('type_0', (int) (1 - $game->option_retr('type_0', 1)));
    }
    if (isset($_GET['trigger']) && $_GET['trigger'] == 2) {
        $game->option_store('type_1', (int) (1 - $game->option_retr('type_1', 1)));
    }
    if (isset($_GET['trigger']) && $_GET['trigger'] == 3) {
        $game->option_store('type_2', (int) (1 - $game->option_retr('type_2', 1)));
    }
    if (isset($_GET['trigger']) && $_GET['trigger'] == 4) {
        $game->option_store('type_3', (int) (1 - $game->option_retr('type_3', 1)));
    }
    $_POST['type_0'] = $game->option_retr('type_0', 1);
    $_POST['type_1'] = $game->option_retr('type_1', 1);
    $_POST['type_2'] = $game->option_retr('type_2', 1);
    $_POST['type_3'] = $game->option_retr('type_3', 1);
    if ($_POST['type_0']) {
        $sels[] = 0;
    }
    if ($_POST['type_1']) {
        $sels[] = 1;
    }
    if ($_POST['type_2']) {
        $sels[] = 2;
    }
    if ($_POST['type_3']) {
        $sels[] = 3;
    }
    if (empty($sels)) {
        $sels[] = 4;
    }
    $game->out('
		<script language="JavaScript">
		function ConfirmClick(text,link)
{
		if (confirm(text)==true)
		{
			location.href=link;
		}
}
		</script>');
    /* 27/02/08 - AC: I'm not pretty sure but, if the function's name is own_bids, probabily variable $own_only is true... */
    $own_only = 0;
    if ($own_only == 0) {
        $str_compare = '<>';
    } else {
        $str_compare = '=';
    }
    $own_system = $db->queryrow('SELECT system_global_x, system_global_y FROM starsystems WHERE system_id = ' . $game->planet['system_id']);
    $sql = 'SELECT s.*,u.user_name,COUNT(b.id) AS num_bids FROM (ship_trade s)
			LEFT JOIN (user u) ON u.user_id=s.user
			LEFT JOIN (bidding b) ON b.trade_id=s.id
			LEFT JOIN (ships sh) ON sh.ship_id=s.ship_id
			LEFT JOIN (ship_templates t) ON t.id=sh.template_id
			WHERE s.user ' . $str_compare . ' ' . $game->player['user_id'] . ' AND b.user='******'user_id'] . ' AND s.end_time>=' . $ACTUAL_TICK . ' AND t.ship_class IN (' . implode(',', $sels) . ') GROUP BY s.id ORDER BY s.end_time ASC
			';
    if (($tradedata = $db->queryrowset($sql)) === false) {
        message(DATABASE_ERROR, 'Internal database error');
    }
    $nr = 0;
    $str_firstfield = constant($game->sprache("TEXT98"));
    if ($own_only) {
        $str_firstfield = constant($game->sprache("TEXT99"));
    }
    $str_lastfield = constant($game->sprache("TEXT64"));
    if ($own_only) {
        $str_lastfield = constant($game->sprache("TEXT100"));
    }
    $str_own = '';
    if ($own_only) {
        $str_own = constant($game->sprache("TEXT101")) . ' ';
    }
    /* 26/02/08 - AC: Check if it's currently present in the url request */
    if (!isset($_REQUEST['page'])) {
        $_REQUEST['page'] = 0;
    }
    $game->out('<center><span class="sub_caption">' . $str_own . ' ' . constant($game->sprache("TEXT8")) . ' ' . HelpPopup($own_only == true ? 'trade_viewownauction' : 'trade_viewauction') . ' :</span></center><br>');
    // Men << >>
    $game->out('<br><center><table border=0 cellpadding=2 cellspacing=2 class="style_inner" width=300><tr>
		<td width=150 align=middle><a href="' . parse_link('a=trade&view=' . $_REQUEST['view'] . '&page=' . ($_REQUEST['page'] - 1)) . '">' . constant($game->sprache("TEXT102")) . '</a>
		</td><td width=150 align=middle><a href="' . parse_link('a=trade&view=' . $_REQUEST['view'] . '&page=' . ($_REQUEST['page'] + 1)) . '">' . constant($game->sprache("TEXT103")) . '</a>
		</td></tr></table><br>');
    $game->out('<center><table border=0 cellpadding=1 cellspacing=1 class="style_outer">
		<tr><td><span class="sub_caption2">' . constant($game->sprache("TEXT104")) . '</span><br>
		<table border=0 cellpadding=1 cellspacing=1 class="style_inner" width=300>
		<tr>
		<td width=150 valign=top>
		<form name="type0form" method="post" action="' . parse_link('a=trade&view=' . $_REQUEST['view'] . '&trigger=1&page=' . $_REQUEST['page']) . '"><input type="checkbox" name="type_0" value="1"' . ($_POST['type_0'] == 1 ? ' checked="checked"' : '') . '  onChange="document.type0form.submit()">' . constant($game->sprache("TEXT105")) . '</form>
		</td><td width=150 valign=top>
		<form name="type1form" method="post" action="' . parse_link('a=trade&view=' . $_REQUEST['view'] . '&trigger=2&page=' . $_REQUEST['page']) . '"><input type="checkbox" name="type_1" value="1"' . ($_POST['type_1'] == 1 ? ' checked="checked"' : '') . '  onChange="document.type1form.submit()">' . constant($game->sprache("TEXT106")) . '</form>
		</td></tr><td>
		<form name="type2form" method="post" action="' . parse_link('a=trade&view=' . $_REQUEST['view'] . '&trigger=3&page=' . $_REQUEST['page']) . '"><input type="checkbox" name="type_2" value="1"' . ($_POST['type_2'] == 1 ? ' checked="checked"' : '') . '  onChange="document.type2form.submit()">' . constant($game->sprache("TEXT107")) . '</form>
		</td><td>
		<form name="type3form" method="post" action="' . parse_link('a=trade&view=' . $_REQUEST['view'] . '&trigger=4&page=' . $_REQUEST['page']) . '"><input type="checkbox" name="type_3" value="1"' . ($_POST['type_3'] == 1 ? ' checked="checked"' : '') . '  onChange="document.type3form.submit()">' . constant($game->sprache("TEXT108")) . '</form>
		</td>
		</tr></table>
		</td>
		</tr></table>
		</center><br>');
    $game->out('<center><table border=0 cellpadding=2 cellspacing=2 width=530 class="style_outer">');
    if (!isset($_REQUEST['page']) || $_REQUEST['page'] < 0) {
        $_REQUEST['page'] = 0;
    }
    $game->out('<tr><td width=530>
	<span class="sub_caption2">' . constant($game->sprache("TEXT109")) . ' ' . ($_REQUEST['page'] + 1) . ' ' . constant($game->sprache("TEXT110")) . ' ~' . round(count($tradedata) / $per_page + 1) . ')</span>');
    $game->out('<table border=0 cellpadding=4 cellspacing=0 width=530 class="style_inner">
	<tr><td width=235><b>' . constant($game->sprache("TEXT111")) . '</u></td><td width=200><b>' . constant($game->sprache("TEXT112")) . '</u></td><td width=25><b>#:</b></td><td width=70><b>' . constant($game->sprache("TEXT113")) . '</b></td>');
    for ($t = $_REQUEST['page'] * $per_page; $t < $_REQUEST['page'] * $per_page + $per_page; $t++) {
        if (isset($tradedata[$t])) {
            $sql = 'SELECT COUNT(*) AS num_bids FROM bidding WHERE trade_id = ' . $tradedata[$t]['id'];
            $count_bid = $db->queryrow($sql);
            $tradedata[$t]['num_bids'] = $count_bid['num_bids'];
            if ($tradedata[$t]['num_bids'] < 2) {
                $actual_price = '<img src="' . $game->GFX_PATH . 'menu_metal_small.gif">&nbsp;' . $tradedata[$t]['resource_1'];
                $actual_price .= '&nbsp;&nbsp;<img src="' . $game->GFX_PATH . 'menu_mineral_small.gif">&nbsp;' . $tradedata[$t]['resource_2'];
                $actual_price .= '&nbsp;&nbsp;<img src="' . $game->GFX_PATH . 'menu_latinum_small.gif">&nbsp;' . $tradedata[$t]['resource_3'];
                $actual_price .= '&nbsp;&nbsp;<img src="' . $game->GFX_PATH . 'menu_unit1_small.gif">&nbsp;' . $tradedata[$t]['unit_1'];
                $actual_price .= '&nbsp;&nbsp;<img src="' . $game->GFX_PATH . 'menu_unit2_small.gif">&nbsp;' . $tradedata[$t]['unit_2'];
                $actual_price .= '&nbsp;&nbsp;<img src="' . $game->GFX_PATH . 'menu_unit3_small.gif">&nbsp;' . $tradedata[$t]['unit_3'];
                $actual_price .= '&nbsp;&nbsp;<img src="' . $game->GFX_PATH . 'menu_unit4_small.gif">&nbsp;' . $tradedata[$t]['unit_4'];
                $actual_price .= '&nbsp;&nbsp;<img src="' . $game->GFX_PATH . 'menu_unit5_small.gif">&nbsp;' . $tradedata[$t]['unit_5'];
                $actual_price .= '&nbsp;&nbsp;<img src="' . $game->GFX_PATH . 'menu_unit6_small.gif">&nbsp;' . $tradedata[$t]['unit_6'];
            } else {
                $prelast_bid = $db->queryrow('SELECT * FROM bidding  WHERE trade_id = "' . $tradedata[$t]['id'] . '" ORDER BY max_bid DESC LIMIT 1,1');
                // Um zu testen, ob ein Gleichstand besteht, dann wird ja nicht max_bid +1
                $last_bid = $db->queryrow('SELECT * FROM bidding WHERE trade_id = "' . $tradedata[$t]['id'] . '" ORDER BY max_bid DESC LIMIT 1');
                if ($last_bid['max_bid'] != $prelast_bid['max_bid']) {
                    $actual_price = '<img src="' . $game->GFX_PATH . 'menu_metal_small.gif">&nbsp;' . ($tradedata[$t]['resource_1'] + ($prelast_bid['max_bid'] + 1) * $tradedata[$t]['add_resource_1']);
                    $actual_price .= '&nbsp;&nbsp;<img src="' . $game->GFX_PATH . 'menu_mineral_small.gif">&nbsp;' . ($tradedata[$t]['resource_2'] + ($prelast_bid['max_bid'] + 1) * $tradedata[$t]['add_resource_2']);
                    $actual_price .= '&nbsp;&nbsp;<img src="' . $game->GFX_PATH . 'menu_latinum_small.gif">&nbsp;' . ($tradedata[$t]['resource_3'] + ($prelast_bid['max_bid'] + 1) * $tradedata[$t]['add_resource_3']);
                    $actual_price .= '&nbsp;&nbsp;<img src="' . $game->GFX_PATH . 'menu_unit1_small.gif">&nbsp;' . ($tradedata[$t]['unit_1'] + ($prelast_bid['max_bid'] + 1) * $tradedata[$t]['add_unit_1']);
                    $actual_price .= '&nbsp;&nbsp;<img src="' . $game->GFX_PATH . 'menu_unit2_small.gif">&nbsp;' . ($tradedata[$t]['unit_2'] + ($prelast_bid['max_bid'] + 1) * $tradedata[$t]['add_unit_2']);
                    $actual_price .= '&nbsp;&nbsp;<img src="' . $game->GFX_PATH . 'menu_unit3_small.gif">&nbsp;' . ($tradedata[$t]['unit_3'] + ($prelast_bid['max_bid'] + 1) * $tradedata[$t]['add_unit_3']);
                    $actual_price .= '&nbsp;&nbsp;<img src="' . $game->GFX_PATH . 'menu_unit4_small.gif">&nbsp;' . ($tradedata[$t]['unit_4'] + ($prelast_bid['max_bid'] + 1) * $tradedata[$t]['add_unit_4']);
                    $actual_price .= '&nbsp;&nbsp;<img src="' . $game->GFX_PATH . 'menu_unit5_small.gif">&nbsp;' . ($tradedata[$t]['unit_5'] + ($prelast_bid['max_bid'] + 1) * $tradedata[$t]['add_unit_5']);
                    $actual_price .= '&nbsp;&nbsp;<img src="' . $game->GFX_PATH . 'menu_unit6_small.gif">&nbsp;' . ($tradedata[$t]['unit_6'] + ($prelast_bid['max_bid'] + 1) * $tradedata[$t]['add_unit_6']);
                } else {
                    $actual_price = '<img src="' . $game->GFX_PATH . 'menu_metal_small.gif">&nbsp;' . ($tradedata[$t]['resource_1'] + $prelast_bid['max_bid'] * $tradedata[$t]['add_resource_1']);
                    $actual_price .= '&nbsp;&nbsp;<img src="' . $game->GFX_PATH . 'menu_mineral_small.gif">&nbsp;' . ($tradedata[$t]['resource_2'] + $prelast_bid['max_bid'] * $tradedata[$t]['add_resource_2']);
                    $actual_price .= '&nbsp;&nbsp;<img src="' . $game->GFX_PATH . 'menu_latinum_small.gif">&nbsp;' . ($tradedata[$t]['resource_3'] + $prelast_bid['max_bid'] * $tradedata[$t]['add_resource_3']);
                    $actual_price .= '&nbsp;&nbsp;<img src="' . $game->GFX_PATH . 'menu_unit1_small.gif">&nbsp;' . ($tradedata[$t]['unit_1'] + $prelast_bid['max_bid'] * $tradedata[$t]['add_unit_1']);
                    $actual_price .= '&nbsp;&nbsp;<img src="' . $game->GFX_PATH . 'menu_unit2_small.gif">&nbsp;' . ($tradedata[$t]['unit_2'] + $prelast_bid['max_bid'] * $tradedata[$t]['add_unit_2']);
                    $actual_price .= '&nbsp;&nbsp;<img src="' . $game->GFX_PATH . 'menu_unit3_small.gif">&nbsp;' . ($tradedata[$t]['unit_3'] + $prelast_bid['max_bid'] * $tradedata[$t]['add_unit_3']);
                    $actual_price .= '&nbsp;&nbsp;<img src="' . $game->GFX_PATH . 'menu_unit4_small.gif">&nbsp;' . ($tradedata[$t]['unit_4'] + $prelast_bid['max_bid'] * $tradedata[$t]['add_unit_4']);
                    $actual_price .= '&nbsp;&nbsp;<img src="' . $game->GFX_PATH . 'menu_unit5_small.gif">&nbsp;' . ($tradedata[$t]['unit_5'] + $prelast_bid['max_bid'] * $tradedata[$t]['add_unit_5']);
                    $actual_price .= '&nbsp;&nbsp;<img src="' . $game->GFX_PATH . 'menu_unit6_small.gif">&nbsp;' . ($tradedata[$t]['unit_6'] + $prelast_bid['max_bid'] * $tradedata[$t]['add_unit_6']);
                }
            }
            $font_color = '#ffffff';
            $font_bold = '';
            if ($tradedata[$t]['font_bold']) {
                $font_bold = '<b>';
            }
            if ($tradedata[$t]['font_colored']) {
                $font_color = '#ffaaaa';
            }
            $game->out('<tr onMouseOver="mOver(this);" onMouseOut="mOut(this);" onClick="location.href=\'' . parse_link('a=trade&view=view_bidding_detail&id=' . $tradedata[$t]['id']) . '\'"  color:' . $font_color . ';">
				<td>' . $font_bold . $tradedata[$t]['header'] . '</b></td><td>' . $font_bold . $actual_price . '</b></td><td>' . $font_bold . $tradedata[$t]['num_bids'] . '</b></td><td>' . $font_bold . Zeit(TICK_DURATION * ($tradedata[$t]['end_time'] - $ACTUAL_TICK) + round($NEXT_TICK / 60, 0)) . '</b></td></tr>');
        }
    }
    $game->out('</table></td></tr></table>');
    // Men << >>
    $game->out('<br><center><table border=0 cellpadding=2 cellspacing=2 class="style_inner" width=300><tr>
		<td width=150 align=middle><a href="' . parse_link('a=trade&view=' . $_REQUEST['view'] . '&page=' . ($_REQUEST['page'] - 1)) . '">' . constant($game->sprache("TEXT102")) . '</a>
		</td><td width=150 align=middle><a href="' . parse_link('a=trade&view=' . $_REQUEST['view'] . '&page=' . ($_REQUEST['page'] + 1)) . '">' . constant($game->sprache("TEXT103")) . '</a>
		</td></tr></table>');
}
Ejemplo n.º 23
0
</select><br><br>
Number:&nbsp;&nbsp;<input class="field" type="text" name="n_ships">&nbsp;&nbsp;<select name="units"><option value="1">minimal troop strength</option><option value="2">maximum troop strength</option></select><br><br>
Player (ID):&nbsp;&nbsp;<input class="field" type="text" name="user_id"><br><br>
<input type="radio" name="add_type" value="1" checked="checked">&nbsp;&nbsp;New fleet:&nbsp;&nbsp;<input class="field" type="text" name="new_fleet_name">&nbsp;At planet (ID)&nbsp;<input class="field" type="text" name="new_fleet_planet"><br><br>
<input type="radio" name="add_type" value="2">&nbsp;&nbsp;Add to fleet (ID):&nbsp;&nbsp;<input class="field" type="text" name="add_fleet_id"><br><br>
<input type="radio" name="add_type" value="3">&nbsp;&nbsp;Spacedock:&nbsp;&nbsp;<input class="field" type="text" name="offduty_planet"><br><br><br>
<input class="button" type="submit" name="submit" value="Apply">
</form>
    ');
} else {
    $game->out('
<br><br>
<center>
Order template by ID: <input type="checkbox" name="order_by_id">
<br><br>
Show Torso:
    ');
    for ($i = 0; $i < 13; ++$i) {
        $game->out('[<a href="' . parse_link('a=tools/ships/create&filter_type=ship_torso&filter_id=' . $i) . '">' . ($i + 1) . '</a>]');
    }
    $game->out('
<br><br>
    ');
    for ($i = 0; $i < count($RACE_DATA); ++$i) {
        $game->out('[<a href="' . parse_link('a=tools/ships/create&filter_type=race&filter_id=' . $i) . '">' . $RACE_DATA[$i][0] . '</a>]');
    }
    $game->out('
<br><br>
<a href="' . parse_link('a=tools/ships/create&filter_type=none') . '">Show all templates</a> (<b>VERY BIG DOCUMENT!!!!</b>)</center>
    ');
}
Ejemplo n.º 24
0
        if (!$db->query($sql)) {
            message(DATABASE_ERROR, 'Could not update user override data');
        }
    } else {
        $sql = 'UPDATE user
                SET user_override_uid = ' . (int) $_POST['override_uid'] . '
                WHERE user_id = ' . $user_id;
        if (!$db->query($sql)) {
            message(DATABASE_ERROR, 'Could not update user override data');
        }
    }
    redirect('a=tools/override_uid');
}
$overridden_id = defined('OVERRIDE_UID_MODE') ? $game->player['user_id'] : $game->player['user_override_uid'];
$game->out('
        <form method="post" action="' . parse_link('a=tools/override_uid') . '">
        <table border="0" cellpadding="2" cellspacing="2" class="style_outer">
        <tr>
            <td>
            <table border="0" cellpadding="2" cellspacing="2" class="style_inner">
            <tr>
                <td>Login as:</td>
                <td><input class="field" type="text" name="override_uid" size="5" value="' . $overridden_id . '"></td>
            </tr>
            <tr>
                <td colspan=2" align="center"><input class="button" type="submit" name="submit" value="Apply"><td>
            </tr>
            </table>
            </td>
        </tr>
        </table>
Ejemplo n.º 25
0
        throw new Exception(_("Fehler beim Erstellen des Zip-Archivs!"));
    } else {
        $file_name = $file_name . ".zip";
        $path_file = $zip_path_file . ".zip";
        @unlink($tmp_file_name);
    }
}
$content_type = get_mime_type($file_name);
if (Request::int('force_download') || $content_type == "application/octet-stream") {
    $content_disposition = "attachment";
} else {
    $content_disposition = "inline";
}
// check if linked file is obtainable
if ($type == 6) {
    $link_data = parse_link($path_file);
    if ($link_data['response_code'] != 200) {
        throw new Exception(_("Diese Datei wird von einem externen Server geladen und ist dort momentan nicht erreichbar!"));
    }
    $filesize = $link_data['Content-Length'];
    if (!$filesize) {
        $filesize = false;
    }
} elseif ($type != 5) {
    $filesize = @filesize($path_file);
} else {
    $filesize = strlen($the_data);
}
// close session, download will mostly be a parallel action
page_close();
ob_end_clean();
Ejemplo n.º 26
0
                }
            }
        }
        $ticks_left = $move['move_finish'] - $ACTUAL_TICK;
        if ($ticks_left < 0) {
            $ticks_left = 0;
        }
        $game->out('

          <br><br>

          ' . constant($game->sprache("TEXT31")) . ' ' . ($i < 10 ? '<b id="timer' . $i . '" title="time1_' . ($ticks_left * TICK_DURATION * 60 + $NEXT_TICK) . '_type2_2">&nbsp;</b>' : format_time($ticks_left * TICK_DURATION)) . '

        ');
        if ($fleets_sensors) {
            $game->out('<br><br>' . constant($game->sprache("TEXT39")) . ' <a href="' . parse_link('a=ship_fleets_display&pfleet_details=' . $fleet_ids[$move['dest_id']] . '') . '"><b>' . $fleet_names[$move['dest_id']] . '</b></a>');
        }
        $game->out('

          </td>
        </tr>
      </table>
    </td>
  </tr>
</table><br>

        ');
        ++$i;
        $fleets_displayed++;
    }
}
Ejemplo n.º 27
0
      <a class="nav" href="<?php 
echo parse_link('a=login');
?>
"><img src="gfx/login.jpg" alt="login" border=0 onMouseOver="this.src='gfx/loginh.jpg';" onMouseOut="this.src='gfx/login.jpg';"></a> &nbsp;&nbsp;
      <a class="nav" href="<?php 
echo parse_link('a=register');
?>
"><img src="gfx/register.jpg" alt="register" border=0 onMouseOver="this.src='gfx/registerh.jpg';" onMouseOut="this.src='gfx/register.jpg';"></a> &nbsp;&nbsp;
      <a class="nav" href="<?php 
echo parse_link('a=stats');
?>
"><img src="gfx/stats.jpg" alt="stats" border=0 onMouseOver="this.src='gfx/statsh.jpg';" onMouseOut="this.src='gfx/stats.jpg';"></a> &nbsp;&nbsp;
      <a class="nav" href="http://wiki.stfc.it" target=_blank><img src="gfx/faq.jpg" alt="faq" border=0 onMouseOver="this.src='gfx/faqh.jpg';" onMouseOut="this.src='gfx/faq.jpg';"></a>
      <a class="nav" href="http://forum.stfc.it" target=_blank><img src="gfx/forum.jpg" alt="forum" border=0 onMouseOver="this.src='gfx/forumh.jpg';" onMouseOut="this.src='gfx/forum.jpg';"></a>
      <a class="nav" href="<?php 
echo parse_link('a=imprint');
?>
"><img src="gfx/impressum.jpg" alt="impressum" border=0 onMouseOver="this.src='gfx/impressumh.jpg';" onMouseOut="this.src='gfx/impressum.jpg';"></a> &nbsp;&nbsp;
      <a class="nav" href="https://github.com/stfc2" target=_blank><img src="gfx/developer.jpg" alt="Development" border=0 onMouseOver="this.src='gfx/developerh.jpg';" onMouseOut="this.src='gfx/developer.jpg';"></a>
    </td>
  </tr>
  <tr>
    <td width="750" height="1" bgcolor="black"></td>
  </tr>
  <tr>
    <td valign="top" align="center" width="750">
      <table cellspacing="0" cellpadding="0" width="750" align="center" border="0">
      <tbody>
        <tr>
          <td align="center" width="750">
            <!-- Middle -->
Ejemplo n.º 28
0
include 'modules/security.sprache.php';
$game->out('<center><span class="caption">' . constant($game->sprache("TEXT0")) . '<br><br></span>
<span class="sub_caption2">');
if ($game->player['content_secimage'] != "" && time() >= $game->player['timeout_secimage']) {
    $arr = explode(":", $game->player['content_secimage']);
    if (sqrt(pow($_POST['click_x'] - $arr[0], 2) + pow($_POST['click_x'] - $arr[0], 2)) < 25) {
        $game->out(constant($game->sprache("TEXT1")));
        $db->query('UPDATE user SET content_secimage="" WHERE user_id="' . $game->player['user_id'] . '" LIMIT 1');
        $db->query('UPDATE user SET timeout_secimage="' . (time() - 1) . '" WHERE user_id="' . $game->player['user_id'] . '" LIMIT 1');
        if (!isset($_REQUEST['a']) || $_REQUEST['a'] == "security") {
            $_REQUEST['a'] = $_POST['command'];
        }
        redirect('a=' . $_REQUEST['a']);
    } else {
        if (!isset($_REQUEST['a']) || $_REQUEST['a'] == "security") {
            $db->query('UPDATE user SET error_secimage=error_secimage+1 WHERE user_id="' . $game->player['user_id'] . '" LIMIT 1');
            $game->out(constant($game->sprache("TEXT2")) . ' ' . ($game->player['error_secimage'] + 1) . '. ' . constant($game->sprache("TEXT3")));
        }
    }
    if (!isset($_REQUEST['a']) || $_REQUEST['a'] == "security") {
        $_REQUEST['a'] = $_POST['command'];
    }
    $data = create_secimage();
    $db->query('UPDATE user SET timeout_secimage="' . (time() - 1) . '", content_secimage="' . $data['center'] . '", link_secimage="' . $data['filename'] . '" WHERE user_id="' . $game->player['user_id'] . '" LIMIT 1');
    $game->out('<form name="secimage" method="post" action="' . parse_link('a=security') . '">
		<input type="image" name="click" src="' . $data['filename'] . '">
		<input type="hidden" name="command" value="' . $_REQUEST['a'] . '">
		</form>' . constant($game->sprache("TEXT4")));
} else {
    $game->out(constant($game->sprache("TEXT5")));
}
    the Free Software Foundation; either version 3 of the License, or
    (at your option) any later version.

    STFC is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/
// Must be commented out because this tool cannot be used otherwise without planet
$game->init_player();
check_auth(STGC_DEVELOPER);
if (!isset($_GET['sure'])) {
    $game->out('<br><center>Really do a repair of the slots?<br><br><b>There MUST not be any slots already!</b><br><br><a href="' . parse_link('a=tools/world/repair_starsystem_slots&sure') . '">Create new</a></center>');
    return;
}
$system_slots = array();
$n_slots = 0;
$n_sectors = $game->sectors_per_quadrant * 4;
for ($i = 1; $i <= $n_sectors; ++$i) {
    $system_slots[$i] = array();
    for ($j = 1; $j <= $game->sector_map_split; ++$j) {
        for ($k = 1; $k <= $game->sector_map_split; ++$k) {
            $system_slots[$i][] = array($j, $k);
            ++$n_slots;
        }
    }
}
$game->out('Prepared ' . $n_slots . ' slots<br>');
Ejemplo n.º 30
0
 function create_system_map($system_id = 0)
 {
     global $db, $game, $ACTUAL_TICK, $PLANETS_DATA;
     $sql = 'SELECT system_id,
                    system_starcolor_red,
                    system_starcolor_green,
                    system_starcolor_blue,
                    system_starsize
             FROM starsystems
             WHERE system_id = "' . $system_id . '"';
     if (($system = $db->queryrow($sql)) === false) {
         message(DATABASE_ERROR, 'Could not query starsystem data');
     }
     if (empty($system['system_id'])) {
         message(GENERAL, 'Could not find system ' . $system_id);
     }
     // DC ---- Fog of war is coming!!!
     $sql = 'SELECT p.planet_id, p.planet_name, p.planet_type, p.planet_distance_px, p.planet_covered_distance, p.planet_current_x, p.planet_current_y, p.planet_points,
                    u.user_id, u.user_name, u.user_attack_protection, u.user_points,
                    a.alliance_id, a.alliance_tag, a.alliance_name
             FROM (planets p)
             LEFT JOIN (user u) ON u.user_id = p.planet_owner
             LEFT JOIN (alliance a) ON a.alliance_id = u.user_alliance
             WHERE p.system_id = ' . $system_id . ' ORDER BY p.planet_id';
     if (!($q_planets = $db->query($sql))) {
         message(DATABASE_ERROR, 'Could not query planets data');
     }
     // DC ----
     $system_is_known = false;
     $sql = 'SELECT COUNT(*) AS system_is_known FROM starsystems_details WHERE system_id = ' . $system_id . ' AND user_id = ' . $game->player['user_id'];
     if (!($q_details = $db->queryrow($sql))) {
         message(DATABASE_ERROR, 'Could not query planet details data');
     }
     if (isset($q_details['system_is_known']) && $q_details['system_is_known'] > 0 || $game->player['user_auth_level'] == STGC_DEVELOPER) {
         $system_is_known = true;
     }
     // ----
     $n_planets = $db->num_rows($q_planets);
     $im = imagecreate($this->system_map_size, $this->system_map_size);
     imagecolorallocate($im, 0, 0, 0);
     $this->draw_stars($im, $this->system_map_size, 800);
     $center_coord = $this->system_map_size / 2;
     $star_color = imagecolorallocate($im, $system['system_starcolor_red'], $system['system_starcolor_green'], $system['system_starcolor_blue']);
     $star_size = $system['system_starsize'];
     imagefilledellipse($im, $center_coord, $center_coord, $star_size, $star_size, $star_color);
     $orbit_color = imagecolorallocate($im, 50, 50, 50);
     $cl_own_planet = imagecolorallocate($im, 0, 255, 0);
     // green
     $cl_active_planet = imagecolorallocate($im, 255, 255, 0);
     // yellow
     $cl_alliance_planet = imagecolorallocate($im, 0, 0, 255);
     // blue
     $cl_settlers_planet = imagecolorallocate($im, 204, 102, 0);
     // orange
     $cl_attack_protection = imagecolorallocate($im, 180, 180, 180);
     // gray
     $cl_alliance_war = imagecolorallocate($im, 255, 0, 0);
     // red
     $cl_alliance_bnd_pbnd = imagecolorallocate($im, 137, 202, 239);
     // lightblue
     $map_html = '<map name="system_map">' . NL;
     $used_distances = array();
     $planet_images = array();
     for ($i = 1; $i <= $star_size + 10; ++$i) {
         $used_distances[$i] = true;
     }
     $rect_coords = array(array(3, 5, 1, 3), array(7, 5, 5, 3), array(3, 1, 1, -1), array(7, 1, 5, -1));
     $rows_planets = $db->fetchrowset($q_planets);
     foreach ($rows_planets as $planet) {
         $radius = $planet['planet_distance_px'];
         imageellipse($im, $center_coord, $center_coord, $radius * 2, $radius * 2, $orbit_color);
         if ($planet['planet_current_x'] == 0) {
             $coords = $this->calculate_planet_position($radius, $planet['planet_covered_distance']);
             $planet_x = $coords[0];
             $planet_y = $coords[1];
             $sql = 'UPDATE planets
                     SET planet_current_x = ' . $planet_x . ',
                         planet_current_y = ' . $planet_y . '
                     WHERE planet_id = ' . $planet['planet_id'];
             if (!$db->query($sql)) {
                 message(DATABASE_ERROR, 'Could not update planet position data');
             }
         } else {
             $planet_x = $planet['planet_current_x'];
             $planet_y = $planet['planet_current_y'];
         }
         $current_type = $planet['planet_type'];
         $planet_width = $PLANETS_DATA[$current_type][8];
         if (empty($planet_colors[$current_type])) {
             $planet_colors[$current_type] = imagecolorallocate($im, $PLANETS_DATA[$current_type][9][0], $PLANETS_DATA[$current_type][9][1], $PLANETS_DATA[$current_type][9][2]);
         }
         if ($planet['user_id'] == $game->player['user_id'] || $planet['alliance_id'] == $game->player['user_alliance'] || $system_is_known) {
             imagefilledellipse($im, $planet_x, $planet_y, $PLANETS_DATA[$current_type][8], $PLANETS_DATA[$current_type][8], $planet_colors[$current_type]);
         } else {
             $fake_colors = imagecolorallocate($im, 255, 255, 255);
             imagefilledellipse($im, $planet_x, $planet_y, 5, 5, $fake_colors);
         }
         // DC ---- Fog of War: here we go!
         if ($planet['user_id'] == $game->player['user_id'] || $planet['alliance_id'] == $game->player['user_alliance'] || $system_is_known) {
             $map_html .= '<area href="' . parse_link('a=tactical_cartography&planet_id=' . encode_planet_id($planet['planet_id'])) . '" shape="circle" coords="' . (int) $planet_x . ', ' . (int) $planet_y . ', ' . $PLANETS_DATA[$current_type][8] . '"';
             $map_html .= ' onmouseover="return overlib(\'<font color=gray><b>' . $this->str_name . '</b> ' . str_replace("'", "\\'", $planet['planet_name']) . '</font><br><font color=gray><b>' . $this->str_class . '</b> ' . strtoupper($planet['planet_type']) . '</font>';
             if (empty($planet['user_id'])) {
                 $map_html .= '<br><i>' . $this->str_uninhabited . '</i>';
             } else {
                 $map_html .= '<br><b>' . $this->str_owner . '</b> ' . $planet['user_name'];
                 $map_html .= (!empty($planet['alliance_name']) ? '<br><font color=gray><b>' . $this->str_alliance . '</b> ' . str_replace("'", "\\'", $planet['alliance_name']) . ' [' . $planet['alliance_tag'] . ']</font>' : '') . '<br><b>' . $this->str_points . '</b> ' . $planet['planet_points'] . ' (' . $planet['user_points'] . ' ges.)';
             }
             // DC Try to give more information, just for fun
             $sql = 'SELECT sf.fleet_name, sf.n_ships, sf.fleet_id FROM ship_fleets sf 
                     INNER JOIN planets pl ON pl.planet_id = sf.planet_id 
                     WHERE pl.planet_id = ' . $planet['planet_id'] . ' AND sf.user_id = ' . $game->player['user_id'];
             if ($fleet_details = $db->queryrowset($sql)) {
                 foreach ($fleet_details as $f_i) {
                     $map_html .= '<br>' . $this->str_fleet_player . ' <b>' . htmlentities($f_i['fleet_name']) . '</b>, ' . $f_i['n_ships'] . ' ' . $this->str_ships;
                 }
             }
             // DC More info! Let's push mysql
             $sql = 'SELECT survey_1, survey_2, survey_3 FROM planet_details
                     WHERE log_code = 100 AND planet_id = ' . $planet['planet_id'] . '
                     AND user_id = ' . $game->player['user_id'];
             if ($survey_details = $db->queryrow($sql)) {
                 $map_html .= '<br>' . $this->str_res;
                 switch ($survey_details['survey_1']) {
                     case 0:
                         $map_html .= '<font color=red>' . $this->str_met . '</font> ';
                         break;
                     case 1:
                         $map_html .= '<font color=gray>' . $this->str_met . '</font> ';
                         break;
                     case 2:
                         $map_html .= '<font color=green>' . $this->str_met . '</font> ';
                         break;
                 }
                 switch ($survey_details['survey_2']) {
                     case 0:
                         $map_html .= '<font color=red>' . $this->str_mins . '</font> ';
                         break;
                     case 1:
                         $map_html .= '<font color=gray>' . $this->str_mins . '</font> ';
                         break;
                     case 2:
                         $map_html .= '<font color=green>' . $this->str_mins . '</font> ';
                         break;
                 }
                 switch ($survey_details['survey_3']) {
                     case 0:
                         $map_html .= '<font color=red>' . $this->str_dilh . '</font>';
                         break;
                     case 1:
                         $map_html .= '<font color=gray>' . $this->str_dilh . '</font>';
                         break;
                     case 2:
                         $map_html .= '<font color=green>' . $this->str_dilh . '</font>';
                         break;
                 }
             }
             // ----
             $map_html .= '\', CAPTION, \'' . $this->str_details . '\', WIDTH, 300, ' . OVERLIB_STANDARD . ');" onmouseout="return nd();">';
         } else {
             $map_html .= '<area href="' . parse_link('a=tactical_cartography&planet_id=' . encode_planet_id($planet['planet_id'])) . '" shape="circle" coords="' . (int) $planet_x . ', ' . (int) $planet_y . ', ' . $PLANETS_DATA[$current_type][8] . '"';
             $map_html .= ' onmouseover="return overlib(\'<b><i>&#171;Nessuna Informazione&#187;</i></b>\', CAPTION, \'' . $this->str_details . '\', WIDTH, 300, ' . OVERLIB_STANDARD . ');" onmouseout="return nd();">';
         }
         $rect_colors = array();
         if ($planet['user_id'] == $game->player['user_id'] || $planet['alliance_id'] == $game->player['user_alliance'] || $system_is_known) {
             if ($planet['planet_id'] == $game->planet['planet_id']) {
                 $rect_colors[] = $cl_active_planet;
             }
             if ($planet['user_attack_protection'] > $ACTUAL_TICK) {
                 $rect_colors[] = $cl_attack_protection;
             }
             $rotz = 0;
             $rotz = $planet['alliance_id'];
             if (empty($rotz)) {
                 $rotz = 0;
             }
             $sql = 'SELECT ad_id, alliance1_id, alliance2_id, type, status
                     FROM alliance_diplomacy
                     WHERE (alliance1_id = ' . $rotz . ' OR
                            alliance2_id = ' . $rotz . ') AND (alliance1_id = ' . $game->player['user_alliance'] . ' OR
                            alliance2_id = ' . $game->player['user_alliance'] . ') AND ((status = 0) OR (type=1 AND status=2))';
             if (($alliance_1 = $db->queryrow($sql)) === false) {
                 message(DATABASE_ERROR, 'Could not query alliance data');
             }
             if (!empty($alliance_1['ad_id'])) {
                 $sql = 'SELECT alliance_id
                         FROM alliance
                         WHERE alliance_id != ' . $game->player['user_alliance'] . ' AND
                              (alliance_id = ' . $alliance_1['alliance1_id'] . ' OR
                               alliance_id = ' . $alliance_1['alliance2_id'] . ')';
                 if (($alliance_2 = $db->queryrow($sql)) === false) {
                     message(DATABASE_ERROR, 'Could not query alliance data');
                 }
             }
             if ($planet['user_id'] == $game->player['user_id']) {
                 $rect_colors[] = $cl_own_planet;
             } elseif ($planet['user_id'] == INDEPENDENT_USERID) {
                 $rect_colors[] = $cl_settlers_planet;
             } elseif ($planet['alliance_id'] == $game->player['user_alliance']) {
                 $rect_colors[] = $cl_alliance_planet;
             } elseif ($planet['alliance_id'] == $alliance_2['alliance_id'] && $alliance_1['type'] == 1) {
                 $rect_colors[] = $cl_alliance_war;
             } elseif ($planet['alliance_id'] == $alliance_2['alliance_id'] && $alliance_1['type'] == 3) {
                 $rect_colors[] = $cl_alliance_bnd_pbnd;
             }
         }
         if (!empty($rect_colors)) {
             for ($i = 0; $i < count($rect_colors); ++$i) {
                 imagefilledrectangle($im, $planet_x - $planet_width - $rect_coords[$i][0], $planet_y - $rect_coords[$i][1], $planet_x - $planet_width - $rect_coords[$i][2], $planet_y - $rect_coords[$i][3], $rect_colors[$i]);
             }
         }
     }
     imagepng($im, 'maps/images/cache/' . md5($game->player['user_id']) . '.png');
     imagedestroy($im);
     $map_html .= '</map>';
     return $map_html;
 }