function make_object($strr, $aa = "main", $langarr = false, $cont = false, $inglue = "", $outglue = "", $temp2 = false) { global $arr1timers; if (!is_array($arr1timers)) { $arr1timers = array(); } # echo "TESTETE";die(); global $_cfg, $exacts, $lang; $skipthiscacheload = false; if ($cont != false) { global ${$cont}; } $thiscfg =& $_cfg; if (!isset($strr)) { $strr = ''; } if ($cont != false) { $passcont = $cont; if (isset(${$passcont}[$aa]) && strlen(${$passcont}[$aa]) > 0) { $skipthiscacheload = true; } } else { $passcont = false; } if (!isset($thiscfg[$aa]['min-userlevel'])) { $thiscfg[$aa]['min-userlevel'] = 0; } if (isset($thiscfg[$aa]['min-userlevel']) && $_SESSION[$_SESSION['rdmstring']] >= $thiscfg[$aa]['min-userlevel'] || is_array($exacts) && in_array($_SESSION[$_SESSION['rdmstring']], $exacts)) { #echo "# access granted";die(); #echo "<pre>";print_r(${$passcont}); #die(); # find cached #echo "<pre>";print_r($thiscfg);die(); if (!isset($thiscfg[$aa]['cachelife'])) { $timeofmylife = 0; } elseif (!is_numeric($thiscfg[$aa]['cachelife'])) { $timeofmylife = 60; } else { $timeofmylife = $thiscfg[$aa]['cachelife']; } #echo "<pre>"; print_r($thiscfg); echo "<hr />"; if (isset($thiscfg[$aa]['str']) && $strr != "") { #echo $thiscfg[$aa]['str']."<br />"; #echo $thiscfg[$aa]['str']." -- $aa <br />"; ##echo $thiscfg[$aa]['str']." "; $cache = gethe("cache", md5($thiscfg[$aa]['str'] . $lang), $timeofmylife); } else { $cache = false; } # if ($GLOBALS['dbg']==true){ echo $thiscfg[$aa]['str'].$lang.$aa." -->";} if ($cache == false || $cache == true && $skipthiscacheload == false) { if ($strr != "") { $cache = $strr; } else { if (isset($thiscfg[$aa]['tmpl_inp'])) { $cache = gethe("tmpl", $thiscfg[$aa]['tmpl_inp'], $timeofmylife); } else { $cache = ''; } } # echo getcwd()."/".$thiscfg[$aa]['tmpl_inp']; if (function_exists("guilang") && is_array($langarr)) { $cache = guilang($cache, $langarr, "{lang:", "/l}"); } # echo "WTF";die(); #echo $aa."<br /><pre>";print_r($thiscfg[$aa]);die(); #print_r(${$passcont});die(); #if ($cont!=false && isset(${$passcont}[$aa])){echo "WTWF";die();} #echo ${$passcont}[$aa];die(); if (isset($thiscfg[$aa]) && isset($thiscfg[$aa]['cnt_inp']) && strlen($thiscfg[$aa]['cnt_inp']) > 0) { $conttemp = gethe("cont", $thiscfg[$aa]['cnt_inp'] . $lang . $aa, $timeofmylife); $temp =& $conttemp; } elseif ($cont != false && isset(${$passcont}[$aa])) { $conttemp = ${$passcont}[$aa]; $temp = $conttemp; # echo ${$passcont}[$aa];#conttemp; #die(); } # echo "WTF";die(); # echo $conttemp;die(); if (isset($thiscfg[$aa]['str']) && strstr($cache, $inglue . $thiscfg[$aa]['str'] . $outglue) && isset($conttemp)) { $temp = str_replace($inglue . $thiscfg[$aa]['str'] . $outglue, $conttemp, $cache); } else { #echo $cache."TWETWE";die(); $temp = $cache; } #echo $thiscfg[$aa]['str']." <p />".$thiscfg[$aa]['cachable'];#die(); #echo "WTF";die(); # MARKER if (isset($thiscfg[$aa]) && isset($thiscfg[$aa]['cachable']) && $thiscfg[$aa]['cachable'] != "off" && isset($conttemp)) { if (!isset($thiscfg[$aa]['cachelife']) || !is_numeric($thiscfg[$aa]['cachelife'])) { $timeofmylife = 60; } else { $timeofmylife = $thiscfg[$aa]['cachelife']; } #echo $conttemp; writecache($conttemp, md5($thiscfg[$aa]['str'] . $lang), $timeofmylife); if ($GLOBALS['dbg'] == true) { echo $conttemp . " writing ..<br />"; } } } else { $temp = $cache; $conttemp = $temp; # echo $temp; #die(); } #$conttemp=str_replace($inglue.$thiscfg[$aa]['str'].$outglue, "", $conttemp); # echo "WTF";die(); } else { #access denied $temp = ""; $do = 2; } #echo $temp."TLATA";die(); if (isset($do) && $do < 2 || !isset($do)) { $do = 0; } if (isset($do) && $do == 0) { if ($temp2 == false) { $temp2 = $cache; } #echo "<pre>"; print_r(${$passcont}); echo "</pre><hr />"; foreach ($thiscfg as $name => $abcd) { # echo $name . "<pre>".print_r($abcd)."</pre><hr />"; # if ($GLOBALS['dbg']==true){ # echo strlen($temp2)." --". isset($abcd['str'])." -- ".strlen($abcd['str'])." -- ".$aa." -- ".$abcd['str']." -- ".strstr($temp2, $inglue.$abcd['str'].$outglue)."<br />"; # } # echo ${$passcont}[$abcd['str']]." - ". $abcd['str']."<hr />"; if (strlen($temp2) > 0 && isset($abcd['str']) && strlen($abcd['str']) > 0 && $aa != $abcd['str'] && strstr($temp2, $inglue . $abcd['str'] . $outglue) && isset(${$passcont}[$abcd['str']])) { $do = 3; #echo $aa." - ".$abcd['str']."<p />".$conttemp."<hr />"; $temp2 = str_replace($inglue . $abcd['str'] . $outglue, "", $temp2); #echo $abcd['str']."H".$langarr."E".$passcont."H"; # echo #${$passcont}[ #$abcd['str'] #]."<hr />" #; # print_r(${$passcont}); # die(); $arr[$inglue . $abcd['str'] . $outglue] = make_object(${$passcont}[$abcd['str']], $abcd['str'], $langarr, $passcont, $inglue, $outglue, $temp2); # echo "<hr /><pre>"; # print_r($arr[$inglue.$abcd['str'].$outglue]); unset($thiscfg[$name][$abcd['str']]); } } # echo"<pre>"; #123".$aa."321"; #print_r($arr);echo"<hr />"; if (isset($arr) && is_array($arr)) { # echo "LALALA";die(); # print_r(array_keys($arr)); #die(); $return = str_replace(array_keys($arr), array_values($arr), $strr); } else { $return = $temp; } } if (!isset($return)) { $return = $temp; } #echo $return."<hr />"; #die(); return $return; }
} if (is_dir($__the_cwd . "/cache/" . $_cfg['global']['current_client'] . "/")) { chdir($__the_cwd . "/cache/" . $_cfg['global']['current_client'] . "/"); } if (function_exists("make_object") && isset($cont_vars) && is_array($cont_vars)) { if ($_cfg['global']['var_dump'] == "on") { $dbg = true; } #this is a seperated feature if (isset($_cfg['global']['ent_decode'])) { if ($_cfg['global']['ent_decode'] == "before_extension_load" or $_cfg['global']['ent_decode'] == "on") { $strraw[0] = html_entity_decode($strraw[0]); } } #end $strrm = make_object($cont_vars["template"], $cont_vars["first"], $cont_vars["langarr"], $cont_vars["array"], $cont_vars["open"], $cont_vars["close"]); # echo $strrm; #die(); } elseif (!isset($strrm)) { $strrm = $strraw[0]; } #echo str_replace(array("{fileext}", "{file}", "{rawfile}", "{folder}", "{urlstr}", "{www}", "{current_ext}", "{ele}"), array($_cfg['global']['default_gui'], urlencode(htmlentities($_GET['fn'])), htmlentities($_GET['fn']), urlencode(htmlentities($_GET['fd'])), $urlt, $_urli_, $current_ext, htmlentities($strraw[0])), $strraw[1]); ############################# # EXTENSION LOAD chdir($corepaths[0] . "extension/"); include "init" . $scrext; chdir($__the_cwd . "/"); include $corepaths[0] . "extension/index" . $scrext; $__temp1 = ''; if (is_array($_cfg['always_load_extension']) && count($_cfg['always_load_extension']) > 0) { foreach ($_cfg['always_load_extension'] as $_ok => $_oke) {
$___workpath = getcwd() . "/"; include "init" . $scrext; #$___workpath.="parser/css/"; #include $___workpath."init".$scrext; #EXAMPLE USAGE: #load config $arr = parse_css(file_get_contents("testsite.css"), true); print_r($arr); die; if (is_array($arr)) { foreach ($arr['1'] as $a => $b) { $_cfg[$a] = piecele($arr['1'], $a); } } else { die("config invalid."); } # end config load if (!isset($_SESSION)) { session_start(); $_SESSION['rdmstring'] = 'ulvl'; } $_SESSION[$_SESSION['rdmstring']] = 0; $lang = 'en'; $aa = initcfg($_cfg); if (isset($_cfg[$aa]['exact_userlevels'])) { $exacts = explode("-", $_cfg[$aa]['exact_userlevels']); } else { $exacts = false; } $strr = make_object("", $aa); echo $strr;