Browse Source

адаптация для версии ave.cms 3.26

master
parent
commit
ddf1bf04f5
  1. 6
      README.md
  2. 0
      rating/class/rating.php
  3. 20
      rating/info.php
  4. 4
      rating/lang/index.php
  5. 4
      rating/lang/ru.txt
  6. 23
      rating/module.php
  7. 32
      rating/sql.php

6
README.md

@ -1,8 +1,6 @@
## rating
# Модуль Рейтинг v1.1
### адаптирован для AVE.CMS 3.0 v1.5
# Модуль Рейтинг v1.26.1
## Данный модуль предназначен присваивать рейтинг документам.
@ -15,4 +13,6 @@
## Changelog:
04.09.2019 - версия 1.26.1 - адаптация для версии ave.cms 3.26
10.06.2016 - старт версии 1.1

0
rating/class.rating.php → rating/class/rating.php

20
rating/info.php

@ -0,0 +1,20 @@
<?php
if (! defined('BASE_DIR'))
exit;
$module = array(
'ModuleSysName' => 'rating',
'ModuleVersion' => '1.26.1',
'ModuleAutor' => 'AVE.cms Team',
'ModuleCopyright' => '&copy; 2007-' . date('Y') . ' AVE.cms',
'ModuleStatus' => 1,
'ModuleIsFunction' => 1,
'ModuleTemplate' => 0,
'ModuleAdminEdit' => 1,
'ModuleFunction' => 'mod_rating',
'ModuleTag' => '[mod_rating]',
'ModuleTagLink' => null,
'ModuleAveTag' => '#\\\[mod_rating(:[\\\d]+)?]#',
'ModulePHPTag' => "<?php mod_rating(''$1''); ?>"
);
?>

4
rating/lang/index.php

@ -0,0 +1,4 @@
<?php
header('Location:/');
exit;
?>

4
rating/lang/ru.txt

@ -1,3 +1,7 @@
[name]
MODULE_NAME = "Рейтинг документов"
MODULE_DESCRIPTION = "Звездный рейтинг документов"
[public]
RATING_NAME = "Рейтинг"
RATING_SUMMARY = "Оценка:"

23
rating/module.php

@ -10,23 +10,6 @@
if(!defined('BASE_DIR')) exit;
if (defined('ACP'))
{
$modul['ModuleName'] = "Рейтинг документов";
$modul['ModuleSysName'] = "rating";
$modul['ModuleVersion'] = "1.1";
$modul['ModuleDescription'] = "Звездный рейтинг документов";
$modul['ModuleAutor'] = 'AVE.CMS Team';
$modul['ModuleCopyright'] = '&copy; 2007-2016 AVE.CMS';
$modul['ModuleIsFunction'] = 1;
$modul['ModuleAdminEdit'] = 1;
$modul['ModuleFunction'] = "mod_rating";
$modul['ModuleTag'] = "[mod_rating]";
$modul['ModuleTagLink'] = null;
$modul['ModuleAveTag'] = '#\\\[mod_rating(:[\\\d]+)?]#';
$modul['ModulePHPTag'] = "<?php mod_rating(''$1''); ?>";
}
//Функция вывода модуля
function mod_rating($doc_id = false)
{
@ -44,7 +27,7 @@ function mod_rating($doc_id = false)
}
// подключаем класс
require_once(BASE_DIR . '/modules/rating/class.rating.php');
require_once(BASE_DIR . '/modules/rating/class/rating.php');
$rating = new docRating;
// папка с шаблонами
@ -64,7 +47,7 @@ function mod_rating($doc_id = false)
if (!defined('ACP') && !empty($_REQUEST['action']) && $_REQUEST['module'] == 'rating')
{
// подключаем класс
require_once(BASE_DIR . '/modules/rating/class.rating.php');
require_once(BASE_DIR . '/modules/rating/class/rating.php');
$rating = new docRating;
// ланги
@ -85,7 +68,7 @@ if (!defined('ACP') && !empty($_REQUEST['action']) && $_REQUEST['module'] == 'ra
if (defined('ACP') && !empty($_REQUEST['moduleaction']))
{
// Подключаем основной класс и создаем объект
require_once(BASE_DIR . '/modules/rating/class.rating.php');
require_once(BASE_DIR . '/modules/rating/class/rating.php');
$rating = new docRating;
$adm_dir = BASE_DIR . '/modules/rating/admin/';

32
rating/sql.php

@ -18,12 +18,12 @@ $module_sql_deinstall = array();
$module_sql_update = array();
// Удаление модуля
$module_sql_deinstall[] = "DROP TABLE IF EXISTS `CPPREFIX_module_rating_details`;";
$module_sql_deinstall[] = "DROP TABLE IF EXISTS `CPPREFIX_module_rating_summary`;";
$module_sql_deinstall[] = "DROP TABLE IF EXISTS `CPPREFIX_module_rating_settings`;";
$module_sql_deinstall[] = "DROP TABLE IF EXISTS `%%PRFX%%_module_rating_details`;";
$module_sql_deinstall[] = "DROP TABLE IF EXISTS `%%PRFX%%_module_rating_summary`;";
$module_sql_deinstall[] = "DROP TABLE IF EXISTS `%%PRFX%%_module_rating_settings`;";
// Установка модуля
$module_sql_install[] = "CREATE TABLE `CPPREFIX_module_rating_details` (
$module_sql_install[] = "CREATE TABLE `%%PRFX%%_module_rating_details` (
`Id` int(10) unsigned NOT NULL auto_increment,
`rating_id_doc` mediumint(5) unsigned NOT NULL default '0', #Id документа
`rating_id_user` mediumint(5) unsigned NOT NULL default '0', #Id пользователя
@ -33,7 +33,7 @@ $module_sql_install[] = "CREATE TABLE `CPPREFIX_module_rating_details` (
PRIMARY KEY (`Id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;";
$module_sql_install[] = "CREATE TABLE `CPPREFIX_module_rating_settings` (
$module_sql_install[] = "CREATE TABLE `%%PRFX%%_module_rating_settings` (
`Id` tinyint(1) unsigned NOT NULL auto_increment,
`rating_user_groups` varchar(255) NOT NULL default '1,2,3,4,5', #Группы пользователей
`rating_stars` enum('1','2','3','4','5','6','7','8','9','10') NOT NULL default '5', #Кол-во звезд
@ -42,7 +42,7 @@ $module_sql_install[] = "CREATE TABLE `CPPREFIX_module_rating_settings` (
PRIMARY KEY (`Id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;";
$module_sql_install[] = "CREATE TABLE `CPPREFIX_module_rating_summary` (
$module_sql_install[] = "CREATE TABLE `%%PRFX%%_module_rating_summary` (
`Id` int(10) unsigned NOT NULL auto_increment,
`rating_id_doc` int(10) unsigned NOT NULL default '0', #Id документа
`rating_total` int(10) unsigned NOT NULL default '0', #Кол-во голосов
@ -50,29 +50,29 @@ $module_sql_install[] = "CREATE TABLE `CPPREFIX_module_rating_summary` (
PRIMARY KEY (`Id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;";
$module_sql_install[] = "INSERT INTO `CPPREFIX_module_rating_settings` VALUES ('1', '1,2,3,4,5', '5', '0', '1');";
$module_sql_install[] = "INSERT INTO `%%PRFX%%_module_rating_settings` VALUES ('1', '1,2,3,4,5', '5', '0', '1');";
// Обновление модуля
$module_sql_update[] = "
RENAME TABLE
`CPPREFIX_module_rating`
`%%PRFX%%_module_rating`
TO
`CPPREFIX_module_rating_summary`
`%%PRFX%%_module_rating_summary`
";
$module_sql_update[] = "
ALTER TABLE `CPPREFIX_module_rating_summary` CHANGE `Id` `rating_id_doc` INT( 10 ) UNSIGNED NOT NULL;
ALTER TABLE `%%PRFX%%_module_rating_summary` CHANGE `Id` `rating_id_doc` INT( 10 ) UNSIGNED NOT NULL;
";
$module_sql_update[] = "
ALTER TABLE `CPPREFIX_module_rating_summary` CHANGE `rating_count` `rating_total` INT( 10 ) UNSIGNED NOT NULL;
ALTER TABLE `%%PRFX%%_module_rating_summary` CHANGE `rating_count` `rating_total` INT( 10 ) UNSIGNED NOT NULL;
";
$module_sql_update[] = "
ALTER TABLE `CPPREFIX_module_rating_summary` DROP `lastip`;
ALTER TABLE `%%PRFX%%_module_rating_summary` DROP `lastip`;
";
$module_sql_update[] = "CREATE TABLE `CPPREFIX_module_rating_details` (
$module_sql_update[] = "CREATE TABLE `%%PRFX%%_module_rating_details` (
`Id` int(10) unsigned NOT NULL auto_increment,
`rating_id_doc` mediumint(5) unsigned NOT NULL default '0', #Id документа
`rating_id_user` mediumint(5) unsigned NOT NULL default '0', #Id пользователя
@ -82,7 +82,7 @@ $module_sql_update[] = "CREATE TABLE `CPPREFIX_module_rating_details` (
PRIMARY KEY (`Id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;";
$module_sql_update[] = "CREATE TABLE `CPPREFIX_module_rating_settings` (
$module_sql_update[] = "CREATE TABLE `%%PRFX%%_module_rating_settings` (
`Id` tinyint(1) unsigned NOT NULL auto_increment,
`rating_user_groups` varchar(255) NOT NULL default '1,2,3,4,5', #Группы пользователей
`rating_stars` enum('1','2','3','4','5','6','7','8','9','10') NOT NULL default '5', #Кол-во звезд
@ -91,11 +91,11 @@ $module_sql_update[] = "CREATE TABLE `CPPREFIX_module_rating_settings` (
PRIMARY KEY (`Id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;";
$module_sql_update[] = "INSERT INTO `CPPREFIX_module_rating_settings` VALUES ('1', '1,2,3,4,5', '5', '0', '1');";
$module_sql_update[] = "INSERT INTO `%%PRFX%%_module_rating_settings` VALUES ('1', '1,2,3,4,5', '5', '0', '1');";
$module_sql_update[] = "
UPDATE
`CPPREFIX_module`
`%%PRFX%%_module`
SET
ModuleAveTag = '" . $modul['ModuleAveTag'] . "',
ModulePHPTag = '" . $modul['ModulePHPTag'] . "',

Loading…
Cancel
Save