<?php
$must_cache = false;
$module_dir = "weather_advanced_loc";
$module_css_path = ($line_domain['theme'] != "" && $line_domain['theme'] != "default") ? ($path . ('assets/themes/' . $line_domain['theme'] . '/')) : $path;

if(!function_exists('tx')) {
    function tx($str, $params = array()) {
        if(count($params) > 0) {
            array_unshift($params, $str);
            $str = call_user_func_array('sprintf', $params);
        }

        return $str;
    }
}

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

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

$w_url = $protocol . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
if(strpos($w_url, '?show_scale')) {
	$w_url = str_ireplace('?show_scale=f', '', $w_url);
	$w_url = str_ireplace('?show_scale=c', '', $w_url);
	
	$canonical_link = $w_url;
	
	switch ($_REQUEST['show_scale']) {
		case "f": 
			$webpage_title_en .= ' (Fahrenheit)';
			$meta['description'] .=  ' (Fahrenheit)';
		break;
		case "c": 
			$webpage_title_en .= ' (Celsius)';
			$meta['description'] .=  ' (Celsius)';
		break;
	}
}