Модуль Опросы | Голосование v1.26.1a
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

93 lines
2.6 KiB

<?php
/**
* AVE.cms - Модуль Опросы.
*
* @package AVE.cms
* @subpackage mod_poll
* @since 1.1
* @filesource
*/
/**
* mySQL-запросы для установки, обновления и удаления модуля
*/
$module_sql_install = array();
$module_sql_deinstall = array();
$module_sql_update = array();
// Удаление модуля
$module_sql_deinstall[] = "DROP TABLE IF EXISTS CPPREFIX_module_poll;";
$module_sql_deinstall[] = "DROP TABLE IF EXISTS CPPREFIX_module_poll_comments;";
$module_sql_deinstall[] = "DROP TABLE IF EXISTS CPPREFIX_module_poll_items;";
// Установка модуля
$module_sql_install[] = "CREATE TABLE CPPREFIX_module_poll (
id int(10) unsigned NOT NULL auto_increment,
poll_title varchar(255) NOT NULL default '',
poll_status enum('1','0') NOT NULL default '1',
poll_can_comment enum('0','1') NOT NULL default '0',
poll_groups_id tinytext,
poll_start int(10) unsigned NOT NULL default '0',
poll_end int(10) unsigned NOT NULL default '0',
poll_users_id text NOT NULL default '',
poll_users_ip text NOT NULL default '',
PRIMARY KEY (id)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;";
$module_sql_install[] = "CREATE TABLE CPPREFIX_module_poll_comments (
id int(10) unsigned NOT NULL auto_increment,
poll_id int(10) NOT NULL,
poll_comment_author_id int(10) NOT NULL,
poll_comment_author_ip text NOT NULL default '',
poll_comment_time int(10) unsigned NOT NULL default '0',
poll_comment_title varchar(250) NOT NULL default '',
poll_comment_text text NOT NULL default '',
PRIMARY KEY (id)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;";
$module_sql_install[] = "CREATE TABLE CPPREFIX_module_poll_items (
id int(10) unsigned NOT NULL auto_increment,
poll_id int(10) NOT NULL,
poll_item_title varchar(250) NOT NULL default '',
poll_item_hits int(10) NOT NULL default '0',
poll_item_color varchar(10) NOT NULL default '',
poll_item_position int(2) NOT NULL,
PRIMARY KEY (id)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;";
// Обновление модуля
$module_sql_update[] = "
UPDATE
`CPPREFIX_module`
SET
ModuleAveTag = '" . $modul['ModuleAveTag'] . "',
ModulePHPTag = '" . $modul['ModulePHPTag'] . "',
ModuleVersion = '" . $modul['ModuleVersion'] . "'
WHERE
ModuleSysName = '" . $modul['ModuleSysName'] . "'
LIMIT 1;
";
$module_sql_update[] = "
RENAME TABLE
`CPPREFIX_modul_poll`
TO
`CPPREFIX_module_poll`
";
$module_sql_update[] = "
RENAME TABLE
`CPPREFIX_modul_poll_comments`
TO
`CPPREFIX_module_poll_comments`
";
$module_sql_update[] = "
RENAME TABLE
`CPPREFIX_modul_poll_items`
TO
`CPPREFIX_module_poll_items`
";
?>