|
From: Florin C B. <ory...@us...> - 2013-05-31 17:29:55
|
Update of /cvsroot/mxbb/mx_meteo In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv21855 Added Files: db_install.php db_upgrade.php index.php install.txt meteo.pak meteo.php Log Message: 1st try mx_meteo --- NEW FILE: meteo.php --- <?php /** * * @name meteo.php * @package MX-Publisher Core * @version $Id: meteo.php,v 1.1 2013/05/31 17:29:53 orynider Exp $ * @copyright (c) 2007-2012 MX-Publisher Project Team * @copyright (c), 2013 FlorinCB aka OryNider (ory...@rd...) * @license http://opensource.org/licenses/gpl-license.php GNU General Public License v2 * */ // // ERROR HANDLING // //error_reporting( E_ALL ); if( !defined('IN_PORTAL') || !is_object($mx_block)) { die("Hacking attempt"); } /** // Includes */ require($module_root_path . 'includes/constants.' . $phpEx); // // Read Block Settings // $title = $mx_block->block_info['block_title']; //PORTAL_METEO_SETTINGS $block_id = (isset($block_id) ? $block_id : $mx_block->block_info['block_id']); $block_size = (isset($column) ? $mx_page->columns[$column]['column_size'] : 176); // Read configuration definition $marginWidth = (($mx_block->get_parameters('marginWidth') == 'TRUE') ? 1 : 0); //0 $marginHeight = (($mx_block->get_parameters('marginHeight') == 'TRUE') ? 1 : 0); //0 $frameBorder = (($mx_block->get_parameters('frameBorder') == 'TRUE') ? 1 : 0); //0 $scrolling = $mx_block->get_parameters('scrolling'); //no/yes $wmode_transparency = $mx_block->get_parameters('wmode_transparency'); //allowTransparency $current_iframe = $mx_block->get_parameters('current_iframe'); //1-20 /4 $width_iframe = $mx_block->get_parameters('width_iframe'); //120 - 250 $gid = $mx_block->get_parameters('gid'); //get yours: from http://www.freemeteo.com/ //Client ID Examples: //878063_20130531_083049 //772968_20130531_070639 //946506_20130531_141204 $current_iframe = (@is_numeric($current_iframe) ? $current_iframe : 4); /* * Start session management */ /* * Begin block script here */ // Set the filename of the template you want to use for this file. $template->set_filenames(array( 'meteo_body' => 'freemeteo.tpl') ); $template->assign_vars(array( 'TITLE' => $title, 'BLOCK_TITLE' => $lang['Weather_by'].' <em>Freemeteo.com</em>', 'GID' => $gid, 'CIFRM' => $current_iframe, 'MARGINWIDTH' => $marginWidth, 'MARGINHEIGHT' => $marginHeight, 'FRAMEBORDER' => $frameBorder, 'SCROLLING' => $scrolling, 'WMODE_TRASPARENCY' => $wmode_transparency, 'BLOCK_SIZE' => $block_size, 'WIDTH' => $width_iframe) ); $template->pparse('meteo_body'); ?> --- NEW FILE: index.php --- <?php /*************************************************************************** * mx_weather.php * ------------------- * begin : April, 2002 * copyright : (C) 2002 MX-System * email : su...@mx... * ***************************************************************************/ define('IN_PORTAL', 1); $mx_root_path = "../../"; include($mx_root_path . 'extension.inc'); include($mx_root_path . 'common.'.$phpEx); // // Start session management // $userdata = session_pagestart($user_ip, PAGE_WEATHER); mx_init_userprefs($userdata); // // End session management // $module_root_path = './'; // ********************************************************************** // Read language definition // ********************************************************************** if ( !file_exists($module_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_main.'.$phpEx ) ) { include( $module_root_path . 'language/lang_english/lang_main.'.$phpEx ); } else { include( $module_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_main.'.$phpEx ); } // ********************************************************************** // Read module config // ********************************************************************** include($module_root_path . 'functions.'.$phpEx); $weather_config = read_weather_config(); // ********************************************************************** // Set Parameter // ********************************************************************** if( isset($HTTP_GET_VARS['accid']) || isset($HTTP_POST_VARS['accid']) ) { $weather_region_sel = ($HTTP_GET_VARS['accid']) ? $HTTP_GET_VARS['accid'] : $HTTP_POST_VARS['accid']; } if (!$accid) { $accid = $weather_config['weather_city_default'] ; # Your default city location code "YUL"; } $tp=$HTTP_GET_VARS['tmp']; if (!$tp) { $tp = $weather_config['weather_unit_default']; # Your Default temperature unit (C for Celsius, F for Fahrenheit) } WeatherIndex($tp, $accid, $module_root_path); if ($tp == "C") { $temperature = CelNumber( $v_Temp, $tp); } else { $temperature = $v_Temp; } $image_path = "http://image.weather.com/web/common/wxicons/52/" ; // $module_root_path . "images/"; $image = $image_path . $v_CIcon . ".gif"; // // End session management // $page_title = ( !empty( $lang['Weather'] ) ? $lang['Weather'] : 'Weather' ); include($mx_root_path . 'includes/page_header.'.$phpEx); $block_size = '100%'; $template->set_filenames(array( "body_weather" => 'mx_weather_view.tpl') ); $day1 = date( 'l' , ToDate( $v_Fore[5] ) ); $day2 = date( 'l' , ToDate( $v_Fore[6] ) ); $day3 = date( 'l' , ToDate( $v_Fore[7] ) ); $day4 = date( 'l' , ToDate( $v_Fore[8] ) ); $day5 = date( 'l' , ToDate( $v_Fore[9] ) ); $image_day1 = $image_path . $v_Fore[10].".gif"; $image_day2 = $image_path . $v_Fore[11].".gif"; $image_day3 = $image_path . $v_Fore[12].".gif"; $image_day4 = $image_path . $v_Fore[13].".gif"; $image_day5 = $image_path . $v_Fore[14].".gif"; $v_Baro_nice = PreNumber ($v_Baro , $tp); $v_WindS_nice = VelNumber ($v_WindS, $tp); $v_Real_nice = CelNumber2($v_Real , $tp); $v_Vis_nice = LenNumber ($v_Vis , $tp); // $checked_on = 'checked'; $checked_off = ''; $template->assign_vars(array( 'L_TITLE' => ( !empty( $lang['Weather'] ) ? $lang['Weather'] : 'Weather' ) , 'L_INFO' => $v_City . ", " . $v_Region, 'L_DAY1' => $lang['datetime'][$day1], 'L_DAY2' => $lang['datetime'][$day2], 'L_DAY3' => $lang['datetime'][$day3], 'L_DAY4' => $lang['datetime'][$day4], 'L_DAY5' => $lang['datetime'][$day5], 'L_CHANGE_NOW' => $lang['Change'], 'IMG_DAY1' => $image_day1, 'IMG_DAY2' => $image_day2, 'IMG_DAY3' => $image_day3, 'IMG_DAY4' => $image_day4, 'IMG_DAY5' => $image_day5, 'IMG_CURRENT_COND' => $module_root_path . "images/" . 'current_cond.gif' , 'IMG_FORECAST' => $module_root_path . "images/" . 'forecast.gif' , 'TEMP_MAX_DAY1' => CelNumber($v_Fore[20],$tp), 'TEMP_MAX_DAY2' => CelNumber($v_Fore[21],$tp), 'TEMP_MAX_DAY3' => CelNumber($v_Fore[22],$tp), 'TEMP_MAX_DAY4' => CelNumber($v_Fore[23],$tp), 'TEMP_MAX_DAY5' => CelNumber($v_Fore[24],$tp), 'TEMP_MIN_DAY1' => CelNumber($v_Fore[40],$tp), 'TEMP_MIN_DAY2' => CelNumber($v_Fore[41],$tp), 'TEMP_MIN_DAY3' => CelNumber($v_Fore[42],$tp), 'TEMP_MIN_DAY4' => CelNumber($v_Fore[43],$tp), 'TEMP_MIN_DAY5' => CelNumber($v_Fore[44],$tp), 'WINDD' => $v_WindD, 'WINDS' => $v_WindS_nice, 'BARO' => $v_Baro_nice, 'HUMID' => $v_Humid .'%', 'UV' => $v_UV, 'REAL' => $v_Real_nice, 'VIS' => $v_Vis_nice, 'ACCID' => $accid, 'U_URL' => "index.php", 'TEMPERATURE' => $temperature, 'GRAD' => "°". $tp , 'IMG' => $image, 'L_COPYRIGHT' => "This Weather is provided by MSNBC", 'S_ACTION' => append_sid("index.$phpEx"), // 'WEATHER_CITY_SELECT' => weather_city_select( $accid, 'accid' ), 'CHECKED_TP_C' => ( $tp == "C" ) ? $checked_on : $checked_off, 'CHECKED_TP_F' => ( $tp == "F" ) ? $checked_on : $checked_off, 'ONCLICK_C' => ( $tp == "F" ) ? "onClick=javascript:location.href='" . append_sid( "./index.php?ta=y&tmp=C&accid=" . $accid ) . "';" : '', 'ONCLICK_F' => ( $tp == "C" ) ? "onClick=javascript:location.href='" . append_sid( "./index.php?ta=y&tmp=F&accid=" . $accid ) . "';" : '' )); $template->pparse("body_weather"); $template->destroy(); include($mx_root_path . 'includes/page_tail.'.$phpEx); ?> --- NEW FILE: db_upgrade.php --- <?php /** * * @package MX-Publisher Module - mx_meteo * @version $Id: db_upgrade.php,v 1.1 2013/05/31 17:29:53 orynider Exp $ * @copyright (c) 2002-2006 [Jon Ohlsson] MX-Publisher Project Team * @license http://opensource.org/licenses/gpl-license.php GNU General Public License v2 * */ define( 'IN_PORTAL', true ); if ( !defined( 'IN_ADMIN' ) ) { $mx_root_path = './../../'; $phpEx = substr(strrchr(__FILE__, '.'), 1); include( $mx_root_path . 'common.' . $phpEx ); // Start session management $mx_user->init($user_ip, PAGE_INDEX); if ( !$userdata['session_logged_in'] ) { die( "Hacking attempt(1)" ); } if ( $userdata['user_level'] != ADMIN ) { die( "Hacking attempt(2)" ); } // End session management } $mx_module_version = '3.0.0'; $mx_module_copy = 'Original Mx-Publisher <i>Meteo</i> module by <a href="http://mxpcms.sourceforge.net" target="_blank">OryNider</a>'; $message = "<b>This is a fresh install!</b><br/><br/>"; $sql = array(); $sql[] = "UPDATE " . $mx_table_prefix . "module" . " SET module_version = '" . $mx_module_version . "', module_copy = '" . $mx_module_copy . "' WHERE module_id = '" . $mx_module_id . "'"; $message .= mx_do_install_upgrade( $sql ); echo "<br /><br />"; echo "<table width=\"90%\" align=\"center\" cellpadding=\"4\" cellspacing=\"1\" border=\"0\" class=\"forumline\">"; echo "<tr><th class=\"thHead\" align=\"center\">Module Installation/Upgrading/Uninstalling Information - module specific db tables</th></tr>"; echo "<tr><td class=\"row1\" align=\"left\"><span class=\"gen\">" . $message . "</span></td></tr>"; echo "</table><br />"; ?> --- NEW FILE: install.txt --- [RELEASE] Meteo Forecast Module 1.0 - for Mx CMS v. 3.0 (or later) Description The Download module is an addon module for the Mx CMS for Weather by Freemeteo.com. Installation Instructions To install the Weather module, follow these instructions. If you encounter any problems during install, visit the module support forum. 1) Copy and upload new files Unzip the distributed files into your portal directory and upload 2) Import definition file In the Administration Panel -> Module Administration, import Module Pack "modules/mx_meteo/meteo.pak" 4) Add your block to the cms page 5) Get a GID from http://freemeteo.com/default.asp?pid=183&la=1 6) And Set your Local variables by editing the block configuration panel. --- NEW FILE: db_install.php --- <?php /** * * @package MX-Publisher Module - mx_meteo * @version $Id: db_install.php,v 1.1 2013/05/31 17:29:53 orynider Exp $ * @copyright (c) 2002-2006 [Jon Ohlsson] MX-Publisher Project Team * @license http://opensource.org/licenses/gpl-license.php GNU General Public License v2 * */ define( 'IN_PORTAL', true ); if ( !defined( 'IN_ADMIN' ) ) { $mx_root_path = './../../'; $phpEx = substr(strrchr(__FILE__, '.'), 1); include( $mx_root_path . 'common.' . $phpEx ); // Start session management $mx_user->init($user_ip, PAGE_INDEX); if ( !$userdata['session_logged_in'] ) { die( "Hacking attempt(1)" ); } if ( $userdata['user_level'] != ADMIN ) { die( "Hacking attempt(2)" ); } // End session management } $mx_module_version = '3.0.0'; $mx_module_copy = 'Original Mx-Publisher <i>Meteo</i> module by <a href="http://mxpcms.sourceforge.net" target="_blank">OryNider</a>'; $message = "<b>This is a fresh install!</b><br/><br/>"; $sql = array(); $sql[] = "UPDATE " . $mx_table_prefix . "module" . " SET module_version = '" . $mx_module_version . "', module_copy = '" . $mx_module_copy . "' WHERE module_id = '" . $mx_module_id . "'"; $message .= mx_do_install_upgrade( $sql ); echo "<br /><br />"; echo "<table width=\"90%\" align=\"center\" cellpadding=\"4\" cellspacing=\"1\" border=\"0\" class=\"forumline\">"; echo "<tr><th class=\"thHead\" align=\"center\">Module Installation/Upgrading/Uninstalling Information - module specific db tables</th></tr>"; echo "<tr><td class=\"row1\" align=\"left\"><span class=\"gen\">" . $message . "</span></td></tr>"; echo "</table><br />"; ?> --- NEW FILE: meteo.pak --- module=+:119=+:Meteo=+:modules/mx_meteo/=+:Meteo Module=+:1 New_function=+:---------------------------=+:0=+:0=+:0=+:0=+:0 function=+:119=+:161=+:Free Meteo=+:Free Meteo=+:meteo.php=+: parameter=+:161=+:162=+:wmode_transparent=+:Radio_single_select=+:allowTransparency=+:a:2:{i:0;s:17:"allowTransparency";i:1;s:16:"denyTransparency";}=+:1=+:90 parameter=+:161=+:163=+:gid=+:Text=+:878063_20130531_083049=+:=+:1=+:0 parameter=+:161=+:164=+:current_iframe=+:Number=+:4=+:=+:0=+:0 parameter=+:161=+:165=+:scrolling=+:Radio_single_select=+:no=+:a:2:{i:0;s:3:"yes";i:1;s:2:"no";}=+:0=+:1 parameter=+:161=+:166=+:marginWidth=+:Boolean=+:FALSE=+:a:2:{i:0;s:4:"TRUE";i:1;s:5:"FALSE";}=+:0=+:0 parameter=+:161=+:167=+:marginHeight=+:Boolean=+:FALSE=+:a:2:{i:0;s:4:"TRUE";i:1;s:5:"FALSE";}=+:0=+:0 parameter=+:161=+:168=+:frameBorder=+:Boolean=+:FALSE=+:a:2:{i:0;s:4:"TRUE";i:1;s:5:"FALSE";}=+:0=+:0 parameter=+:161=+:169=+:width_iframe=+:Number=+:160=+:=+:0=+:0 parameter=+:0=+:0=+:0=+:endoflist=+:0=+:0 block=+:=+:Free Meteo=+:Free Meteo block=+:161=+:0=+:5=+:0=+:0=+:0=+:0=+:1=+:1 function=+:0=+:0=+:0=+:endoflist=+:0=+:0 |