Просмотр файла modules/comments/helpers/comments_installer.php

Размер файла: 1.11Kb
<?php
/**
 * Ant0ha's project
 *
 * @package
 * @author Anton Pisarenko <[email protected]>
 * @copyright Copyright (c) 2006 - 2010, Anton Pisarenko
 * @license http://ant0ha.ru/license.txt
 * @link http://ant0ha.ru
 */

defined('IN_SYSTEM') or die('<b>403<br />Запрет доступа!</b>');

//---------------------------------------------

/**
 * Хелпер установки модуля
 */
class comments_installer {
	/**
	* Установка модуля
	*/
	public static function install(&$db) {
		$db->query("CREATE TABLE IF NOT EXISTS #__comments_posts (
			  `comment_id` int(11) NOT NULL auto_increment,
			  `module` varchar(30) NOT NULL,
			  `item_id` int(11) NOT NULL,
			  `user_id` int(11) NOT NULL,
			  `username` varchar(50) NOT NULL,
			  `text` varchar(300) NOT NULL,
			  `time` int(11) NOT NULL,
			  PRIMARY KEY  (`comment_id`),
			  KEY `item_id` (`item_id`)
			) ENGINE=MyISAM  DEFAULT CHARSET=utf8;
		");
	}

	/**
	* Деинсталляция модуля
	*/
	public static function uninstall(&$db) {
		$db->query("DROP TABLE #__comments_posts;");
	}
}
?>