|
|
@@ -13,6 +13,9 @@ CREATE TABLE IF NOT EXISTS `bx_albums_albums` (
|
|
|
`views` int(11) NOT NULL default '0',
|
|
|
`rate` float NOT NULL default '0',
|
|
|
`votes` int(11) NOT NULL default '0',
|
|
|
+ `score` int(11) NOT NULL default '0',
|
|
|
+ `sc_up` int(11) NOT NULL default '0',
|
|
|
+ `sc_down` int(11) NOT NULL default '0',
|
|
|
`favorites` int(11) NOT NULL default '0',
|
|
|
`comments` int(11) NOT NULL default '0',
|
|
|
`reports` int(11) NOT NULL default '0',
|
|
|
@@ -66,6 +69,9 @@ CREATE TABLE IF NOT EXISTS `bx_albums_files2albums` (
|
|
|
`views` int(11) NOT NULL,
|
|
|
`rate` float NOT NULL,
|
|
|
`votes` int(11) NOT NULL,
|
|
|
+ `score` int(11) NOT NULL default '0',
|
|
|
+ `sc_up` int(11) NOT NULL default '0',
|
|
|
+ `sc_down` int(11) NOT NULL default '0',
|
|
|
`favorites` int(11) NOT NULL default '0',
|
|
|
`comments` int(11) NOT NULL,
|
|
|
`featured` int(11) NOT NULL default '0',
|
|
|
@@ -246,6 +252,43 @@ CREATE TABLE `bx_albums_favorites_media_track` (
|
|
|
KEY `id` (`object_id`,`author_id`)
|
|
|
);
|
|
|
|
|
|
+-- TABLE: scores
|
|
|
+CREATE TABLE IF NOT EXISTS `bx_albums_scores` (
|
|
|
+ `object_id` int(11) NOT NULL default '0',
|
|
|
+ `count_up` int(11) NOT NULL default '0',
|
|
|
+ `count_down` int(11) NOT NULL default '0',
|
|
|
+ UNIQUE KEY `object_id` (`object_id`)
|
|
|
+);
|
|
|
+
|
|
|
+CREATE TABLE IF NOT EXISTS `bx_albums_scores_track` (
|
|
|
+ `id` int(11) NOT NULL AUTO_INCREMENT,
|
|
|
+ `object_id` int(11) NOT NULL default '0',
|
|
|
+ `author_id` int(11) NOT NULL default '0',
|
|
|
+ `author_nip` int(11) unsigned NOT NULL default '0',
|
|
|
+ `type` varchar(8) NOT NULL default '',
|
|
|
+ `date` int(11) NOT NULL default '0',
|
|
|
+ PRIMARY KEY (`id`),
|
|
|
+ KEY `vote` (`object_id`, `author_nip`)
|
|
|
+);
|
|
|
+
|
|
|
+CREATE TABLE IF NOT EXISTS `bx_albums_scores_media` (
|
|
|
+ `object_id` int(11) NOT NULL default '0',
|
|
|
+ `count_up` int(11) NOT NULL default '0',
|
|
|
+ `count_down` int(11) NOT NULL default '0',
|
|
|
+ UNIQUE KEY `object_id` (`object_id`)
|
|
|
+);
|
|
|
+
|
|
|
+CREATE TABLE IF NOT EXISTS `bx_albums_scores_media_track` (
|
|
|
+ `id` int(11) NOT NULL AUTO_INCREMENT,
|
|
|
+ `object_id` int(11) NOT NULL default '0',
|
|
|
+ `author_id` int(11) NOT NULL default '0',
|
|
|
+ `author_nip` int(11) unsigned NOT NULL default '0',
|
|
|
+ `type` varchar(8) NOT NULL default '',
|
|
|
+ `date` int(11) NOT NULL default '0',
|
|
|
+ PRIMARY KEY (`id`),
|
|
|
+ KEY `vote` (`object_id`, `author_nip`)
|
|
|
+);
|
|
|
+
|
|
|
|
|
|
-- STORAGES & TRANSCODERS
|
|
|
INSERT INTO `sys_objects_storage` (`object`, `engine`, `params`, `token_life`, `cache_control`, `levels`, `table_files`, `ext_mode`, `ext_allow`, `ext_deny`, `quota_size`, `current_size`, `quota_number`, `current_number`, `max_file_size`, `ts`) VALUES
|
|
|
@@ -354,6 +397,12 @@ INSERT INTO `sys_objects_vote` (`Name`, `TableMain`, `TableTrack`, `PostTimeout`
|
|
|
('bx_albums_media', 'bx_albums_votes_media', 'bx_albums_votes_media_track', '604800', '1', '1', '0', '1', 'bx_albums_files2albums', 'id', 'author', 'rate', 'votes', '', '');
|
|
|
|
|
|
|
|
|
+-- SCORES
|
|
|
+INSERT INTO `sys_objects_score` (`name`, `module`, `table_main`, `table_track`, `post_timeout`, `is_on`, `trigger_table`, `trigger_field_id`, `trigger_field_author`, `trigger_field_score`, `trigger_field_cup`, `trigger_field_cdown`, `class_name`, `class_file`) VALUES
|
|
|
+('bx_albums', 'bx_albums', 'bx_albums_scores', 'bx_albums_scores_track', '604800', '0', 'bx_albums_albums', 'id', 'author', 'score', 'sc_up', 'sc_down', '', ''),
|
|
|
+('bx_albums_media', 'bx_albums', 'bx_albums_scores_media', 'bx_albums_scores_media_track', '604800', '0', 'bx_albums_files2albums', 'id', 'author', 'score', 'sc_up', 'sc_down', '', '');
|
|
|
+
|
|
|
+
|
|
|
-- REPORTS
|
|
|
INSERT INTO `sys_objects_report` (`name`, `table_main`, `table_track`, `is_on`, `base_url`, `trigger_table`, `trigger_field_id`, `trigger_field_author`, `trigger_field_count`, `class_name`, `class_file`) VALUES
|
|
|
('bx_albums', 'bx_albums_reports', 'bx_albums_reports_track', '1', 'page.php?i=view-album&id={object_id}', 'bx_albums_albums', 'id', 'author', 'reports', '', '');
|