function initimg($Nbx, $Nby, $taillex, $tailley) { global $colormap, $image, $debug_cl; $map = map::getinstance(); $image = imagecreate($Nbx * $taillex, $Nby * $tailley); $background_color = imagecolorallocate($image, 0, 0, 0); $blanc = imagecolorallocate($image, 254, 254, 254); $rouge = imagecolorallocate($image, 85, 0, 64); imagefilledrectangle($image, 0, 0, $Nbx * $taillex, $Nby * $tailley, $background_color); // Tableau des couleurs... $colormap = DataEngine::config('MapColors'); $colormap = $colormap[$map->itineraire ? 0 : $map->sc + 1]; if ($map->itineraire) { $map->load_prefs('1;0;0;0;' . $map->sc . ';' . $map->taille . ';0;0;0'); } foreach ($colormap as $k => $c) { $R = hexdec(p_substr($c, 1, 2)); $V = hexdec(p_substr($c, 3, 2)); $B = hexdec(p_substr($c, 5, 2)); $colormap[$k] = imagecolorallocate($image, $R, $V, $B); } $colormap[-1] = $debug_cl = $blanc; $colormap[-2] = $rouge; // Centre de communication... $comlevel = ownuniverse::getinstance()->get_comlevel(); if (is_array($comlevel)) { foreach ($comlevel as $k => $planet) { list($CoordsY, $CoordsX) = map::ss2xy($planet['ss']); $level = $planet['level']; if ($level > 0) { ImageFilledEllipse($image, 1 + ($CoordsY - 1) * $taillex + round($taillex / 2) + 1, 1 + ($CoordsX - 1) * $tailley + round($tailley / 2) + 1, $level * 20 * $taillex, $level * 20 * $tailley, $colormap["0"]); } } } return $image; }
public function __construct() { $this->reset(); $this->lng = language::getinstance()->GetLngBlock('cartographie'); $this->lngmain = language::getinstance()->GetLngBlock('dataengine'); $this->allys = DataEngine::config('EmpireAllys'); $this->wars = DataEngine::config('EmpireEnnemy'); if (!is_array($this->allys) && $this->allys != '') { $this->allys = array($this->allys); } if (!is_array($this->wars) && $this->wars != '') { $this->wars = array($this->wars); } if (!is_array($this->allys) && $this->allys == '') { $this->allys = array(); } if (!is_array($this->wars) && $this->wars == '') { $this->wars = array(); } if (is_array($this->allys)) { $this->allys = parser::getinstance()->cleaning_array($this->allys); } if (is_array($this->wars)) { $this->wars = parser::getinstance()->cleaning_array($this->wars); } $this->detelespooler = array(); }
public function Legend() { $cls = DataEngine::config('MapColors'); $id = $this->map->itineraire ? 0 : $this->map->sc + 1; $out = <<<h \t\t</form> \t<Table class="color_row0"> \t\t<tr> \t\t\t<td class="color_header text_center" colspan=2>{$this->lng['legend']}</td> \t\t</tr> h; $legend = $this->lng['maplegend'][$id]; $i = 0; foreach ($legend as $k => $v) { $Ð = $i % 2; $out .= <<<l \t\t<tr class="color_row{$Ð}"> \t\t\t<td class="size20" style="background-color: {$cls[$id][$k]};"> </td> \t\t\t<td> {$v} </td> \t\t</tr> l; $i++; } $out .= <<<f </Table> \t</div> f; $this->PushOutput($out); }
/** * @param integer $NeededAXX Constante du niveau d'accès * @return boolean */ public static function CheckPerms($NeededAXX = AXX_MEMBER) { if (is_numeric($NeededAXX)) { return $_SESSION['_Perm'] >= $NeededAXX; } $perms = DataEngine::config('perms'); if (isset($perms[$NeededAXX])) { return $_SESSION['_Perm'] >= $perms[$NeededAXX] && $perms[$NeededAXX] != AXX_DISABLED; } else { trigger_error('CXX not found ' . $NeededAXX . '. option disabled for all instead. Verify installation, or configure it now by admin panel', E_USER_WARNING); return false; } }
public function __wakeup() { $this->filename = CACHE_PATH . 'map.' . md5($_SESSION['_login'] . $_SESSION['_pass']) . '.js'; if (file_exists($this->filename)) { $this->lastrun = filemtime($this->filename); $sqlr = DataEngine::sql('SELECT udate FROM SQL_PREFIX_Coordonnee ORDER BY udate DESC LIMIT 1'); $sqla = mysql_fetch_array($sqlr); if ($this->lastrun > $sqla['udate']) { $this->CronPattern = strftime("%M %H %d %m 0", time() + 3600); } else { $this->CronPattern = strftime("%M %H %d %m %w", time()); } } else { $this->lastrun = 0; $this->CronPattern = '* * * * *'; } } } // ----------------------------------------------------------------------------- DataEngine::conf_cache('cron'); $cron_conf = DataEngine::config('cron'); if (is_object($cron_conf)) { $cron = $cron_conf; } else { $cron = phpcron_list::getinstance(); $cron->AddJob(new job_vortex()); $cron->AddJob(new job_buttons()); $cron->AddJob(new job_css()); $cron->AddJob(new job_map_tooltips()); } //DataEngine::Grab_Custom_Jobs();
} ///--- ///--- if ($_REQUEST['act'] == 'logs' && Members::CheckPerms('MEMBRES_ADMIN_LOG')) { $tpl->page_title = $lng['logs_title']; $tpl->log_header(); $mysql_result = DataEngine::sql('SELECT `DATE`, `log`, `IP` from `SQL_PREFIX_Log` ORDER BY `ID` DESC LIMIT 40'); while ($ligne = mysql_fetch_array($mysql_result)) { $tpl->log_row($ligne); } $tpl->log_footer(); } if ($_REQUEST['act'] == 'perms' && Members::CheckPerms(AXX_ROOTADMIN)) { $cxx_name = Members::s_cperms(); $axx_name = Members::s_perms(); $cxx_conf = DataEngine::config('perms'); $axx_num = count($axx_name); $tpl->page_title = $lng['perms_title']; $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)) {
public function Save() { if (!is_object(DataEngine::config('cron'))) { DataEngine::conf_add('cron', $this); } else { DataEngine::conf_update('cron', $this); } DataEngine::sql_do_spool(); }
public function config_xxx($Grades) { $config = DataEngine::config('config'); $bollstr = array(1 => 1, 0 => 0); $bollstrinv = array(0 => 1, 1 => 0); foreach ($Grades as $v) { $combograde .= '<option value="' . $v['GradeId'] . '" ' . ($v['GradeId'] == $config['DefaultGrade'] ? 'selected' : '') . '>' . $v['Grade'] . '</option>'; } $CanRegister[$bollstr[$config['CanRegister']]] = ' selected'; $CanRegister[$bollstrinv[$config['CanRegister']]] = ''; $closed[$bollstr[$config['closed']]] = ' selected'; $closed[$bollstrinv[$config['closed']]] = ''; $out = <<<out <input type="hidden" name="configuration" value="true"/> <input type="hidden" name="data[version]" value="{$config['version']}"/> <TR class="color_row0"> <TD>{$this->lng['config_forumlink']}</TD> <TD><input class="color_row0 size250" name="data[ForumLink]" value="{$config['ForumLink']}" type="text"/></TD> </TR> <TR class="color_row1"> <TD>{$this->lng['config_canregister']}</TD> <TD><select class="color_row1" name="data[CanRegister]"> <option value="0"{$CanRegister[0]}>{$this->lng['config_canregister_off']}</option> <option value="1"{$CanRegister[1]}>{$this->lng['config_canregister_on']}</option> </select></TD> </TR> <TR class="color_row0"> <TD>{$this->lng['config_defaultgrade']}</TD> <TD {$this->lng['config_defaultgrade_tip']}><select class="color_row0" name="data[DefaultGrade]"> {$combograde} </select></TD> </TR> <TR class="color_row1"> <TD>{$this->lng['config_myempire']}</TD> <TD {$this->lng['config_myempire_tip']}><input class="color_row1 size250" name="data[MyEmpire]" value="{$config['MyEmpire']}" type="text"/></TD> </TR> <TR class="color_row0"> <TD>{$this->lng['config_Parcours_Max_Time']}</TD> <TD {$this->lng['config_Parcours_Max_Time_tip']}><input class="color_row0 size20" name="data[Parcours_Max_Time]" value="{$config['Parcours_Max_Time']}" type="text"/></TD> </TR> <TR class="color_row1"> <TD>{$this->lng['config_Parcours_Nearest']}</TD> <TD {$this->lng['config_Parcours_Nearest_tip']}><input class="color_row1 size20" name="data[Parcours_Nearest]" value="{$config['Parcours_Nearest']}" type="text"/></TD> </TR> <TR class="color_row0"> <TD>{$this->lng['config_greasemonkey']}</TD> <TD {$this->lng['config_greasemonkey_tip']}><input class="color_row0 size1210" name="data[eude_srv]" value="{$config['eude_srv']}" type="text"/></TD> </TR> <TR class="color_row1"> <TD>{$this->lng['config_closed']}</TD> <TD><select class="color_row1" name="data[closed]"> <option value="0"{$closed[0]}>{$this->lng['config_closed_no']}</option> <option value="1"{$closed[1]}>{$this->lng['config_closed_yes']}</option> </select></TD> </TR> out; $this->PushOutput($out); }