function htmlshifter($klikit, $str = false) { global $browsers, $__lang, $tmplext; $string = gethatmpl($klikit, "index"); if (!isset($_GET['cat']) || $_GET['cat'] == '') { $_GET['cat'] = 1; } if (!isset($_GET['ele'])) { if (!isset($_GET['fn'])) { $_GET['fn'] = ''; } $_GET['ele'] = $_GET['fn']; } $arr[0] = '{langtag}'; $arr[1] = dir_ls($GLOBALS['__the_cwd'] . "/" . $GLOBALS['_cfg']['folders']['language']); $arr[1] = $arr[1]['fd']; $langarr = getlanghtml($arr); $strraw[0] = ele_content($klikit); if (!isset($mmv)) { $mmv = ''; } if (!isset($mmh)) { $mmh = ''; } $strraw[1] = str_replace(array("{ext:ajaxurlvar:ension}"), array($GLOBALS['_cfg']['global']['ajax_urlvar']), guilang(str_replace(array("{ext:currentwd:ension}", "{ext:wwwroot:ension}", "{ext:def_request_folder:ension}", "{ext:mimemodesftlog:ension}", "{ext:colorshizzle:ension}", "{ext:language:ension}", "{ext:browsers:ension}", "{ext:memohori:ension}", "{ext:memoverti:ension}", "{ext:cat:ension}", "{ext:rawele_name:ension}", "{ext:ele_name:ension}", "{ext:cat_loop:ension}", "{ext:ele_loop:ension}", "{ext:cat_loop_sel:ension}", "{ext:inputtags:ension}", "{ext:inputtagsext:ension}"), array($GLOBALS['currentwd'], $GLOBALS['WIMPY_BASE']['path']['www'], urlencode(htmlentities($GLOBALS['_cfg']['global']['default_request_folder'])), editormimemode($GLOBALS['_cfg']['ext_links']), gethatmpl(0, "colors"), $langarr, getbrowsershtml($browsers), $mmh, $mmv, $_GET['cat'], htmlentities($_GET['ele']), urlencode(htmlentities($_GET['ele'])), getcathtml($klikit), getclixele($klikit, htmlentities($_GET['cat'])), getcathtml($klikit, "cat_sel"), gethatmpl(0, "inputtags"), gethatmpl(0, "inputtags" . $GLOBALS['current_extlink'])), $string), $__lang)); # $strraw[1]=make_object(guilang(make_object(), $__lang), $guicfg, $hex); return $strraw; }
function getbrowsershtml($klikit, $tmpll = "cat_sel") { $string = ''; $cattpl = gethatmpl($klikit, $tmpll); if (is_array($klikit)) { foreach ($klikit as $a => $b) { $string .= str_replace("{cat}", $a . " : " . $b, $cattpl); } } return $string; }
function editormimemode($klikit, $tmpll = "mimemode") { global $tmplext; $string = ''; if (is_array($klikit)) { $cattpl = gethatmpl($klikit, $tmpll); $klikit = array_unique(array_values($klikit)); foreach ($klikit as $aa => $bb) { $string .= str_replace("{extlinks}", $bb, $cattpl); } } return $string; }
function getlanghtml($klikit, $tmpl = 'language') { $newstr = ''; $langtpl = gethatmpl($klikit, $tmpl); if (is_array($klikit) && is_array($klikit['1'])) { foreach ($klikit['1'] as $a => $b) { $newstr .= str_replace($klikit[0], $b, $langtpl); } } else { $newstr = $langtpl; } return $newstr; }
function getcathtml($klikit, $tmpll = "cat") { global $tmplext; $string = ''; if (is_array($klikit)) { $cattpl = gethatmpl($klikit, $tmpll); $urlt = "&fd=" . str_replace("\\", "/", htmlentities($_GET['fd'])) . "&fn=" . htmlentities($_GET['fn']); $haha = 0; foreach ($klikit as $aa => $bb) { $aap = urlencode(htmlentities($aa)); $aa = htmlentities($aa); if ($aa == $_GET['cat']) { $req = getclixele($klikit, $_GET['cat']); } else { $req = ''; } $string .= str_replace(array("{urlstr}", "{rawcat}", "{cat}", "{elements}", "{uniqnum}"), array($urlt, $aa, $aap, $req, $haha), $cattpl); $haha++; } } return $string; }
function getclixele($klikit, $req = '') { global $__lang; $tmplext = ''; $string = ''; $truncate_ele_name_at = 100; if (isset($klikit) && is_array($klikit) && isset($klikit[html_entity_decode($_GET['cat'])]) && is_array($klikit[html_entity_decode($_GET['cat'])])) { $tplele = gethatmpl($klikit, "ele"); #$urlt="&fd=".$_GET['fd']."&fn=".$_GET['fn']; if ($req != '' && $req != html_entity_decode($_GET['cat'])) { $string .= ''; } else { $haha = 0; foreach ($klikit[html_entity_decode($_GET['cat'])] as $aa => $bb) { $thisextlink = ""; if (strlen($aa) > 0) { $test[0] = '{current_ext}'; $test[1] = 'folder'; if ($_GET['cat'] == $__lang['files']) { if (strstr($aa, ".")) { #changed nov 17 2008 $test[0] = "{current_ext}"; $tempo = explode('.', $aa); if (strlen(end($tempo)) > 0) { $test[1] = end($tempo); } #echo $test[1]; #added v0.1.3 if (isset($GLOBALS['_cfg']) && isset($GLOBALS['_cfg']['ext_links']) && isset($GLOBALS['_cfg']['ext_links'][strtolower($test[1])])) { $thisextlink = strtolower($GLOBALS['_cfg']['ext_links'][strtolower($test[1])]); #echo $thisextlink; } } } if (strlen($aa) >= $truncate_ele_name_at + 1) { $bb = substr($aa, 0, $truncate_ele_name_at) . ".."; } else { $bb = $aa; } if (!isset($_GET['structfltr']) || strlen($_GET['structfltr']) < 1 || !isset($_GET['enablefilter']) || stristr(html_entity_decode($aa), html_entity_decode($_GET['structfltr']))) { $test[1] = strtolower($test[1]); // xtc_dose if (stristr(gethatmpl($klikit, "ext_" . strtolower($test[1])), "{load:")) { $xtcdose = str_replace("{load:" . findinside("{load:", ":load}", gethatmpl($klikit, "ext_" . strtolower($test[1]))) . ":load}", gethatmpl($klikit, "ext" . findinside("{load:", ":load}", gethatmpl($klikit, "ext_" . strtolower($test[1])))), gethatmpl($klikit, "ext_" . strtolower($test[1]))); } else { $xtcdose = gethatmpl($klikit, "ext_" . strtolower($test[1])); } // xtspeed_dose if (stristr(gethatmpl($klikit, "extlink_" . strtolower($thisextlink)), "{load:")) { $xtspeedoze = str_replace("{load:" . findinside("{load:", ":load}", gethatmpl($klikit, "extlink_" . strtolower($thisextlink))) . ":load}", gethatmpl($klikit, "ext" . findinside("{load:", ":load}", gethatmpl($klikit, "extlink_" . strtolower($thisextlink)))), gethatmpl($klikit, "extlink_" . strtolower($thisextlink))); } else { $xtspeedoze = gethatmpl($klikit, "extlink_" . strtolower($thisextlink)); } $string .= str_replace(array("{rawele}", "{ele}", "{shortrawele}", "{cat}", "{xtc_dose}", "{xtspeed_dose}", $test[0], "{uniqnum}", "{thisextlink}"), array(htmlentities($aa), urlencode(htmlentities($aa)), htmlentities($bb), htmlentities($_GET['cat']), str_replace("{ele}", urlencode(htmlentities($aa)), $xtcdose), str_replace("{ele}", urlencode(htmlentities($aa)), $xtspeedoze), $test[1], htmlentities($_GET['cat']) . $haha, strtolower($thisextlink)), $tplele); } } $haha++; } } } #echo $string; #die(); return $string; }
<?php // @(#) $Id$ // +-----------------------------------------------------------------------+ // | Copyright (C) 2009, http://freedomeditor.com/ | // +-----------------------------------------------------------------------+ // | This file is free software; you can redistribute it and/or modify | // | it under the terms of the GNU General Public License as published by | // | the Free Software Foundation; either version 3 of the License, or | // | (at your option) any later version. | // | This file is distributed in the hope that it will be useful | // | but WITHOUT ANY WARRANTY; without even the implied warranty of | // | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | // | GNU General Public License for more details. | // +-----------------------------------------------------------------------+ // | Author: Bart Bosma | // +-----------------------------------------------------------------------+ // return guilang(gethatmpl(0, "inputtags" . $GLOBALS['current_extlink']), $__lang); ?>
function extension($source, $scrext, $_cfg, $langcss, $js = false, $donethatoncearray = array()) { $returnjs = ''; $cfg_gl = $_cfg; $resultingarray345 = repl_between($source, "", $_cfg['extension']['string_open'], $_cfg['extension']['string_close'], false, "sm", true); $amnt = count($resultingarray345[2]); $noloop = false; if (is_array($resultingarray345) && is_array($resultingarray345[2])) { foreach ($resultingarray345[2] as $boelieboelie) { if (strlen($boelieboelie) > 0) { if (file_exists("cfg/custom/" . $boelieboelie . ".css")) { $_cfgt = loadextcfg("cfg/custom/" . $boelieboelie . ".css"); if (isset($_cfgt)) { $_cfg = mergecss($_cfg, $_cfgt); } } $tmpl = ""; $emptytmpl = true; $next = false; if (isset($_cfg['extension_req_val']) && is_array($_cfg['extension_req_val']) && count($_cfg['extension_req_val']) > 0) { foreach ($_cfg['extension_req_val'] as $var => $val) { if (strlen($var) > 0) { if (!isset($_REQUEST[$var])) { $next = true; } else { if ($_cfg['extension']['ext_req_val'] == "matchvar") { if ($_cfg['extension']['ext_req_val_Casesens'] != "on") { if ($_REQUEST[strtolower($var)] != strtolower($val)) { $next = true; } } elseif ($_REQUEST[$var] != $val) { $next = true; } } } } } } if ($js != false) { $next = false; } if ($next == false && $_cfg['extension']['launch'] == "enabled") { if (strtolower($_cfg["extension"]["core_client"]) != "any") { $coreclients = explode(",", $_cfg["extension"]["core_client"]); if (isset($_cfg['global']['select_client_by_urlvar']) && isset($_GET[$_cfg['global']['select_client_by_urlvar']]) && isset($coreclients[$_GET[$_cfg['global']['select_client_by_urlvar']]]) || !isset($_cfg['global']['select_client_by_urlvar']) && !isset($_GET[$_cfg['global']['select_client_by_urlvar']]) && !isset($coreclients[$_GET[$_cfg['global']['select_client_by_urlvar']]]) && isset($_cfg['global']['current_client']) && isset($coreclients[$_cfg['global']['current_client']])) { $emptytmpl = false; } } elseif (strtolower($_cfg["extension"]["core_client"]) == "any") { $emptytmpl = false; } if ($_cfg['extension']['languageload'] == "enabled") { $__tssf = $GLOBALS['__tssf']; if (file_exists($_cfg['folders']['language'] . "/" . $__tssf . "/custom/" . $boelieboelie . "/" . $__tssf . ".css")) { $lang_t = loadextcfg($_cfg['folders']['language'] . "/" . $__tssf . "/custom/" . $boelieboelie . "/" . $__tssf . ".css"); } } if (isset($lang_t) && is_array($lang_t) && $_cfg['extension']['globallanguageload'] == "enabled") { if (is_array($langcss)) { $langcss = mergecss($langcss, $lang_t); } } else { if ($_cfg['extension']['globallanguageload'] == "enabled") { } else { $langcss = parse_css($lang_t); } } if (is_array($langcss["1"])) { $__lang = piecele($langcss["1"], $_cfg['global']['default_gui_lang']); } #print_r($__lang); if ($emptytmpl == false && $_cfg['extension']['tmplload'] == "enabled") { $tmpl = gethatmpl(0, $boelieboelie); } if ($_cfg['extension']['phplaunch'] == "enabled" && file_exists("fc/customcallback/" . $boelieboelie . $scrext)) { ob_start(); $tmpl = (include "fc/customcallback/" . $boelieboelie . $scrext); if (strlen($tmpl) == 0 || $emptytmpl == false) { if ($_cfg['extension']['phplaunch_output'] == "enabled") { if (strlen($tmpl) < 1) { $tmpl = ob_get_contents(); } } else { ob_clean(); } } } if ($_cfg['extension']['srch_ext'] != "disabled" && strlen($tmpl) > 0 && isset($srch_ext) && is_array($srch_ext) && count($srch_ext) > 0) { $tmpl = str_replace(array_keys(${$_cfg['extension']['srch_ext']}), array_values(${$_cfg['extension']['srch_ext']}), $tmpl); } #if (strlen($tmpl)>0){ if ($_cfg['extension']['languagereplace'] == "enabled") { if (!in_array($boelieboelie, $donethatoncearray)) { $return[$_cfg['extension']['level']][$_cfg['extension']['string_open'] . $boelieboelie . $_cfg['extension']['string_close']] = guilang($tmpl, $__lang); #$source=str_replace("{ext:".$boelieboelie.":ension}", guilang($tmpl, $__lang), $source); } } else { if (!in_array($boelieboelie, $donethatoncearray)) { $return[$_cfg['extension']['level']][$_cfg['extension']['string_open'] . $boelieboelie . $_cfg['extension']['string_close']] = $tmpl; #$source=str_replace("{ext:".$boelieboelie.":ension}", $tmpl, $source); } } # } # echo "<pre>"; # print_r($source); if (isset($_cfg['always_block_ext_scan_inside'][$boelieboelie])) { $donethatoncearray[] = $boelieboelie; } /* loop result for generating output cmd { load "cfg/custom/named*.css"; if found load "lang/custom/named*.css"; if found load tmpl/named*.html if found; load tmpl/js/named*.js if found; ob_start(); load "fc/customcallback/named*.php"; < repl {DEFAULTTAG} in html result if any, with ob_end_Clean() or what comes from return function; result result repl guilang $rep[$cfgdepth]["named*"]=result } #gen output cmd exe */ $_cfg = $cfg_gl; } } } } else { $noloop = true; } # end prepare loop #start output gen loop if (isset($return) && is_array($return) && count($return) > 0) { if ($js != false) { $extensionjs = ""; } //$source2=$source; foreach ($return as $ret) { $source = str_replace(array_keys($ret), array_values($ret), $source); foreach ($ret as $re => $turn) { if ($js == 'print') { if (file_exists($GLOBALS['__the_cwd'] . "/" . $_cfg['folders']['templates'] . "js/" . str_replace(array($_cfg['extension']['string_open'], $_cfg['extension']['string_close']), "", $re) . ".js")) { $extensionjs .= "//" . $_cfg['folders']['templates'] . "js/" . str_replace(array($_cfg['extension']['string_open'], $_cfg['extension']['string_close']), "", $re) . ".js\n"; $extensionjs .= file_get_contents($GLOBALS['__the_cwd'] . "/" . $_cfg['folders']['templates'] . "js/" . str_replace(array($_cfg['extension']['string_open'], $_cfg['extension']['string_close']), "", $re) . ".js"); $extensionjs .= "\n\n//------------------------------//\n\n\n\n"; } } } } ############## moved to this place @ 0.2.6 if ($_cfg['extension']['loop_srch_ext'] != "disabled" && $js == false) { $source = extension($source, $scrext, $_cfg, $langcss, $js, $donethatoncearray); } ############## if ($js == "print") { @ob_end_clean(); @ob_end_clean(); @ob_end_clean(); @ob_end_clean(); if (strlen($extensionjs) == 0) { die("Unable to determine javascript source files, no " . $_cfg['extension']['string_open'] . "*" . $_cfg['extension']['string_close'] . " tags found for the current coreclient or no corresponding js files."); } $returnjs .= $extensionjs; } } elseif ($js != false) { die("Unable to determine javascript source files, no " . $_cfg['extension']['string_open'] . "*" . $_cfg['extension']['string_close'] . " tags found for the current coreclient or no corresponding js files."); } if ($js != false) { return $returnjs; } else { return $source; } }