From 05262ac5a0d31e25b472056c34bbc4d093e7981e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D0=BB=D0=B5=D0=BA=D1=81=D0=B0=D0=BD=D0=B4=D1=80=20?= =?UTF-8?q?=D0=A1=D0=B0=D0=BB=D1=8C=D0=BD=D0=B8=D0=BA=D0=BE=D0=B2?= Date: Thu, 5 Sep 2019 00:08:08 +0500 Subject: [PATCH] =?UTF-8?q?=D0=B0=D0=B4=D0=B0=D0=BF=D1=82=D0=B0=D1=86?= =?UTF-8?q?=D0=B8=D1=8F=20=D0=B4=D0=BB=D1=8F=20=D0=B2=D0=B5=D1=80=D1=81?= =?UTF-8?q?=D0=B8=D0=B8=20ave.cms=203.26?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 2 ++ whoisonline/info.php | 20 ++++++++++++++++++++ whoisonline/lang/index.php | 4 ++++ whoisonline/lang/ru.txt | 3 +++ whoisonline/module.php | 22 +--------------------- whoisonline/sql.php | 6 +++--- 6 files changed, 33 insertions(+), 24 deletions(-) create mode 100644 whoisonline/info.php create mode 100644 whoisonline/lang/index.php create mode 100644 whoisonline/lang/ru.txt diff --git a/README.md b/README.md index e6d012c..a7e6d2b 100644 --- a/README.md +++ b/README.md @@ -10,4 +10,6 @@ ## Changelog: +Версия 1.26.0 - адаптация для версии ave.cms 3.26 + Версия 1.0 \ No newline at end of file diff --git a/whoisonline/info.php b/whoisonline/info.php new file mode 100644 index 0000000..d5c0963 --- /dev/null +++ b/whoisonline/info.php @@ -0,0 +1,20 @@ + 'whoisonline', + 'ModuleVersion' => '1.26.0', + 'ModuleAutor' => 'AVE.cms Team', + 'ModuleCopyright' => '© 2007-' . date('Y') . ' AVE.cms', + 'ModuleStatus' => 1, + 'ModuleIsFunction' => 1, + 'ModuleTemplate' => 0, + 'ModuleAdminEdit' => 0, + 'ModuleFunction' => 'mod_online', + 'ModuleTag' => '[mod_online]', + 'ModuleTagLink' => null, + 'ModuleAveTag' => '#\\\[mod_online]#', + 'ModulePHPTag' => "" + ); +?> \ No newline at end of file diff --git a/whoisonline/lang/index.php b/whoisonline/lang/index.php new file mode 100644 index 0000000..4ca25aa --- /dev/null +++ b/whoisonline/lang/index.php @@ -0,0 +1,4 @@ + \ No newline at end of file diff --git a/whoisonline/lang/ru.txt b/whoisonline/lang/ru.txt new file mode 100644 index 0000000..2353977 --- /dev/null +++ b/whoisonline/lang/ru.txt @@ -0,0 +1,3 @@ +[name] +MODULE_NAME = "Who is online" +MODULE_DESCRIPTION = "Данный модуль предназначен для отображения присутствующих на сайте пользователей с гео-информацией." \ No newline at end of file diff --git a/whoisonline/module.php b/whoisonline/module.php index d8668f9..583ed75 100644 --- a/whoisonline/module.php +++ b/whoisonline/module.php @@ -13,26 +13,6 @@ if (!defined('BASE_DIR')) exit; -if (defined('ACP')) - $modul = - [ - 'ModuleName' => "Who is online", - 'ModuleSysName' => "whoisonline", - 'ModuleVersion' => "1.0", - 'ModuleDescription' => "Данный модуль предназначен для отображения присутствующих на сайте пользователей с гео-информацией.", - 'ModuleAutor' => "AVE.cms Team", - 'ModuleCopyright' => "© AVE.cms Team 2016", - 'ModuleStatus' => 1, - 'ModuleIsFunction' => 1, - 'ModuleTemplate' => 0, - 'ModuleAdminEdit' => 0, - 'ModuleFunction' => 'mod_online', - 'ModuleTag' => '[mod_online]', - 'ModuleTagLink' => null, - 'ModuleAveTag' => '#\\\[mod_online]#', - 'ModulePHPTag' => "" - ]; - function mod_online() { ?> @@ -111,7 +91,7 @@ if (! defined('ACP') && isset($_REQUEST['module']) && $_REQUEST['module'] == 'wh { // Making an API call to Hostip: - $xml = json_decode(file_get_contents('http://freegeoip.net/json/' . $stringIp), true); + $xml = json_decode(file_get_contents('https://freegeoip.net/json/' . $stringIp), true); $city = $xml['city']; $countryName = $xml['country_name']; diff --git a/whoisonline/sql.php b/whoisonline/sql.php index 324f55c..5d6d72a 100644 --- a/whoisonline/sql.php +++ b/whoisonline/sql.php @@ -13,9 +13,9 @@ $module_sql_install = array(); $module_sql_deinstall = array(); $module_sql_update = array(); -$module_sql_deinstall[] = "DROP TABLE IF EXISTS CPPREFIX_module_who_is_online"; +$module_sql_deinstall[] = "DROP TABLE IF EXISTS %%PRFX%%_module_who_is_online"; -$module_sql_install[] = "CREATE TABLE CPPREFIX_module_who_is_online ( +$module_sql_install[] = "CREATE TABLE %%PRFX%%_module_who_is_online ( `id` int(10) unsigned NOT NULL auto_increment, `ip` int(11) unsigned NOT NULL default '0', `country` char(64) NOT NULL default '', @@ -29,7 +29,7 @@ $module_sql_install[] = "CREATE TABLE CPPREFIX_module_who_is_online ( $module_sql_update[] = " UPDATE - `CPPREFIX_module` + `%%PRFX%%_module` SET ModuleAveTag = '" . $modul['ModuleAveTag'] . "', ModulePHPTag = '" . $modul['ModulePHPTag'] . "',