02 |
function Getenums($evalue = 0, $egroup) |
04 |
if (!isset($GLOBALS[ 'em_' . $egroup . 's' ])) { |
05 |
$cachefile = DEDEDATA . '/enums/' . $egroup . '.php' ; |
06 |
if (!file_exists($cachefile)) { |
07 |
require_once DEDEINC . '/enums.func.php' ; |
10 |
if (!file_exists($cachefile)) { |
13 |
require_once $cachefile; |
17 |
if ($evalue % 500 == 0) { |
18 |
return isset($GLOBALS[ 'em_' . $egroup . 's' ][$evalue]) ? $GLOBALS[ 'em_' . $egroup . 's' ][$evalue] : '' ; |
20 |
if (preg_match( '#([0-9]{1,}).([0-9]{1,})#' , $evalue, $matchs)) { |
22 |
$esonvalue = $matchs[1]; |
23 |
$etopvalue = $esonvalue - $esonvalue % 500; |
24 |
$esecvalue = preg_replace( '/(?<=.)[0]+/' , '' , $evalue); |
26 |
$GLOBALS[ 'em_' . $egroup . 's' ][$etopvalue] = empty($GLOBALS[ 'em_' . $egroup . 's' ][$etopvalue]) ? '' : $GLOBALS[ 'em_' . $egroup . 's' ][$etopvalue]; |
28 |
$GLOBALS[ 'em_' . $egroup . 's' ][$esonvalue] = empty($GLOBALS[ 'em_' . $egroup . 's' ][$esonvalue]) ? '' : $GLOBALS[ 'em_' . $egroup . 's' ][$esonvalue]; |
30 |
$GLOBALS[ 'em_' . $egroup . 's' ][$esecvalue] = empty($GLOBALS[ 'em_' . $egroup . 's' ][$esecvalue]) ? '' : $GLOBALS[ 'em_' . $egroup . 's' ][$esecvalue]; |
32 |
return $GLOBALS[ 'em_' . $egroup . 's' ][$etopvalue] . ' - ' . $GLOBALS[ 'em_' . $egroup . 's' ][$esonvalue] . ' - ' . $GLOBALS[ 'em_' . $egroup . 's' ][$esecvalue]; |
36 |
$elimit = $evalue % 500; |
37 |
$erevalue = $evalue - $elimit; |
38 |
$GLOBALS[ 'em_' . $egroup . 's' ][$erevalue] = empty($GLOBALS[ 'em_' . $egroup . 's' ][$erevalue]) ? '' : $GLOBALS[ 'em_' . $egroup . 's' ][$erevalue]; |
39 |
$GLOBALS[ 'em_' . $egroup . 's' ][$evalue] = empty($GLOBALS[ 'em_' . $egroup . 's' ][$evalue]) ? '' : $GLOBALS[ 'em_' . $egroup . 's' ][$evalue]; |
40 |
return $GLOBALS[ 'em_' . $egroup . 's' ][$erevalue] . ' - ' . $GLOBALS[ 'em_' . $egroup . 's' ][$evalue]; |
|