public function level_player_row($joueur) { // FB::info($joueur); $ship = $editlink = ''; if (Members::CheckPerms(AXX_MODO) && $joueur['ship'] != '') { $ship = sprintf($this->lng['level_player_row_ship'], $joueur['ship']); } if (Members::CheckPerms(AXX_ADMIN)) { $editlink = ' <a href="%ROOT_URL%editmembres.php?Joueur=' . $joueur['Joueur'] . '"><img src="%IMAGES_URL%edit.png"></a> '; } $joueur['Points'] = DataEngine::format_number($joueur['Points'], true); if (Members::CheckPerms('PERSO_OWNUNIVERSE_READONLY')) { $joueur['Joueur'] = sprintf('<a href="%%ROOT_URL%%ownuniverse.php?showuser=%s">%1$s</a>', $joueur['Joueur']); } $bulle = bulle(sprintf($this->lng['level_player_row_bulle'], $ship, $joueur['Points'], $joueur['Commerce'], $joueur['Recherche'], $joueur['Combat'], $joueur['Construction'], $joueur['Economie'], $joueur['Navigation'])); $out = <<<lpr <li {$bulle}>{$editlink}{$joueur['Joueur']}</li> lpr; $this->PushOutput($out); }
public static function conf_load() { if (!self::$conf_loaded) { self::$conf_loaded = true; $keys = '\'' . implode('\',\'', self::$conf_load) . '\''; $mysql_result = self::sql('SELECT `key`, `value` FROM SQL_PREFIX_Config WHERE `key` IN (' . $keys . ')'); while ($ligne = mysql_fetch_assoc($mysql_result)) { if (trim($ligne['key']) == '') { continue; } self::$settings[$ligne['key']] = unserialize($ligne['value']); } // Initialisations particulières { // if (self::$conf_load['wormhole_cleaning']) { // $lng = language::getinstance()->GetLngBlock('dataengine'); // $wormhole_cleaning = self::$settings['wormhole_cleaning']; // if (date('w') == $lng['wormholes_day'] && $wormhole_cleaning['enabled']) { // $runat = mktime($lng['wormholes_hour'], $lng['wormholes_minute'], 0, date('m'), date('d'), date('Y')); // $now = time(); // if ($now > $runat && $runat > $wormhole_cleaning['lastrun']) { // $mysql_result = DataEngine::sql('SELECT ID FROM `SQL_PREFIX_Coordonnee` WHERE `TYPE`=1'); // while ($row = mysql_fetch_assoc($mysql_result)) // $tmp[] = $row['ID']; // // if (is_array($tmp) && count($tmp) > 0) { // $tmp = implode(',', $tmp); // DataEngine::sql('DELETE FROM `SQL_PREFIX_Coordonnee` WHERE `ID` in (' . $tmp . ')'); // DataEngine::sql('DELETE FROM `SQL_PREFIX_Coordonnee_Joueurs` WHERE `jID` in (' . $tmp . ')'); // DataEngine::sql('DELETE FROM `SQL_PREFIX_Coordonnee_Planetes` WHERE `pID` in (' . $tmp . ')'); // } // self::sql('INSERT INTO `SQL_PREFIX_Log` (DATE,LOGIN,IP) VALUES(NOW(),\'vortex_reset_by:' . $_SESSION['_login'] . '\' ,\'' . Get_IP() . '\')'); // $wormhole_cleaning['lastrun'] = $now; // self::conf_update('wormhole_cleaning', $wormhole_cleaning); // self::sql_do_spool(); // Mettre à jour maintenant, pas que deux membres le fasse a 1/2sec d'intervalle. // addons::getinstance()->VortexCleaned(); // } // } // } if (CHECK_LOGIN && $GLOBALS['validsession']) { if (self::$settings['config']['closed'] && !Members::CheckPerms(AXX_ROOTADMIN)) { if (NO_SESSIONS) { $lng = language::getinstance()->GetLngBlock('login'); output::_DoOutput('<eude><alert>' . $lng['currently_closed_nohtml'] . '</alert><GM_active>0</GM_active></eude>'); } else { session_destroy(); output::Boink(ROOT_URL); } } } // if (is_array(self::$settings['config'])) { // if (isset(self::$settings['config']['version'])) { // if (preg_match('/(\d+\.\d+\.\d+)\.?(\d+)?/', self::Get_Version(), $version) > 0) { // if (version_compare(self::$settings['config']['version'], $version[1], '<')) { // output::Boink('%ROOT_URL%upgrade/run' . self::$settings['config']['version'] . '.php'); // } // } // } // } self::$conf_load = array(); } return self::$conf_loaded; }
public function CheckPerms() { return Members::CheckPerms('addons_wormhole_import'); }
$carto->AddErreur($lng['err_noaxx']); break; } $water = $_POST['WATER'] != '' && is_numeric($_POST['WATER']) ? DataEngine::strip_number($_POST['WATER']) : ''; $batiments = $_POST['BUILDINGS'] != "" && is_numeric($_POST['BUILDINGS']) ? DataEngine::strip_number($_POST['BUILDINGS']) : ''; if (!$carto->FormatId(trim($_POST['COORIN']), $uni, $sys, '')) { $xml['log'] = sprintf($lng['player_err_coords'], $_POST['COORIN']); $carto->AddWarn($xml['log']); } else { $carto->Edit_Entry($_POST['COORIN'], array('water' => $water, 'batiments' => $batiments), $lng['player_edit_msg']); $xml['log'] = sprintf($lng['player_edit_log'], $sys); } break; case 'empire': // -------------------------------------------------------- if (!Members::CheckPerms('EMPIRE_GREASE')) { $carto->AddErreur('Permissions manquante'); break; } $empire_name = gpc_esc(html_entity_decode($_POST['empire'])); $membres = unserialize(gpc_esc($_POST['data'])); $query = 'UPDATE `SQL_PREFIX_Coordonnee_Joueurs` SET `EMPIRE` = \'\' WHERE `EMPIRE` LIKE \'' . sqlesc($empire_name) . '\''; DataEngine::sql($query); // $carto->AddInfo($query); array_walk($membres, 'array_fullsqlesc'); $listemembres = implode(',', $membres); $query = 'UPDATE `SQL_PREFIX_Coordonnee_Joueurs` SET `EMPIRE` = \'' . sqlesc($empire_name) . '\' WHERE `USER` in (' . $listemembres . ')';
public function CheckPerms() { return Members::CheckPerms('CARTOGRAPHIE_SCANNER'); }
if (isset($ligne['troop_date'])) { $tpl->AddToRow(bulle(sprintf($lng['search_troopdate'], date($lng['search_date_long_format']), $ligne['troop_date'])), 'troop_date'); } else { $tpl->AddToRow('', 'troop_date'); } $tmp = sprintf($lng['search_userdate'], $ligne['UTILISATEUR'], date($lng['search_date_long_format'], $ligne['udate'])); $tpl->AddToRow(bulle($tmp), 'userdate'); $tpl->AddToRow(date($lng['search_date_short_format'], $ligne['udate']), 'udate'); if (Members::CheckPerms('CARTOGRAPHIE_DELETE')) { $tpl->AddToRow($cmdinput, 'cmd_delete'); $tpl->AddToRow('delete', 'cmd'); $tpl->AddToRow(bulle($lng['search_bulle_cmd_delete']), 'bulle'); } else { $tpl->AddToRow('', 'cmd_delete'); } if (Members::CheckPerms('CARTOGRAPHIE_EDIT')) { $tpl->AddToRow($cmdinput, 'cmd_edit'); $tpl->AddToRow('edit', 'cmd'); $tpl->AddToRow(bulle($lng['search_bulle_cmd_edit']), 'bulle'); } else { $tpl->AddToRow('', 'cmd_edit'); } $tpl->AddToRow($i % 2, 'rowA'); $tpl->AddToRow(($i + 1) % 2, 'rowB'); $tpl->AddToRow($ligne['ID'], 'id'); $tpl->PushRow(); $i++; } $tpl->SearchResult_End(); $tpl->AddToRow($tpl->GetPagination($PageCurr, $MaxPage + 1), 'pagination'); $tpl->PushRow();
public function CheckPerms() { return Members::CheckPerms('addons_sample'); }
$i++; $modif = false; foreach ($Joueur as $k => $v) { if ($v != $OldJoueur[$k]) { $modif = true; break; } } if ($modif) { DataEngine::sql_spool('UPDATE `SQL_PREFIX_Membres` SET `Points`=\'' . $Joueur['ModifPoints'] . '\', `Grade`=\'' . $Joueur['ModifGrade'] . '\', `Race`=\'' . $Joueur['ModifRace'] . '\' WHERE `Joueur`=\'' . $Joueur['ID'] . '\''); DataEngine::sql_spool('UPDATE `SQL_PREFIX_Users` SET `Permission`=\'' . $Joueur['ModifPermission'] . '\' WHERE `Login`=\'' . $Joueur['ID'] . '\''); } if ($Joueur['pass'] && Members::CheckPerms('MEMBRES_NEWPASS')) { DataEngine::sql_spool('UPDATE `SQL_PREFIX_Users` SET `Password`=md5(\'' . $Joueur['pass'] . '\') WHERE `Login`=\'' . $Joueur['ID'] . '\''); } if ($Joueur['Suppr'] && Members::CheckPerms('MEMBRES_DELETE')) { Members::DeleteUser($Joueur['ID']); } } //while if (DataEngine::has_sql_spool()) { DataEngine::sql_do_spool(); } } //if $mysql_result = DataEngine::sql('SELECT `GradeId`, `Grade`, `Niveau`, `Rattachement` from `SQL_PREFIX_Grade` ORDER BY `Rattachement`, `Niveau`'); $i = 0; while ($ligne = mysql_fetch_assoc($mysql_result)) { $Grades[] = $ligne; } //***********
<?php /** * @author Alex10336 * Dernière modification: $Id$ * @license GNU Public License 3.0 ( http://www.gnu.org/licenses/gpl-3.0.txt ) * @license Creative Commons 3.0 BY-SA ( http://creativecommons.org/licenses/by-sa/3.0/deed.fr ) * **/ define('USE_AJAX', true); require_once '../init.php'; require_once INCLUDE_PATH . 'Script.php'; if (!Members::CheckPerms('CARTE_JOUEUR')) { $out = <<<o <carte> <script> Carte.DetailsShow(false); alert('Accès requis manquant'); </script> </carte> o; output::_DoOutput($out); } //Tracé Menu if (!isset($_GET["ID"]) or $_GET["ID"] == "") { output::_DoOutput("<CarteDetails><content><![CDATA[Aucune donnée a charger, retour :<a href='javascript:void();' onclick='Carte.DetailsShow(false)'>Carte</a>]]></content></CarteDetails>"); } $id = intval($_GET['ID']); $sql = <<<sql SELECT `TYPE`, `POSIN`, `POSOUT`, `COORDET`, `COORDETOUT`, `USER`, `EMPIRE`, `INFOS` FROM`SQL_PREFIX_Coordonnee`
public function CheckPerms() { return Members::CheckPerms('ADVANCED_SCANNER'); }
$ss_result[$line['POSIN']] = $line['POSIN']; } mysql_free_result($mysql_result); $tabdata = array(); if (isset($_POST['ss']) && $_POST['ss'] != "") { foreach (explode(',', $_POST['ss']) as $v) { if (!isset($ss_result[$v])) { $tabdata[] = 'Carte.Remove_SS(' . $v . ');'; } } } $currentsearch = implode(',', $ss_result); $vortex_a = array(); $CurrSS_a = array(); $empire = trim(DataEngine::config_key('config', 'MyEmpire')); $cxx_empires = Members::CheckPerms('CARTE_SHOWEMPIRE'); $sql = 'SELECT `ID`, `POSIN`, `POSOUT` from `SQL_PREFIX_Coordonnee` where `Type`=1'; $mysql_result = DataEngine::sql($sql); while ($line = mysql_fetch_assoc($mysql_result)) { $vortex_a[$line['POSOUT']][$line['ID']]['POSIN'] = $line['POSOUT']; $vortex_a[$line['POSOUT']][$line['ID']]['POSOUT'] = $line['POSIN']; $vortex_a[$line['POSOUT']][$line['ID']]['TYPE'] = 1; } mysql_free_result($mysql_result); $sql = <<<sql SELECT c.`ID`, c.`TYPE`, c.`POSIN`, c.`POSOUT`, j.`USER`, j.`INFOS`, j.`EMPIRE`, IFNULL(g.`Grade`,'') as Grade, IFNULL(m.`Joueur`,'') as Joueur FROM SQL_PREFIX_Coordonnee as c LEFT JOIN SQL_PREFIX_Coordonnee_Joueurs as j on (c.id=j.jid) LEFT JOIN `SQL_PREFIX_Membres` m on (j.`USER`=m.`Joueur`) LEFT JOIN `SQL_PREFIX_Grade` g on (m.`Grade`=g.`GradeId`)
public function footer() { $cols = 9; if (Members::CheckPerms('MEMBRES_NEWPASS')) { $cols++; } if (Members::CheckPerms('MEMBRES_DELETE')) { $cols++; } $out = <<<f <TR align=right><TD Colspan={$cols}><input type="submit" value="{$this->lng['btn_submit']}"></TD></TR> </Form> </TABLE> </TD> </TR></TABLE> f; $this->PushOutput($out); }
} } else { mb_internal_encoding('utf-8'); function p_strlen($str) { return mb_strlen($str); } function p_stripos($haystack, $needle, $offset = NULL) { return mb_stripos($haystack, $needle, $offset); } function p_strripos($haystack, $needle, $offset = NULL) { return mb_strripos($haystack, $needle, $offset); } function p_substr($str, $start, $length = NULL) { return mb_substr($str, $start, $length); } } function array_fullsqlesc(&$item1, $key) { $item1 = '\'' . mysql_escape_string($item1) . '\''; } DataEngine::init(); if (CHECK_LOGIN) { require_once INCLUDE_PATH . '/login.php'; } /// ### Mode debug, root admin & dev ONLY ### FB::setEnabled(IN_DEV && Members::CheckPerms(AXX_ROOTADMIN)); FB::info(DataEngine::$browser->getBrowser(), 'Browser');
foreach ($levels as $levelkey => $level) { $tpl->level_header(); foreach ($level as $GradeKey => $GradeId) { $tpl->level_grade($Grades[$GradeKey]['Grade']); } $tpl->level_grade_sep(); foreach ($level as $GradeKey => $GradeId) { if (!isset($players[$GradeId])) { $tpl->level_players_empty(); continue; } $tpl->level_players_header(); foreach ($players[$GradeId] as $player) { $tpl->level_player_row($player); } $tpl->level_players_footer(); } $tpl->level_footer(); } $tpl->level_vs_grade(); // Séparer les grades de la création de joueur ? if (Members::CheckPerms('MEMBRES_NEW')) { $tpl->Grade_Header()->Grade_AddPlayer($Grades)->Grade_Sep(); $tpl->Grade_Modif_Header(); foreach ($Grades as $v) { $tpl->Grade_Modif($Grades, $v); } $tpl->Grade_New($Grades)->Grade_modif_Footer()->Grade_Footer(); } // Perm $tpl->DoOutput();
function cnhTB() { global $cnhMenus; global $cnhSousMenus; $menus = null; $rplSize = null; $prefixnom = ''; $nbrow = 1; $minibar = false; switch (func_num_args()) { case 4: if (func_get_arg(0) == 0) { $menus = $cnhSousMenus[func_get_arg(3)]; } else { $menu0 = array($cnhMenus[0]); $menu1 = $cnhSousMenus[func_get_arg(3)]; $menus = array_merge($menu0, $menu1); } case 3: if (!is_null(func_get_arg(2))) { $rplSize = func_get_arg(2); } case 2: if (!is_null(func_get_arg(1))) { $prefixnom = func_get_arg(1); } case 1: if (func_get_arg(0) == 0) { $nbrow = 1; $minibar = true; } else { $nbrow = func_get_arg(0); } } if (empty($menus)) { $menus = $cnhMenus; } $nreel = 0; for ($i = 0; $i < sizeof($menus); $i++) { if (Members::CheckPerms($menus[$i][5])) { $nreel++; } } $def_table = '<table border=0 align=center cellpadding=' . (!$minibar ? '15' : '3') . ' cellspacing=0>'; $def_tr = '<tr valign=top>'; echo "\n" . $def_table . $def_tr; $nbcol = ceil($nreel / $nbrow); $wi = number_format(100 / $nbcol, 1); $j = 0; for ($i = 0; $i < sizeof($menus); $i++) { if (Members::CheckPerms($menus[$i][5])) { if ($j % $nbcol == 0 && $j > 0) { if ($nreel - $j < $nbcol && number_format(100 / ($nreel - $j), 1) != $wi) { $wi = number_format(100 / ($nreel - $j), 1); echo '</tr></table>' . $def_table . $def_tr; } else { echo '</tr>' . $def_tr; } } echo '<td align=center width=' . $wi . '%>'; if (!empty($menus[$i][4])) { echo '<div title=\'' . $menus[$i][4] . '\'>'; } if ($minibar) { echo "<font size='-2'>"; } if (!empty($menus[$i][1])) { echo '<a href=' . $menus[$i][1] . '>'; } if (!empty($menus[$i][2])) { $larg = null; if (!empty($rplSize)) { $larg = $rplSize; } elseif (!empty($menus[$i][3])) { $larg = $menus[$i][3]; } echo '<img ' . (!empty($larg) ? ' width=' . $larg . ' height=' . $larg . ' ' : '') . 'src="images/menu/' . (!empty($prefixnom) ? $prefixnom : '') . $menus[$i][2] . '.png" border=0 align=absmiddle>'; } if (!$minibar && !empty($menus[$i][4])) { $t = (!empty($menus[$i][0]) ? '<b>' . $menus[$i][0] . '</b><br>' : '') . $menus[$i][4]; } elseif (!$minibar && empty($menus[$i][4])) { $t = '<b>' . $menus[$i][0] . '</b><br>'; } elseif (!empty($menus[$i][0])) { $t = $menus[$i][0]; } else { $t = $menus[$i][4]; } echo '<br />' . $t . (!empty($menus[$i][1]) ? '</a>' : '') . ($minibar ? '</font>' : '') . (!empty($menus[$i][4]) ? '</div>' : '') . '</td>'; $j++; } } echo "</tr></table>\n"; }
private function perms_prefs() { if (!Members::CheckPerms('CARTE_JOUEUR')) { $this->joueur = 0; } }
$tpl->perms_header(); $i = 0; // Loop par CXX foreach ($cxx_name as $cxx_k => $cxx_v) { $class = 'color_row' . $i % 2; if (is_numeric($cxx_k)) { $tpl->perms_category($cxx_v); continue; } else { $tpl->perms_row($cxx_k, $cxx_v, $axx_name, $cxx_conf); } $tpl->PushOutput('</tr>'); if (is_numeric($cxx_k)) { $i = 1; } $i++; } $tpl->perms_footer(); } ///--- if ($_REQUEST['act'] == 'config' && Members::CheckPerms(AXX_ROOTADMIN)) { $mysql_result = DataEngine::sql('SELECT * from `SQL_PREFIX_Grade` ORDER BY `Rattachement`, `Niveau`'); while ($ligne = mysql_fetch_assoc($mysql_result)) { $Grades[] = $ligne; } $tpl->page_title = $lng['config_title']; $tpl->config_header(); $tpl->config_xxx($Grades); $tpl->config_footer(); } $tpl->DoOutput();
public function navigation() { $ennemis_bool = array('1' => 'enemy', '0' => 'ga'); $allys_bool = array('1' => 'own', '0' => 'neutral'); $pnj_bool = array('1' => 'npc', '0' => 'neutral'); $onoff_bool = array('0' => 'Off', '1' => 'On'); $invert_bool = array('0' => '1', '1' => '0'); $onoff_sc = $onoff_bool[($this->map->sc + 1) % 2]; $onoff_vortex = $onoff_bool[$this->map->vortex]; $onoff_joueur = $onoff_bool[$this->map->joueur]; $onoff_planete = $onoff_bool[$this->map->planete]; $onoff_asteroide = $onoff_bool[$this->map->asteroide]; $onoff_ennemis = $onoff_bool[$this->map->ennemis]; $onoff_allys = $onoff_bool[$this->map->allys]; $onoff_pnj = $onoff_bool[$this->map->pnj]; $img_ennemis = $ennemis_bool[$this->map->ennemis]; $img_allys = $allys_bool[$this->map->allys]; $img_pnj = $pnj_bool[$this->map->pnj]; $get_sc = $invert_bool[$this->map->sc]; $get_vortex = $invert_bool[$this->map->vortex]; $get_joueur = $invert_bool[$this->map->joueur]; $get_planete = $invert_bool[$this->map->planete]; $get_asteroide = $invert_bool[$this->map->asteroide]; $get_ennemis = $invert_bool[$this->map->ennemis]; $get_allys = $invert_bool[$this->map->allys]; $get_pnj = $invert_bool[$this->map->pnj]; $helpmsg = bulle($this->lng['helpmsg']); $msg_taill_inc = bulle($this->lng['msg_taill_inc']); $msg_taill_dec = bulle($this->lng['msg_taill_dec']); $msg_cls = bulle($this->lng['msg_cls']); $msg_all_on = bulle($this->lng['msg_all_on']); $msg_all_off = bulle($this->lng['msg_all_off']); $msg_vortex = bulle(sprintf($this->lng['msg_vortex'], $onoff_vortex)); $msg_joueur = bulle(sprintf($this->lng['msg_joueur'], $onoff_joueur)); $msg_planete = bulle(sprintf($this->lng['msg_planete'], $onoff_planete)); $msg_asteroide = bulle(sprintf($this->lng['msg_asteroide'], $onoff_asteroide)); $msg_ennemis = bulle(sprintf($this->lng['msg_ennemis'], $onoff_ennemis)); $msg_allys = bulle(sprintf($this->lng['msg_allys'], $onoff_allys)); $msg_pirate = bulle(sprintf($this->lng['msg_pirate'], $onoff_pnj)); $msg_search1 = bulle($this->lng['msg_search1']); $msg_search2 = bulle($this->lng['msg_search2']); $taille_inc = $this->map->taille + 100; $taille_dec = $this->map->taille - 100; $search = isset($_SESSION['search']) ? $_SESSION['search'] : ''; $can_search = Members::CheckPerms('CARTE_SEARCH'); $nav_size = $can_search ? 900 : 540; $nav_size2 = $this->map->taille + 420; $out = <<<NAV <div class="color_header" style="width:{$nav_size2}px; height:30px; top:50px; position:absolute;"> \t<TABLE class="color_header" style="width:{$nav_size}px; white-space: no-wrap"> \t\t<TR>\t \t\t\t<TD> \t\t\t\t<A {$msg_taill_inc} HREF="{$this->BASE_FILE}?taille={$taille_inc}"> + </A> \t\t\t\t \t\t\t\t<A {$msg_taill_dec} HREF="{$this->BASE_FILE}?taille={$taille_dec}"> – </A> \t\t\t</TD> \t\t\t<TD><img {$helpmsg} width=20 height=20 src='%IMAGES_URL%help.png'></TD> \t\t\t<TD> \t\t\t\t<A {$msg_cls} HREF="{$this->BASE_FILE}?sc={$get_sc}"> \t\t\t\t<img width=20 height=20 src="%IMAGES_URL%Btn-Couleur-{$onoff_sc}.png"></A> \t\t\t</TD> \t\t\t<TD> <A {$msg_all_on} HREF="{$this->BASE_FILE}?AllSwitch=1"><img width=10 height=10 src="%IMAGES_URL%Btn-Vortex-On.png"><img width=10 height=10 src="%IMAGES_URL%Btn-Planete-On.png"><img width=10 height=10 src="%IMAGES_URL%Btn-Joueur-On.png"><img width=10 height=10 src="%IMAGES_URL%Btn-Asteroide-On.png"></A><br/> <A {$msg_all_off} HREF="{$this->BASE_FILE}?AllSwitch=0"><img width=10 height=10 src="%IMAGES_URL%Btn-Vortex-Off.png"><img width=10 height=10 src="%IMAGES_URL%Btn-Planete-Off.png"><img width=10 height=10 src="%IMAGES_URL%Btn-Joueur-Off.png"><img width=10 height=10 src="%IMAGES_URL%Btn-Asteroide-Off.png"></A></TD> \t\t\t<TD> \t\t\t\t<A {$msg_vortex} HREF="{$this->BASE_FILE}?vortex={$get_vortex}"> \t\t\t\t<img width=18 height=18 src="%IMAGES_URL%Btn-Vortex-{$onoff_vortex}.png"></A> \t\t\t</TD> \t\t\t<TD> \t\t\t\t<A {$msg_joueur} HREF="{$this->BASE_FILE}?joueur={$get_joueur}"> \t\t\t\t<img width=18 height=18 src="%IMAGES_URL%Btn-Joueur-{$onoff_joueur}.png"></A> \t\t\t</TD> \t\t\t<TD> \t\t\t\t<A {$msg_planete} HREF="{$this->BASE_FILE}?planete={$get_planete}"> \t\t\t\t<img width=18 height=18 src="%IMAGES_URL%Btn-Planete-{$onoff_planete}.png"></A> \t\t\t</TD> \t\t\t<TD> \t\t\t\t<A {$msg_asteroide} HREF="{$this->BASE_FILE}?asteroide={$get_asteroide}"> \t\t\t\t<img width=18 height=18 src="%IMAGES_URL%Btn-Asteroide-{$onoff_asteroide}.png"></A> \t\t\t</TD> \t\t\t<TD> \t\t\t\t<A {$msg_ennemis} HREF="{$this->BASE_FILE}?ennemis={$get_ennemis}"> \t\t\t\t<img width=18 height=18 src="%IMAGES_URL%fleet_{$img_ennemis}.gif"></A> \t\t\t</TD> \t\t\t<TD> \t\t\t\t<A {$msg_allys} HREF="{$this->BASE_FILE}?allys={$get_allys}"> \t\t\t\t<img width=18 height=18 src="%IMAGES_URL%fleet_{$img_allys}.gif"></A> \t\t\t</TD> \t\t\t<TD> \t\t\t\t<A {$msg_pirate} HREF="{$this->BASE_FILE}?pnj={$get_pnj}"> \t\t\t\t<img width=18 height=18 src="%IMAGES_URL%fleet_{$img_pnj}.gif"></A> \t\t\t</TD> \t\t\t<TD class="size110 text_right"> {$this->lng['msg_coords']} </td> \t\t\t<td id="Coord" class="size60 color_row0 text_center">- - - -</td> NAV; if (Members::CheckPerms('CARTE_SEARCH')) { $out .= <<<SEARCH <form id="searchempire" action="Carte.php" method="post" OnSubmit="return Navigateur.DoSearch();"> \t\t\t<td {$msg_search1} align=right> <select class="color_header" name="type"> <option value="emp">{$this->lng['msg_search_emp']}</option> <option value="jou" selected="true">{$this->lng['msg_search_jou']}</option> <option value="inf">{$this->lng['msg_search_info']}</option> </select></td> \t\t\t<td {$msg_search2}><input class="color_header" type=text name=search value="{$search}"></td> </form> SEARCH; } $out .= <<<f </TR> \t</TABLE> </div> f; $this->PushOutput($out); }
public function RunJob() { $this->_lock(); $vortex_a = array(); $CurrSS_a = array(); $empire = trim(DataEngine::config_key('config', 'MyEmpire')); $cxx_empires = Members::CheckPerms('CARTE_SHOWEMPIRE'); $this->fp = fopen($this->filename, 'w'); stream_set_write_buffer($this->fp, 0); fwrite($this->fp, 'var ss_info=Array();'); $sql = 'SELECT `ID`, `POSIN`, `POSOUT` from `SQL_PREFIX_Coordonnee` where `Type`=1'; $mysql_result = DataEngine::sql($sql); while ($line = mysql_fetch_assoc($mysql_result)) { $vortex_a[$line['POSOUT']][$line['ID']]['POSIN'] = $line['POSOUT']; $vortex_a[$line['POSOUT']][$line['ID']]['POSOUT'] = $line['POSIN']; $vortex_a[$line['POSOUT']][$line['ID']]['TYPE'] = 1; } mysql_free_result($mysql_result); $sql = <<<sql SELECT c.`ID`, c.`TYPE`, c.`POSIN`, c.`POSOUT`, j.`USER`, j.`INFOS`, j.`EMPIRE`, IFNULL(g.`Grade`,'') as Grade, IFNULL(m.`Joueur`,'') as Joueur FROM SQL_PREFIX_Coordonnee as c LEFT JOIN SQL_PREFIX_Coordonnee_Joueurs as j on (c.id=j.jid) LEFT JOIN `SQL_PREFIX_Membres` m on (j.`USER`=m.`Joueur`) LEFT JOIN `SQL_PREFIX_Grade` g on (m.`Grade`=g.`GradeId`) ORDER BY c.`POSIN` ASC sql; $mysql_result = DataEngine::sql($sql); $CurrSS = 0; while ($line = mysql_fetch_assoc($mysql_result)) { if ($CurrSS == 0) { $CurrSS = $line['POSIN']; } if ($line['POSIN'] != $CurrSS) { if (isset($vortex_a[$CurrSS]) && is_array($vortex_a[$CurrSS])) { foreach ($vortex_a[$CurrSS] as $k => $v) { $CurrSS_a[$k] = $v; $CurrSS_a[$k]['type'] = 'Vortex'; $CurrSS_a['Vortex'] = isset($CurrSS_a['Vortex']) ? $CurrSS_a['Vortex']++ : 1; } unset($vortex_a[$CurrSS]); // destruction du vortex... } $this->add_ss($CurrSS, $CurrSS_a); $CurrSS = $line['POSIN']; $CurrSS_a = array(); // if ($CurrSS == 1240) // break; // if ($CurrSS == 1240) // xdebug_break(); } $ID = $line['ID']; $ss = $line['POSIN']; $CurrSS_a[$ID] = $line; switch ($line['TYPE']) { case 0: $type = 'Joueur'; break; case 1: $type = 'Vortex'; break; case 2: $type = 'Planète'; break; case 3: $type = 'alliance'; break; case 4: $type = 'Astéroïde'; break; case 5: $type = 'Ennemi'; break; case 6: $type = 'pnj'; break; default: $type = 'na'; } if ($empire != '' && $line['EMPIRE'] == $empire && $cxx_empires) { $type = 'empire'; } // if (eval($typeeval)) $type = 'search'; if (stristr($line['USER'], $_SESSION['_login']) !== FALSE) { $type = 'moi'; } $CurrSS_a[$ID]['type'] = $type; if (isset($CurrSS_a[$CurrSS_a[$ID]['type']])) { $CurrSS_a[$CurrSS_a[$ID]['type']]++; } else { $CurrSS_a[$CurrSS_a[$ID]['type']] = 1; } } mysql_free_result($mysql_result); if (isset($vortex_a[$CurrSS]) && is_array($vortex_a[$CurrSS])) { foreach ($vortex_a[$CurrSS] as $k => $v) { $CurrSS_a[$k] = $v; $CurrSS_a[$k]['type'] = 'Vortex'; $CurrSS_a['Vortex'] = isset($CurrSS_a['Vortex']) ? $CurrSS_a['Vortex']++ : 1; } unset($vortex_a[$CurrSS]); // destruction du vortex... } $this->add_ss($CurrSS, $CurrSS_a); fclose($this->fp); parent::RunJob(); }
<?php /** * @author Alex10336 * Dernière modification: $Id$ * @license GNU Public License 3.0 ( http://www.gnu.org/licenses/gpl-3.0.txt ) * @license Creative Commons 3.0 BY-SA ( http://creativecommons.org/licenses/by-sa/3.0/deed.fr ) * **/ require_once './init.php'; require_once INCLUDE_PATH . 'Script.php'; if (!Members::CheckPerms('CARTOGRAPHIE')) { if (Members::CheckPerms('CARTE')) { output::Boink(ROOT_URL . 'Carte.php'); } else { output::Boink(ROOT_URL . 'Mafiche.php'); } } else { output::Boink(ROOT_URL . 'cartographie.php'); }
**/ require_once './init.php'; require_once INCLUDE_PATH . 'Script.php'; require_once CLASS_PATH . 'ownuniverse.class.php'; require_once CLASS_PATH . 'parser.class.php'; require_once TEMPLATE_PATH . 'ownuniverse.tpl.php'; Members::CheckPermsOrDie('PERSO_OWNUNIVERSE'); $ownuniverse = ownuniverse::getinstance(); $lng = language::getinstance()->GetLngBlock('ownuniverse'); // initialisation des variables $info = $warn = ''; if (isset($_GET['reset']) && $_GET['reset'] == $_SESSION['_permkey']) { DataEngine::sql('DELETE FROM `SQL_PREFIX_ownuniverse` WHERE `UTILISATEUR` = \'' . $_SESSION['_login'] . '\' LIMIT 1'); output::Boink('%ROOT_URL%ownuniverse.php'); } if ($_GET['showuser'] != '' && Members::CheckPerms('PERSO_OWNUNIVERSE_READONLY')) { $player = gpc_esc($_GET['showuser']); $include_form = false; } else { $player = false; $include_form = true; } if (isset($_POST['importation'])) { $cleandata = $ownuniverse->get_universe(false); // initialise les infos (planet) $data = gpc_esc($_POST['importation']); // Partie centre de controle if ($data != "" and strpos($data, $lng['control_center_ident']) !== false) { $cleandata = $ownuniverse->parse_ownuniverse($data); if ($cleandata === false) { $cleandata = $ownuniverse->get_universe(false);
<?php /** * @author Alex10336 * Dernière modification: $Id$ * @license GNU Public License 3.0 ( http://www.gnu.org/licenses/gpl-3.0.txt ) * @license Creative Commons 3.0 BY-SA ( http://creativecommons.org/licenses/by-sa/3.0/deed.fr ) */ include '../init.php'; require_once INCLUDE_PATH . 'Script.php'; if (!Members::CheckPerms(AXX_ROOTADMIN)) { Members::NoPermsAndDie(); } include_once 'upgrade.tpl.php'; $tpl = tpl_upgrade::getinstance(); $tpl->Setheader(); //------------------------------------------------------------------------------ $inf_title = 'Mise à jour depuis 1.4.5(.0) vers 1.4.5.1'; $file = 'upgrade1450'; //------------------------------------------------------------------------------ $path = ROOT_PATH . 'upgrade' . DIRECTORY_SEPARATOR; $sqlfile = $path . $file . '.sql'; $lockfile = $path . $file . '.lock'; if (file_put_contents($path . 'test.lock', $cur + 1) === false) { @unlink($path . 'test.lock'); @chmod('../upgrade/', '0777'); stop_on_error('I/O Error test.lock chmod "/upgrade" directory to 777'); } if (!file_exists($sqlfile)) { stop_on_error('Mise à jour corrompue !'); }
public function CheckPerms() { return Members::CheckPerms('in_dev'); }
public function add_PNJ($coords, $nom = '', $fleet = '') { if (!Members::CheckPerms('CARTOGRAPHIE_PNJ')) { return $this->AddErreur($this->lng['class_err_noaxx']); } $qnom = sqlesc(trim($nom)); $qfleet = sqlesc(trim($fleet)); if (!$this->FormatId(trim($coords), $uni, $sys, 'NPC')) { return false; } $query = 'SELECT `ID`, `TYPE` FROM `SQL_PREFIX_Coordonnee` where `POSIN`=\'' . $uni . '\' AND `COORDET`=\'' . $sys . '\''; $array = DataEngine::sql($query); $ligne = mysql_fetch_assoc($array); if ($ligne['ID'] > 0) { $query = <<<sql UPDATE `SQL_PREFIX_Coordonnee` LEFT JOIN `SQL_PREFIX_Coordonnee_Joueurs` on id=jid SET `TYPE`=6, `USER`='%s', `INFOS`='%s', `UTILISATEUR`='%s' WHERE `ID`=%d sql; $query = sprintf($query, $qnom, $qfleet, sqlesc($_SESSION['_login']), $ligne['ID']); DataEngine::sql($query); if (mysql_affected_rows() > 0) { return $this->AddInfo(sprintf($this->lng['class_npc_msg1'], $nom, $uni, $sys)); } else { return $this->AddInfo(sprintf($this->lng['class_npc_msg2'], $nom, $uni, $sys)); } } else { $query = sprintf('INSERT INTO `SQL_PREFIX_Coordonnee` (`TYPE`,`POSIN`,`COORDET`,`udate`,`UTILISATEUR`)' . ' VALUES (6,%d,\'%s\',%d,\'%s\')', $uni, $sys, time(), sqlesc($_SESSION['_login'])); DataEngine::sql($query); $id = mysql_insert_id(); $query = sprintf('INSERT INTO `SQL_PREFIX_Coordonnee_Joueurs` (`jID`,`USER`,`INFOS`)' . ' VALUES (%d,\'%s\',\'%s\')', $id, $qnom, $qfleet); DataEngine::sql($query); return $this->AddInfo(sprintf($this->lng['class_npc_msg3'], $nom, $uni, $sys)); } }
public function CheckPerms() { return Members::CheckPerms('CARTOGRAPHIE_TRIANGULATION'); }