<?php
$must_cache = false;
$module_dir = "tv_ext";
$module_css_path = ($line_domain['theme'] != "" && $line_domain['theme'] != "default") ? ($path . ('assets/themes/' . $line_domain['theme'] . '/')) : $path;
$admin_view = false;
if(isset($_SESSION['user_id']) && intval($_SESSION['user_id']) > 0) {
    $admin_view = true;
}

$include_www = "https://www.cypruswebsites.com";
//$admin_view = false;


if(file_exists(dirname(__FILE__) . "/tv_ext_init.php")) {
    include(dirname(__FILE__) . "/tv_ext_init.php");
}
else {
    echo "<br/><b>".dirname(__FILE__) . "/tv_ext_init.php does not exist</b>";
}




if(isset($module_params)) {
    $def_ads = isset($module_params['def_ads']) ? $module_params['def_ads'] : 'no';
    $def_ad_id = isset($module_params['ws_ad_unit_id']) ? $module_params['ws_ad_unit_id'] : '';
}
else {
    $default_module_params = [];
    $q = "SELECT l.* FROM left_content l, module m WHERE l.module_id=m.module_id AND m.url='tv_ext' AND l.catdom_id='$domain_id';";
    $r = @mysql_query($q);
    if($r && mysql_num_rows($r) > 0) {
        $row = mysql_fetch_assoc($r);
        $default_module_params = unserialize(base64_decode($row['module_params']));
    }

    $def_ads = isset($default_module_params['def_ads']) ? $default_module_params['def_ads'] : 'no';
    $def_ad_id = isset($default_module_params['ws_ad_unit_id']) ? $default_module_params['ws_ad_unit_id'] : '';

    $module_params = [
        'ws_ad_unit_id' => $def_ad_id,
        'def_ads' => $def_ads
    ];
}


$show_default = false;
if(isset($tv_day)) $show_default = true;
//echo $tv_day;
if($show_default && file_exists(dirname(__FILE__) . "/tv_ext_default.php")) {
    include(dirname(__FILE__) . "/tv_ext_default.php");
}