Browse Source

Адаптация для версии ave.cms v3.26

master
Repellent 5 years ago
parent
commit
a331a3378c
  1. 2
      README.md
  2. 0
      weather/class/weather.php
  3. 20
      weather/info.php
  4. 5
      weather/lang/bg.txt
  5. 5
      weather/lang/en.txt
  6. 5
      weather/lang/ru.txt
  7. 22
      weather/module.php
  8. 10
      weather/sql.php

2
README.md

@ -14,4 +14,6 @@
## Changelog: ## Changelog:
02.09.2019 - версия 1.26.01 - Адаптация для версии ave.cms 3.26
07.05.2016 - версия 1.01 07.05.2016 - версия 1.01

0
weather/class.weather.php → weather/class/weather.php

20
weather/info.php

@ -0,0 +1,20 @@
<?php
if (! defined('BASE_DIR'))
exit;
$module = array(
'ModuleSysName' => 'weather',
'ModuleVersion' => '1.26.01',
'ModuleAutor' => 'N. Popova, npop@abv.bg',
'ModuleCopyright' => '&copy; 2016 npop@abv.bg',
'ModuleStatus' => 1,
'ModuleIsFunction' => 1,
'ModuleTemplate' => 0,
'ModuleAdminEdit' => 1,
'ModuleFunction' => 'mod_weather',
'ModuleTag' => '[mod_weather]',
'ModuleTagLink' => null,
'ModuleAveTag' => '#\\\[mod_weather]#',
'ModulePHPTag' => '<?php mod_weather(); ?>'
);
?>

5
weather/lang/bg.txt

@ -1,3 +1,8 @@
[name]
MODULE_NAME = "Weather widget"
MODULE_DESCRIPTION = "Weather is weather module which utilizes the Openweather/Yahoo API allowing you to display weather data and related information from regions from all over the world very easily.<br />You can enrich your website with your own weather channel, were all weather conditions from any place of the world will look as you want to be, using the most reliable weather forecast source and combining with the most professional style.<br />System tag <strong>[mod_weather]</strong>."
WEATHER_NAME = 'Времето' WEATHER_NAME = 'Времето'
[admin] [admin]
WEATHER_MODULE_NAME = "Модул Прогноза" WEATHER_MODULE_NAME = "Модул Прогноза"

5
weather/lang/en.txt

@ -1,3 +1,8 @@
[name]
MODULE_NAME = "Weather widget"
MODULE_DESCRIPTION = "Weather is weather module which utilizes the Openweather/Yahoo API allowing you to display weather data and related information from regions from all over the world very easily.<br />You can enrich your website with your own weather channel, were all weather conditions from any place of the world will look as you want to be, using the most reliable weather forecast source and combining with the most professional style.<br />System tag <strong>[mod_weather]</strong>."
WEATHER_NAME = 'WEATHER' WEATHER_NAME = 'WEATHER'
[admin] [admin]
WEATHER_MODULE_NAME = "Module WEATHER" WEATHER_MODULE_NAME = "Module WEATHER"

5
weather/lang/ru.txt

@ -1,3 +1,8 @@
[name]
MODULE_NAME = "Weather widget"
MODULE_DESCRIPTION = "Weather is weather module which utilizes the Openweather/Yahoo API allowing you to display weather data and related information from regions from all over the world very easily.<br />You can enrich your website with your own weather channel, were all weather conditions from any place of the world will look as you want to be, using the most reliable weather forecast source and combining with the most professional style.<br />System tag <strong>[mod_weather]</strong>."
WEATHER_NAME = 'Погода' WEATHER_NAME = 'Погода'
[admin] [admin]
WEATHER_MODULE_NAME = "Модуль Погода > Настройки" WEATHER_MODULE_NAME = "Модуль Погода > Настройки"

22
weather/module.php

@ -10,29 +10,11 @@
if (!defined('BASE_DIR')) exit; if (!defined('BASE_DIR')) exit;
if (defined('ACP'))
{
$modul['ModuleName'] = 'Weather widget';
$modul['ModuleSysName'] = 'weather';
$modul['ModuleVersion'] = '1.01';
$modul['ModuleDescription'] = 'Weather is weather module which utilizes the Openweather/Yahoo API allowing you to display weather data and related information from regions from all over the world very easily.<br />You can enrich your website with your own weather channel, were all weather conditions from any place of the world will look as you want to be, using the most reliable weather forecast source and combining with the most professional style.<br />System tag <strong>[mod_weather]</strong>.';
$modul['ModuleAutor'] = "N. Popova, npop@abv.bg"; // Автор
$modul['ModuleCopyright'] = '&copy; 2016 npop@abv.bg'; //
$modul['ModuleIsFunction'] = 1;
$modul['ModuleAdminEdit'] = 1;
$modul['ModuleFunction'] = 'mod_weather';
$modul['ModuleTag'] = '[mod_weather]';
$modul['ModuleTagLink'] = null;
$modul['ModuleAveTag'] = "#\\\[mod_weather]#";
$modul['ModulePHPTag'] = "<?php mod_weather(); ?>";
}
function mod_weather() function mod_weather()
{ {
require_once(BASE_DIR . "/modules/weather/class.weather.php"); require_once(BASE_DIR . "/modules/weather/class/weather.php");
$weather = new Weather(); $weather = new Weather();
@ -48,7 +30,7 @@ function mod_weather()
if (defined('ACP') && ! empty($_REQUEST['moduleaction'])) if (defined('ACP') && ! empty($_REQUEST['moduleaction']))
{ {
require_once(BASE_DIR . "/modules/weather/class.weather.php"); require_once(BASE_DIR . "/modules/weather/class/weather.php");
$tpl_dir = BASE_DIR . '/modules/weather/templates/'; $tpl_dir = BASE_DIR . '/modules/weather/templates/';
$lang_file = BASE_DIR . "/modules/weather/lang/" . $_SESSION['user_language'] . ".txt"; $lang_file = BASE_DIR . "/modules/weather/lang/" . $_SESSION['user_language'] . ".txt";

10
weather/sql.php

@ -16,9 +16,9 @@ $module_sql_install = array();
$module_sql_deinstall = array(); $module_sql_deinstall = array();
$module_sql_update = array(); $module_sql_update = array();
$module_sql_deinstall[] = "DROP TABLE IF EXISTS `CPPREFIX_module_weather`;"; $module_sql_deinstall[] = "DROP TABLE IF EXISTS `%%PRFX%%_module_weather`;";
$module_sql_install[] = "CREATE TABLE `CPPREFIX_module_weather` ( $module_sql_install[] = "CREATE TABLE `%%PRFX%%_module_weather` (
`id` tinyint(1) unsigned NOT NULL auto_increment, `id` tinyint(1) unsigned NOT NULL auto_increment,
`location` char(100) default 'Varna', `location` char(100) default 'Varna',
`country` char(100) default 'Bulgaria', `country` char(100) default 'Bulgaria',
@ -40,11 +40,11 @@ $module_sql_install[] = "CREATE TABLE `CPPREFIX_module_weather` (
PRIMARY KEY (`id`) PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;" ; ) ENGINE=MyISAM DEFAULT CHARSET=utf8;" ;
$module_sql_install[] = "INSERT INTO `CPPREFIX_module_weather` VALUES (1, 'Varna','Bulgaria', '726050', '43.216671', '27.91667', '0', 'openweathermap','','','3','full','1', '1','bg','10','metric','1');"; $module_sql_install[] = "INSERT INTO `%%PRFX%%_module_weather` VALUES (1, 'Varna','Bulgaria', '726050', '43.216671', '27.91667', '0', 'openweathermap','','','3','full','1', '1','bg','10','metric','1');";
$module_sql_update[] = " $module_sql_update[] = "
UPDATE UPDATE
CPPREFIX_module %%PRFX%%_module
SET SET
CpEngineTag = '" . $modul['CpEngineTag'] . "', CpEngineTag = '" . $modul['CpEngineTag'] . "',
CpPHPTag = '" . $modul['CpPHPTag'] . "', CpPHPTag = '" . $modul['CpPHPTag'] . "',
@ -55,7 +55,7 @@ $module_sql_update[] = "
$module_sql_update[] = " $module_sql_update[] = "
ALTER TABLE ALTER TABLE
`CPPREFIX_module_weather` `%%PRFX%%_module_weather`
ADD ADD
`secret_key` CHAR(255) NOT NULL `secret_key` CHAR(255) NOT NULL
AFTER AFTER

Loading…
Cancel
Save