|
|
@ -18,12 +18,12 @@ $module_sql_deinstall = array(); |
|
|
|
$module_sql_update = array(); |
|
|
|
$module_sql_update = array(); |
|
|
|
|
|
|
|
|
|
|
|
// Удаление модуля |
|
|
|
// Удаление модуля |
|
|
|
$module_sql_deinstall[] = "DROP TABLE IF EXISTS `CPPREFIX_module_rating_details`;"; |
|
|
|
$module_sql_deinstall[] = "DROP TABLE IF EXISTS `%%PRFX%%_module_rating_details`;"; |
|
|
|
$module_sql_deinstall[] = "DROP TABLE IF EXISTS `CPPREFIX_module_rating_summary`;"; |
|
|
|
$module_sql_deinstall[] = "DROP TABLE IF EXISTS `%%PRFX%%_module_rating_summary`;"; |
|
|
|
$module_sql_deinstall[] = "DROP TABLE IF EXISTS `CPPREFIX_module_rating_settings`;"; |
|
|
|
$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, |
|
|
|
`Id` int(10) unsigned NOT NULL auto_increment, |
|
|
|
`rating_id_doc` mediumint(5) unsigned NOT NULL default '0', #Id документа |
|
|
|
`rating_id_doc` mediumint(5) unsigned NOT NULL default '0', #Id документа |
|
|
|
`rating_id_user` 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`) |
|
|
|
PRIMARY KEY (`Id`) |
|
|
|
) ENGINE=MyISAM DEFAULT CHARSET=utf8;"; |
|
|
|
) 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, |
|
|
|
`Id` tinyint(1) unsigned NOT NULL auto_increment, |
|
|
|
`rating_user_groups` varchar(255) NOT NULL default '1,2,3,4,5', #Группы пользователей |
|
|
|
`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', #Кол-во звезд |
|
|
|
`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`) |
|
|
|
PRIMARY KEY (`Id`) |
|
|
|
) ENGINE=MyISAM DEFAULT CHARSET=utf8;"; |
|
|
|
) 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, |
|
|
|
`Id` int(10) unsigned NOT NULL auto_increment, |
|
|
|
`rating_id_doc` int(10) unsigned NOT NULL default '0', #Id документа |
|
|
|
`rating_id_doc` int(10) unsigned NOT NULL default '0', #Id документа |
|
|
|
`rating_total` int(10) unsigned NOT NULL default '0', #Кол-во голосов |
|
|
|
`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`) |
|
|
|
PRIMARY KEY (`Id`) |
|
|
|
) ENGINE=MyISAM DEFAULT CHARSET=utf8;"; |
|
|
|
) 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[] = " |
|
|
|
$module_sql_update[] = " |
|
|
|
RENAME TABLE |
|
|
|
RENAME TABLE |
|
|
|
`CPPREFIX_module_rating` |
|
|
|
`%%PRFX%%_module_rating` |
|
|
|
TO |
|
|
|
TO |
|
|
|
`CPPREFIX_module_rating_summary` |
|
|
|
`%%PRFX%%_module_rating_summary` |
|
|
|
"; |
|
|
|
"; |
|
|
|
|
|
|
|
|
|
|
|
$module_sql_update[] = " |
|
|
|
$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[] = " |
|
|
|
$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[] = " |
|
|
|
$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, |
|
|
|
`Id` int(10) unsigned NOT NULL auto_increment, |
|
|
|
`rating_id_doc` mediumint(5) unsigned NOT NULL default '0', #Id документа |
|
|
|
`rating_id_doc` mediumint(5) unsigned NOT NULL default '0', #Id документа |
|
|
|
`rating_id_user` 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`) |
|
|
|
PRIMARY KEY (`Id`) |
|
|
|
) ENGINE=MyISAM DEFAULT CHARSET=utf8;"; |
|
|
|
) 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, |
|
|
|
`Id` tinyint(1) unsigned NOT NULL auto_increment, |
|
|
|
`rating_user_groups` varchar(255) NOT NULL default '1,2,3,4,5', #Группы пользователей |
|
|
|
`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', #Кол-во звезд |
|
|
|
`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`) |
|
|
|
PRIMARY KEY (`Id`) |
|
|
|
) ENGINE=MyISAM DEFAULT CHARSET=utf8;"; |
|
|
|
) 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[] = " |
|
|
|
$module_sql_update[] = " |
|
|
|
UPDATE |
|
|
|
UPDATE |
|
|
|
`CPPREFIX_module` |
|
|
|
`%%PRFX%%_module` |
|
|
|
SET |
|
|
|
SET |
|
|
|
ModuleAveTag = '" . $modul['ModuleAveTag'] . "', |
|
|
|
ModuleAveTag = '" . $modul['ModuleAveTag'] . "', |
|
|
|
ModulePHPTag = '" . $modul['ModulePHPTag'] . "', |
|
|
|
ModulePHPTag = '" . $modul['ModulePHPTag'] . "', |
|
|
|