include "../../include/research_functions.php";

$offset        = getvalescaped('offset', 0);
$page          = getvalescaped('page', '');
$name          = getvalescaped('name', '');
$findpage      = getvalescaped('findpage', '');
$findname      = getvalescaped('findname', '');
$findtext      = getvalescaped('findtext', '');
$newhelp       = getvalescaped('newhelp', '');
$editlanguage  = getvalescaped('editlanguage', $language);
$editgroup     = getvalescaped('editgroup', '');
$save          = getvalescaped('save', '');
$text          = getvalescaped('text', '');

// Validate HTML
$html_validation = validate_html($text);

# get custom value from database, unless it has been newly passed from admin_content.php
if(getval('custom', '') == 1)
	{
	$custom    = 1;
	$newcustom = true;
	}
else
	{
	$custom    = check_site_text_custom($page, $name);
	$newcustom = false;
	}

if(($save != '') && getval('langswitch', '') == '' && $html_validation === true)
	{
function print_footer()
{
    // In the print_header() function we saved the current time. Now we ask for
    // the time again. This way we can calculate how long it takes for a page
    // to render. Really neat i think.
    global $start1;
    global $end1;
    global $_CONFIG;
    global $_RUN;
    $end1 = gettimeofday();
    $totaltime1 = (double) ($end1['sec'] - $start1['sec']) + (double) ($end1['usec'] - $start1['usec']) / 1000000;
    $template = new Smarty();
    $template->assign("renderingtime", $totaltime1);
    $template->display($_RUN['theme_path'] . "/html_footer.tpl");
    if ($_CONFIG['validate_pages'] == true) {
        validate_html();
    }
}
<?php

# Quick script to check valid HTML
include "../../include/db.php";
include "../../include/general.php";
include "../../include/authenticate.php";
include "../../include/resource_functions.php";
echo "<pre>";
$text = getval("text", "");
$html = trim($text);
$result = validate_html($html);
if ($result === true || $html == "") {
    echo "OK\n";
} else {
    echo "FAIL - {$result} \n";
}
echo "</pre>";