Esempio n. 1
0
    if ($feed_options['enable_custom_fields'] == 1) {
        $allowed_columns[] = 'custom1';
        $allowed_columns[] = 'custom2';
        $allowed_columns[] = 'custom3';
    }
    foreach ($csv_columns as $k => $csv_column) {
        if ($csv_column == '') {
            unset($csv_columns[$k]);
            continue;
        }
        if (strpos($csv_column, 'static:') !== 0) {
            if (!in_array($csv_column, $allowed_columns)) {
                header("Content-Type: text/plain");
                echo "ERROR: csv_columns option refers unknown column \"{$csv_column}\"\n\n";
                echo "================================================================================\n\n";
                print_doc($feed);
                die;
            }
        }
    }
}
$where = " and video_id >= {$start}";
if ($feed_options['video_type_id'] == 1) {
    $where .= ' and (is_private=0 or is_private=1)';
} elseif ($feed_options['video_type_id'] == 2) {
    $where .= ' and (is_private=2)';
} elseif ($feed_options['video_type_id'] == 3) {
    $where .= ' and is_private=0';
} elseif ($feed_options['video_type_id'] == 4) {
    $where .= ' and is_private=1';
}
Esempio n. 2
0
}
function print_doc($doc)
{
    if (isset($_GET['json'])) {
        header("Access-Control-Allow-Origin: *");
        header('Content-Type: application/json');
        echo json_encode($doc);
    } else {
        if (isset($_GET['html'])) {
            echo '
			<html>
			<head>
				<title>Free Hack Quest</title>
				<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
				<meta name="author" content="sea-kg" />
				<meta name="copyright" lang="ru" content="sea-kg" />
				<meta name="description" content="competition information security" />
				<meta name="keywords" content="security, fhq, fhq 2012, fhq 2013, fhq 2014, free, hack, quest, competition, information security, ctf, joepardy" />		
			</head>
			<body>
		';
            include "../copyright.php";
            echo convert_to_html($doc);
            echo '</body>';
        } else {
            echo "<a href='?html'>HTML</a> <a href='?json'>JSON</a>";
        }
    }
}
print_doc($doc);