Example #1
0
if (array_key_exists('HTTP_HOST', $_SERVER)) {
    $host_parts = explode('.', $_SERVER['HTTP_HOST']);
    $syn = $host_parts[0];
} else {
    $syn = 'www';
}
# or override for debugging
if (array_key_exists('syn', $_GET)) {
    $syn = $_GET['syn'];
}
$cobrand_allowed = cobrand_allowed();
global $cobrand;
$cobrand = false;
if (array_key_exists($syn, $cobrand_allowed)) {
    if (is_dir("../templates/{$syn}")) {
        template_set_style("../templates/{$syn}", true);
    }
    $cobrand = $syn;
}
global $cocode;
$cocode = false;
$cocode = get_http_var('cocode');
if ($cobrand) {
    if (!cobrand_cocode_allowed($cobrand, $cocode)) {
        $cocode = false;
    }
}
/* fyr_display_error NUMBER MESSAGE
 * Display an error message to the user. */
function fyr_display_error($num, $message, $file, $line, $context)
{
Example #2
0
 * display a clean error page when something goes wrong. Obviously if we're
 * displaying an error, a redirect, an image or anything else this will break
 * horribly.*/
ob_start();
template_set_style($dir . "/../templates/website");
# syndication type, read from domain name
global $cobrand;
$cobrand = null;
if (array_key_exists('HTTP_HOST', $_SERVER)) {
    $host_parts = explode('.', $_SERVER['HTTP_HOST'], 2);
    if ($host_parts[1] == OPTION_WEB_DOMAIN && $host_parts[0] != 'www') {
        $cobrand = $host_parts[0];
    }
}
if (is_dir("../templates/{$cobrand}")) {
    template_set_style("../templates/{$cobrand}", true);
}
global $cocode;
$cocode = get_http_var('cocode');
if ($cobrand) {
    if (!cobrand_cocode_allowed($cobrand, $cocode)) {
        $cocode = '';
    }
}
/* fyr_display_error NUMBER MESSAGE
 * Display an error message to the user. */
function fyr_display_error($num, $message, $file, $line, $context)
{
    /* Nuke any existing page output to display the error message. */
    if (OPTION_PHP_DEBUG_LEVEL == 0) {
        ob_clean();