Example #1
0
        }
        $contents = "";
        while (!feof($fp)) {
            $contents .= fread($fp, 4096);
        }
        return $contents;
    }
}
xoops_cp_header();
include 'mymenu.php';
if (function_exists('Legacy_function_stylesheet')) {
    echo "<link href=\"" . XOOPS_URL . "/modules/legacyRender/admin/css.php?file=module.css&amp;dirname=legacy\" media=\"all\" type=\"text/css\" rel=\"stylesheet\"/>\n";
}
$myts =& MyTextSanitizer::getInstance();
$file = isset($_GET['file']) ? $myts->stripSlashesGPC($_GET['file']) : "help.html";
display_lang_file($file);
xoops_cp_footer();
exit;
// show under language/XX/$file only <body> part.
function display_lang_file($file, $link = '')
{
    global $xoopsConfig, $xoopsModule;
    if (empty($link)) {
        $link = preg_replace('/[&\\?]?file=[^&]*|\\?$/', '', $_SERVER['REQUEST_URI']);
        $link .= preg_match('/\\?/', $link) ? '&' : '?';
        $link .= 'file=';
    }
    $file = preg_replace('/^\\/+/', '', preg_replace('/\\/?\\.\\.?\\/|\\/+/', '/', $file));
    $lang = "language/" . $xoopsConfig['language'];
    $help = "../{$lang}/{$file}";
    if (!file_exists($help)) {
Example #2
0
    if (file_exists(XOOPS_TRUST_PATH . '/libs/' . $lib . '/' . $page . '.php')) {
        include XOOPS_TRUST_PATH . '/libs/' . $lib . '/' . $page . '.php';
    } else {
        if (file_exists(XOOPS_TRUST_PATH . '/libs/' . $lib . '/index.php')) {
            include XOOPS_TRUST_PATH . '/libs/' . $lib . '/index.php';
        } else {
            die('wrong request');
        }
    }
    exit;
}
xoops_cp_header();
include "mymenu.php";
switch ($op) {
    case 'about':
        display_lang_file('help.html');
}
xoops_cp_footer();
function display_lang_file($file, $link = '')
{
    global $xoopsConfig;
    if (empty($link)) {
        $link = preg_replace('/&?file=[^&]*|\\?$/', '', $_SERVER['REQUEST_URI']);
        $link .= preg_match('/\\?/', $link) ? '&' : '?';
        $link .= 'file=';
    }
    $file = preg_replace('/^\\/+/', '', preg_replace('/\\/?\\.\\.?\\/|\\/+/', '/', $file));
    $lang = "language/" . $xoopsConfig['language'];
    $help = "../{$lang}/{$file}";
    if (!file_exists($help)) {
        $lang = 'language/english';