Exemplo n.º 1
0
if (!isset($_REQUEST['act'])) {
    ///---
    // TODO: Revoir l'affichage du cron vortex...
    $dates[0] = date('Y-m-d H:i:s');
    $dates[1] = mktime($lngmain['wormholes_hour'], $lngmain['wormholes_minute'], 0, date('m'), date('d') - date('w') + $lngmain['wormholes_day']);
    //    $dates[2] = mktime(3, 01, 0, date('m'), date('d') - date('w') - 7);
    $tpl->admin_vortex($dates, $cleanvortex_delete, DataEngine::config('wormhole_cleaning'));
    //---
    $empire = array();
    $mysql_result = DataEngine::sql('SELECT `EMPIRE` from `SQL_PREFIX_Coordonnee_Joueurs` GROUP BY `EMPIRE` ASC');
    while ($ligne = mysql_fetch_array($mysql_result)) {
        if (trim($ligne['EMPIRE']) == '') {
            continue;
        }
        $cur_emp = htmlentities(stripslashes($ligne['EMPIRE']), ENT_QUOTES, 'utf-8');
        $shw_emp = DataEngine::utf_strip($ligne['EMPIRE']);
        $shw_emp = p_strlen($shw_emp) > 50 ? p_substr($shw_emp, 0, 47) . '...' : $shw_emp;
        $shw_emp = htmlentities($shw_emp, ENT_QUOTES, 'utf-8');
        $empire[$cur_emp] = $shw_emp;
    }
    $tpl->empire_switch($empire, $emp_upd);
    $tpl->empire_allys($empire);
    $tpl->empire_wars($empire);
    $tpl->empire_allywars($allysnb, $warsnb);
    //$tpl->empire_wars($empire, $emp_war);
    //
    //---
    $dates = array();
    $dates[$lng['dates'][0]] = '-1';
    $dates[$lng['dates'][1]] = time();
    $dates[$lng['dates'][2]] = mktime(3, 0, 0, date('m'), date('d') - date('w'));
Exemplo n.º 2
0
    public function empire_wars($empire_list)
    {
        $out = <<<col1_r
<form action="{$this->BASE_FILE}" method='post'>
\t<TR class="color_header">
\t\t<TD colspan=4>{$this->lng['empire_wars']}</TD>
\t</TR>
\t<TR class="base_row0">
\t\t<TD colspan=3 align=center>
\t\t<select class="base_row0" name='emp'>
\t\t\t<option value=''>{$this->lng['empire_wars_sel']}</option>
col1_r;
        $this->PushOutput($out);
        $this->SelectOptions($empire_list, -1);
        $out = <<<col2_r
\t\t</select>
\t\t</TD>
                <td class="color_header text_center"><input class="color_header" name='emp_war_add' type=submit value="{$this->lng['empire_wars_add']}"></td>
\t</TR>
\t<TR class="base_row1">
\t\t<TD colspan=3><font color="red">
col2_r;
        $wars = DataEngine::config('EmpireEnnemy');
        $nb = count($wars);
        if (is_array($wars) && $nb > 0) {
            $i = 0;
            foreach ($wars as $key => $emp) {
                $i++;
                $emp = DataEngine::utf_strip($emp);
                $out .= '<a href="?emp_war_rm=' . $key . '">' . $this->lng['empire_wars_del'] . '</a> &nbsp; &nbsp; ' . $emp;
                if ($i < $nb) {
                    $out .= '<br/>';
                }
            }
        } else {
            $out .= $this->lng['empire_wars_empty'];
        }
        $out .= <<<col3_r
\t\t</font></TD>
                <td class="color_header">&nbsp;</td>
\t</TR>
</form>
<tr class="color_row1">
<td colspan=4 height="1px"></td>
</tr>
col3_r;
        $this->PushOutput($out);
    }