Exemple #1
0
function page_p($id, $edit = true)
{
    if (is_numeric($id)) {
        $page = db_object_get("pages", $id);
    } else {
    }
    if ($page) {
        //file_put_contents("content.txt", $page->content);
        $o = fld_trans($page->content);
        if (function_exists("on_page_content")) {
            on_page_content($o);
        }
    } else {
        $o = "not defined";
    }
    if ($edit) {
        $o .= p_quickedit_html($id);
    }
    replace_my_tags($o);
    // {href {f {call
    if (form_post("die")) {
        replace_files($o);
        // {!something.js} {!something.css}
        replace_globals($o);
        // {!global} {!global}
        translate_parse($o);
        // {~rus} {~eng}
        die($o);
    }
    return $o;
}
Exemple #2
0
function page_p($id)
{
    $page = db_object_get("pages", $id);
    if ($page) {
        $o = $page->content;
    } else {
        $o = "not defined";
    }
    $o .= p_quickedit_html($id);
    replace_my_tags($o);
    // {href {f {call
    if (form_post("die")) {
        replace_files($o);
        // {!something.js} {!something.css}
        replace_globals($o);
        // {!global} {!global}
        translate_parse($o);
        // {~rus} {~eng}
        die($o);
    }
    return $o;
}
Exemple #3
0
        case 7:
            $content = $appropriate_function($parts[$i + 1], $parts[$i + 2], $parts[$i + 3], $parts[$i + 4], $parts[$i + 5], $parts[$i + 6], $parts[$i + 7]);
            break;
        default:
            log_message("Too many parameters");
            $content = $appropriate_function($parts[$i + 1], $parts[$i + 2], $parts[$i + 3]);
            break;
    }
}
$content = script_uses_head() . $content;
if (function_exists("before_content_post")) {
    before_content_post($content);
}
$pagename = $_GET['q'];
$pagename = str_replace(".", "", $pagename);
if (!$content && !$appropriate_function) {
    $content = "<h1>ERROR:<br> Can't render '" . $_GET['q'] . "'</h1>";
}
if (isset($GLOBALS['layout'])) {
    $layout = template($GLOBALS['layout']);
} elseif (!isset($template)) {
    $layout = template("main");
}
//used in admin
translate_parse($layout);
// {~rus} {~eng}
echo $layout;
unset($_SESSION['flash']);
//don't show mysql not freed etc
ini_set("display_errors", 0);
ini_set("mysql.trace_mode", 0);
Exemple #4
0
function die_no_template($o)
{
    global $base_url;
    nice_urls($o);
    $o = "<base href='{$base_url}'/><meta http-equiv='Content-Type' content='text/html; charset=UTF-8;'>" . script_uses_head() . $o;
    $o .= "<!-- profiler report: \r\n" . prf_report() . "\r\n -->";
    translate_parse($o);
    die("{$o}");
}
Exemple #5
0
            break;
    }
}
$content = script_uses_head() . $content;
if (function_exists("before_content_post")) {
    before_content_post($content);
}
$pagename = $_GET['q'];
$pagename = str_replace(".", "", $pagename);
if (!$content && !$appropriate_function) {
    $content = "<h1>ERROR:<br> Can't render '" . $_GET['q'] . "'</h1>";
}
if (!isset($template)) {
    $template = file_get_contents("main.html");
}
if (function_exists("before_template_parse")) {
    before_template_parse($template);
}
/// SQP TEMPLATE ENGINE
replace_files($template);
// {!something.js} {!something.css}
replace_my_tags($template);
// {href {f {call
replace_globals($template);
// {!global} {!global}
translate_parse($template);
// {~rus} {~eng}
echo $template;
//don't show mysql not freed etc
ini_set("display_errors", 0);
ini_set("mysql.trace_mode", 0);