Example #1
0
function textpattern()
{
    global $pretext, $microstart, $txpac;
    $segment = gps('segment');
    extract($pretext);
    $html = safe_field('user_html', 'txp_page', "name='{$page}'");
    if (!$html) {
        exit('no page template specified for section ' . $s);
    }
    $html = parse($html);
    $html = parse($html);
    $html = !$segment ? $html : segmentPage($html);
    $html = $txpac['allow_page_php_scripting'] ? evalString($html) : $html;
    header("Content-type: text/html; charset=utf-8");
    echo $html;
    $microdiff = getmicrotime() - $microstart;
    echo n, comment('Runtime: ' . substr($microdiff, 0, 6));
}
Example #2
0
function textpattern()
{
    global $pretext, $microstart, $prefs, $qcount, $production_status, $txptrace;
    $segment = gps('segment');
    extract($pretext);
    $html = safe_field('user_html', 'txp_page', "name='{$page}'");
    if (!$html) {
        exit(gTxt('unknown_section') . ' ' . $s);
    }
    $html = parse($html);
    $html = parse($html);
    // the function so nice, he ran it twice
    $html = !$segment ? $html : segmentPage($html);
    $html = $prefs['allow_page_php_scripting'] ? evalString($html) : $html;
    header("Content-type: text/html; charset=utf-8");
    echo $html;
    if (in_array($production_status, array('debug', 'testing'))) {
        $microdiff = getmicrotime() - $microstart;
        echo n, comment('Runtime: ' . substr($microdiff, 0, 6));
        echo n, comment('Queries: ' . $qcount);
        echo maxMemUsage('end of textpattern()', 1);
        if (!empty($txptrace) and is_array($txptrace)) {
            echo n, comment('txp tag trace: ' . n . join(n, $txptrace) . n);
        }
    }
}
Example #3
0
function textpattern()
{
    global $pretext, $microstart, $prefs, $qcount, $production_status, $txptrace, $siteurl;
    $segment = gps('segment');
    extract($pretext);
    callback_event('textpattern');
    if ($pretext['status'] == '404') {
        txp_die(gTxt('404_not_found') . br . br . tag($siteurl, 'a', ' href="http://' . $siteurl . '"'), '404 Not Found');
    }
    $html = safe_field('user_html', 'txp_page', "name='" . doSlash($page) . "'");
    if (!$html) {
        txp_die(gTxt('unknown_section') . ' ' . $s . br . br . tag($siteurl, 'a', ' href="http://' . $siteurl . '"'), '404 Not Found');
    }
    $html = parse($html);
    $html = parse($html);
    // the function so nice, he ran it twice
    $html = !$segment ? $html : segmentPage($html);
    $html = $prefs['allow_page_php_scripting'] ? evalString($html) : $html;
    header("Content-type: text/html; charset=utf-8");
    echo $html;
    if (in_array($production_status, array('debug', 'testing'))) {
        $microdiff = getmicrotime() - $microstart;
        echo n, comment('Runtime: ' . substr($microdiff, 0, 6));
        echo n, comment('Queries: ' . $qcount);
        echo maxMemUsage('end of textpattern()', 1);
        if (!empty($txptrace) and is_array($txptrace)) {
            echo n, comment('txp tag trace: ' . n . join(n, $txptrace) . n);
        }
    }
}