{ global $AVE_Template; require BASE_DIR . "/modules/gweather/class.gweather.php"; $tpl_dir = BASE_DIR . '/modules/gweather/templates/'; $lang_file = BASE_DIR . "/modules/gweather/lang/" . $_SESSION['user_language'] . ".txt"; if (!is_file(BASE_DIR . '/cache/')) { @mkdir(BASE_DIR . '/cache/', 0777); } $weather = new Weather(); $weather->weatherInit(); $weather->weatherDataGet(); $weather->weatherDataParse(); $AVE_Template->config_load($lang_file); $AVE_Template->assign('config', $weather->config); $AVE_Template->assign('werror', $weather->error); $AVE_Template->assign('main_icon', $weather->weatherIconGet((string) $weather->parsedData['current_icon'], $weather->config['current_icon_size'])); $AVE_Template->assign('parsedData', $weather->parsedData); $AVE_Template->display($tpl_dir . $weather->config['template'] . '.tpl'); } if (defined('ACP') && !empty($_REQUEST['moduleaction'])) { include_once BASE_DIR . "/modules/gweather/class.gweather.php"; $tpl_dir = BASE_DIR . '/modules/gweather/templates/'; $lang_file = BASE_DIR . "/modules/gweather/lang/" . $_SESSION['user_language'] . ".txt"; $weather = new Weather(); $AVE_Template->config_load($lang_file, "admin"); switch ($_REQUEST['moduleaction']) { case '1': $weather->weatherSettingsEdit($tpl_dir, $lang_file); break; } }