Sfoglia il codice sorgente

Ticket #1211 - Usage in Text based modules.

AntonLV 8 anni fa
parent
commit
d84013ca6c
36 ha cambiato i file con 402 aggiunte e 15 eliminazioni
  1. 5 0
      modules/base/general/classes/BxBaseModGeneralFormEntry.php
  2. 5 5
      modules/base/general/classes/BxBaseModGeneralModule.php
  3. 2 0
      modules/boonex/albums/classes/BxAlbumsConfig.php
  4. 6 0
      modules/boonex/albums/classes/BxAlbumsModule.php
  5. 49 0
      modules/boonex/albums/install/sql/install.sql
  6. 5 1
      modules/boonex/albums/install/sql/uninstall.sql
  7. 1 0
      modules/boonex/files/classes/BxFilesConfig.php
  8. 25 0
      modules/boonex/files/install/sql/install.sql
  9. 4 1
      modules/boonex/files/install/sql/uninstall.sql
  10. 1 0
      modules/boonex/forum/classes/BxForumConfig.php
  11. 4 0
      modules/boonex/forum/install/sql/disable.sql
  12. 5 0
      modules/boonex/forum/install/sql/enable.sql
  13. 22 0
      modules/boonex/forum/install/sql/install.sql
  14. 1 1
      modules/boonex/forum/install/sql/uninstall.sql
  15. 1 0
      modules/boonex/glossary/classes/BxGlsrConfig.php
  16. 26 0
      modules/boonex/glossary/install/sql/install.sql
  17. 4 1
      modules/boonex/glossary/install/sql/uninstall.sql
  18. 1 0
      modules/boonex/market/classes/BxMarketConfig.php
  19. 40 0
      modules/boonex/market/classes/BxMarketScore.php
  20. 26 0
      modules/boonex/market/install/sql/install.sql
  21. 4 1
      modules/boonex/market/install/sql/uninstall.sql
  22. 1 0
      modules/boonex/photos/classes/BxPhotosConfig.php
  23. 27 0
      modules/boonex/photos/install/sql/install.sql
  24. 5 1
      modules/boonex/photos/install/sql/uninstall.sql
  25. 1 0
      modules/boonex/polls/classes/BxPollsConfig.php
  26. 27 0
      modules/boonex/polls/install/sql/install.sql
  27. 5 1
      modules/boonex/polls/install/sql/uninstall.sql
  28. 1 0
      modules/boonex/shopify/classes/BxShopifyConfig.php
  29. 27 0
      modules/boonex/shopify/install/sql/install.sql
  30. 5 1
      modules/boonex/shopify/install/sql/uninstall.sql
  31. 1 0
      modules/boonex/snipcart/classes/BxSnipcartConfig.php
  32. 27 0
      modules/boonex/snipcart/install/sql/install.sql
  33. 5 1
      modules/boonex/snipcart/install/sql/uninstall.sql
  34. 1 0
      modules/boonex/videos/classes/BxVideosConfig.php
  35. 27 0
      modules/boonex/videos/install/sql/install.sql
  36. 5 1
      modules/boonex/videos/install/sql/uninstall.sql

+ 5 - 0
modules/base/general/classes/BxBaseModGeneralFormEntry.php

@@ -174,6 +174,11 @@ class BxBaseModGeneralFormEntry extends BxTemplFormView
             if ($o) $o->onObjectDelete();
         }
 
+        if (!empty($CNF['OBJECT_SCORES'])) {
+            $o = BxDolScore::getObjectInstance($CNF['OBJECT_SCORES'], $iContentId);
+            if ($o) $o->onObjectDelete();
+        }
+
         if (!empty($CNF['OBJECT_COMMENTS'])) {
             $o = BxDolCmts::getObjectInstance($CNF['OBJECT_COMMENTS'], $iContentId);
             if ($o) $o->onObjectDelete();

+ 5 - 5
modules/base/general/classes/BxBaseModGeneralModule.php

@@ -1253,31 +1253,31 @@ class BxBaseModGeneralModule extends BxDolModule
         //--- Views
         $sViews = '';
         $oViews = !empty($aParams['object_view']) ? BxDolView::getObjectInstance($aParams['object_view'], $iId) : false;
-        if ($oViews)
+        if ($oViews && $oViews->isEnabled())
             $sViews = $oViews->getElementBlock(array('show_do_view_as_button' => $bShowAsButton));
 
         //--- Votes
         $sVotes = '';
         $oVotes = !empty($aParams['object_vote']) ? BxDolVote::getObjectInstance($aParams['object_vote'], $iId) : false;
-        if ($oVotes)
+        if ($oVotes && $oVotes->isEnabled())
             $sVotes = $oVotes->getElementBlock(array('show_do_vote_as_button' => $bShowAsButton));
 
         //--- Scores
         $sScores = '';
         $oScores = !empty($aParams['object_score']) ? BxDolScore::getObjectInstance($aParams['object_score'], $iId) : false;
-        if ($oScores)
+        if ($oScores && $oScores->isEnabled())
             $sScores = $oScores->getElementBlock(array('show_do_vote_as_button' => $bShowAsButton));
 
         //--- Favorite
         $sFavorites = '';
         $oFavorites = !empty($aParams['object_favorite']) ? BxDolFavorite::getObjectInstance($aParams['object_favorite'], $iId) : false;
-        if ($oFavorites)
+        if ($oFavorites && $oFavorites->isEnabled())
             $sFavorites = $oFavorites->getElementBlock(array('show_do_favorite_as_button' => $bShowAsButton));
 
         //--- Featured
         $sFeatured = '';
         $oFeatured = !empty($aParams['object_feature']) ? BxDolFeature::getObjectInstance($aParams['object_feature'], $iId) : false;
-        if ($oFeatured)
+        if ($oFeatured && $oFeatured->isEnabled())
             $sFeatured = $oFeatured->getElementBlock(array('show_do_feature_as_button' => $bShowAsButton));
 
         //--- Timeline Repost

+ 2 - 0
modules/boonex/albums/classes/BxAlbumsConfig.php

@@ -87,6 +87,8 @@ class BxAlbumsConfig extends BxBaseModTextConfig
             'OBJECT_VIEWS_MEDIA' => 'bx_albums_media',
             'OBJECT_VOTES' => 'bx_albums',
             'OBJECT_VOTES_MEDIA' => 'bx_albums_media',
+        	'OBJECT_SCORES' => 'bx_albums',
+        	'OBJECT_SCORES_MEDIA' => 'bx_albums_media',
         	'OBJECT_FAVORITES' => 'bx_albums',
             'OBJECT_FAVORITES_MEDIA' => 'bx_albums_media',
         	'OBJECT_FEATURED' => 'bx_albums',

+ 6 - 0
modules/boonex/albums/classes/BxAlbumsModule.php

@@ -58,6 +58,11 @@ class BxAlbumsModule extends BxBaseModTextModule
             if ($o) $o->onObjectDelete();
         }
 
+        if (!empty($CNF['OBJECT_SCORES_MEDIA'])) {
+            $o = BxDolScore::getObjectInstance($CNF['OBJECT_SCORES_MEDIA'], $aMediaInfo['id']);
+            if ($o) $o->onObjectDelete();
+        }
+
         if (!empty($CNF['OBJECT_COMMENTS_MEDIA'])) {
             $o = BxDolCmts::getObjectInstance($CNF['OBJECT_COMMENTS_MEDIA'], $aMediaInfo['id']);
             if ($o) $o->onObjectDelete();
@@ -130,6 +135,7 @@ class BxAlbumsModule extends BxBaseModTextModule
         	'object_storage' => false,
             'object_transcoder' => $CNF['OBJECT_IMAGES_TRANSCODER_BIG'],
         	'object_vote' => $CNF['OBJECT_VOTES_MEDIA'],
+        	'object_score' => $CNF['OBJECT_SCORES_MEDIA'],
         	'object_favorite' => $CNF['OBJECT_FAVORITES_MEDIA'],
         	'object_report' => '',
         	'object_comments' => $bEnableCommentsBtn ? $CNF['OBJECT_COMMENTS_MEDIA'] : '',

+ 49 - 0
modules/boonex/albums/install/sql/install.sql

@@ -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', '', '');

+ 5 - 1
modules/boonex/albums/install/sql/uninstall.sql

@@ -1,6 +1,6 @@
 
 -- TABLES
-DROP TABLE IF EXISTS `bx_albums_albums`, `bx_albums_files`, `bx_albums_photos_resized`, `bx_albums_files2albums`, `bx_albums_cmts`, `bx_albums_cmts_media`, `bx_albums_votes`, `bx_albums_votes_track`, `bx_albums_votes_media`, `bx_albums_votes_media_track`, `bx_albums_views_track`, `bx_albums_views_media_track`, `bx_albums_meta_keywords`, `bx_albums_meta_keywords_media`, `bx_albums_meta_keywords_media_camera`, `bx_albums_meta_locations`, `bx_albums_meta_mentions`, `bx_albums_reports`, `bx_albums_reports_track`, `bx_albums_favorites_track`, `bx_albums_favorites_media_track`;
+DROP TABLE IF EXISTS `bx_albums_albums`, `bx_albums_files`, `bx_albums_photos_resized`, `bx_albums_files2albums`, `bx_albums_cmts`, `bx_albums_cmts_media`, `bx_albums_votes`, `bx_albums_votes_track`, `bx_albums_votes_media`, `bx_albums_votes_media_track`, `bx_albums_views_track`, `bx_albums_views_media_track`, `bx_albums_meta_keywords`, `bx_albums_meta_keywords_media`, `bx_albums_meta_keywords_media_camera`, `bx_albums_meta_locations`, `bx_albums_meta_mentions`, `bx_albums_reports`, `bx_albums_reports_track`, `bx_albums_favorites_track`, `bx_albums_favorites_media_track`, `bx_albums_scores`, `bx_albums_scores_track`, `bx_albums_scores_media`, `bx_albums_scores_media_track`;
 
 
 -- STORAGES & TRANSCODERS
@@ -28,6 +28,10 @@ DELETE FROM `sys_objects_cmts` WHERE `Name` = 'bx_albums' OR `Name` = 'bx_albums
 DELETE FROM `sys_objects_vote` WHERE `Name` = 'bx_albums' OR `Name` = 'bx_albums_media';
 
 
+-- SCORES
+DELETE FROM `sys_objects_score` WHERE `Name` = 'bx_albums' OR `Name` = 'bx_albums_media';
+
+
 -- REPORTS
 DELETE FROM `sys_objects_report` WHERE `name` = 'bx_albums';
 

+ 1 - 0
modules/boonex/files/classes/BxFilesConfig.php

@@ -79,6 +79,7 @@ class BxFilesConfig extends BxBaseModTextConfig
         	'OBJECT_REPORTS' => 'bx_files',
             'OBJECT_VIEWS' => 'bx_files',
             'OBJECT_VOTES' => 'bx_files',
+        	'OBJECT_SCORES' => 'bx_files',
         	'OBJECT_FAVORITES' => 'bx_files',
         	'OBJECT_FEATURED' => 'bx_files',
             'OBJECT_METATAGS' => 'bx_files',

+ 25 - 0
modules/boonex/files/install/sql/install.sql

@@ -16,6 +16,9 @@ CREATE TABLE IF NOT EXISTS `bx_files_main` (
   `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',
@@ -149,6 +152,24 @@ CREATE TABLE `bx_files_favorites_track` (
   KEY `id` (`object_id`,`author_id`)
 );
 
+-- TABLE: scores
+CREATE TABLE IF NOT EXISTS `bx_files_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_files_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`)
+);
 
 -- 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
@@ -255,6 +276,10 @@ INSERT INTO `sys_objects_cmts` (`Name`, `Module`, `Table`, `CharsPostMin`, `Char
 INSERT INTO `sys_objects_vote` (`Name`, `TableMain`, `TableTrack`, `PostTimeout`, `MinValue`, `MaxValue`, `IsUndo`, `IsOn`, `TriggerTable`, `TriggerFieldId`, `TriggerFieldAuthor`, `TriggerFieldRate`, `TriggerFieldRateCount`, `ClassName`, `ClassFile`) VALUES 
 ('bx_files', 'bx_files_votes', 'bx_files_votes_track', '604800', '1', '1', '0', '1', 'bx_files_main', '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_files', 'bx_files', 'bx_files_scores', 'bx_files_scores_track', '604800', '0', 'bx_files_main', '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_files', 'bx_files_reports', 'bx_files_reports_track', '1', 'page.php?i=view-file&id={object_id}', 'bx_files_main', 'id', 'author', 'reports', '', '');

+ 4 - 1
modules/boonex/files/install/sql/uninstall.sql

@@ -1,6 +1,6 @@
 
 -- TABLES
-DROP TABLE IF EXISTS `bx_files_main`, `bx_files_files`, `bx_files_photos_resized`, `bx_files_cmts`, `bx_files_votes`, `bx_files_votes_track`, `bx_files_views_track`, `bx_files_meta_keywords`, `bx_files_meta_mentions`, `bx_files_reports`, `bx_files_reports_track`, `bx_files_favorites_track`;
+DROP TABLE IF EXISTS `bx_files_main`, `bx_files_files`, `bx_files_photos_resized`, `bx_files_cmts`, `bx_files_votes`, `bx_files_votes_track`, `bx_files_views_track`, `bx_files_meta_keywords`, `bx_files_meta_mentions`, `bx_files_reports`, `bx_files_reports_track`, `bx_files_favorites_track`, `bx_files_scores`, `bx_files_scores_track`;
 
 -- STORAGES & TRANSCODERS
 DELETE FROM `sys_objects_storage` WHERE `object` = 'bx_files_files' OR `object` = 'bx_files_photos_resized';
@@ -27,6 +27,9 @@ DELETE FROM `sys_objects_cmts` WHERE `Name` = 'bx_files';
 -- VOTES
 DELETE FROM `sys_objects_vote` WHERE `Name` = 'bx_files';
 
+-- SCORES
+DELETE FROM `sys_objects_score` WHERE `name` = 'bx_files';
+
 -- REPORTS
 DELETE FROM `sys_objects_report` WHERE `name` = 'bx_files';
 

+ 1 - 0
modules/boonex/forum/classes/BxForumConfig.php

@@ -99,6 +99,7 @@ class BxForumConfig extends BxBaseModTextConfig
             'OBJECT_VIDEOS_TRANSCODERS' => array(),
             'OBJECT_VIEWS' => 'bx_forum',
             'OBJECT_VOTES' => 'bx_forum',
+        	'OBJECT_SCORES' => 'bx_forum',
         	'OBJECT_FAVORITES' => 'bx_forum',
         	'OBJECT_FEATURED' => 'bx_forum',
         	'OBJECT_CATEGORY' => 'bx_forum_cats',

+ 4 - 0
modules/boonex/forum/install/sql/disable.sql

@@ -63,6 +63,10 @@ DELETE FROM `sys_objects_view` WHERE `Name` = @sName;
 DELETE FROM `sys_objects_vote` WHERE `Name` = @sName;
 
 
+-- SCORES
+DELETE FROM `sys_objects_score` WHERE `name` = @sName;
+
+
 -- FAFORITES
 DELETE FROM `sys_objects_favorite` WHERE `Name` = @sName;
 

+ 5 - 0
modules/boonex/forum/install/sql/enable.sql

@@ -471,6 +471,11 @@ INSERT INTO `sys_objects_vote` (`Name`, `TableMain`, `TableTrack`, `PostTimeout`
 (@sName, 'bx_forum_votes', 'bx_forum_votes_track', '604800', '1', '1', '0', '1', 'bx_forum_discussions', '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 
+(@sName, @sName, 'bx_forum_scores', 'bx_forum_scores_track', '604800', '0', 'bx_forum_discussions', 'id', 'author', 'score', 'sc_up', 'sc_down', '', '');
+
+
 -- FAFORITES
 INSERT INTO `sys_objects_favorite` (`name`, `table_track`, `is_on`, `is_undo`, `is_public`, `base_url`, `trigger_table`, `trigger_field_id`, `trigger_field_author`, `trigger_field_count`, `class_name`, `class_file`) VALUES 
 (@sName, 'bx_forum_favorites_track', '1', '1', '1', 'page.php?i=view-discussion&id={object_id}', 'bx_forum_discussions', 'id', 'author', 'favorites', '', '');

+ 22 - 0
modules/boonex/forum/install/sql/install.sql

@@ -18,6 +18,9 @@ CREATE TABLE IF NOT EXISTS `bx_forum_discussions` (
   `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',
@@ -171,6 +174,25 @@ CREATE TABLE `bx_forum_favorites_track` (
   KEY `id` (`object_id`,`author_id`)
 );
 
+-- TABLE: scores
+CREATE TABLE IF NOT EXISTS `bx_forum_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_forum_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`)
+);
+
 
 -- 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

+ 1 - 1
modules/boonex/forum/install/sql/uninstall.sql

@@ -2,7 +2,7 @@ SET @sName = 'bx_forum';
 
 
 -- TABLES: entries
-DROP TABLE IF EXISTS `bx_forum_discussions`, `bx_forum_categories`, `bx_forum_files`, `bx_forum_photos_resized`, `bx_forum_subscribers`, `bx_forum_cmts`, `bx_forum_views_track`, `bx_forum_votes`, `bx_forum_votes_track`, `bx_forum_meta_keywords`, `bx_forum_meta_mentions`, `bx_forum_reports`, `bx_forum_reports_track`, `bx_forum_favorites_track`;
+DROP TABLE IF EXISTS `bx_forum_discussions`, `bx_forum_categories`, `bx_forum_files`, `bx_forum_photos_resized`, `bx_forum_subscribers`, `bx_forum_cmts`, `bx_forum_views_track`, `bx_forum_votes`, `bx_forum_votes_track`, `bx_forum_meta_keywords`, `bx_forum_meta_mentions`, `bx_forum_reports`, `bx_forum_reports_track`, `bx_forum_favorites_track`, `bx_forum_scores`, `bx_forum_scores_track`;
 
 
 -- STORAGES & TRANSCODERS

+ 1 - 0
modules/boonex/glossary/classes/BxGlsrConfig.php

@@ -78,6 +78,7 @@ class BxGlsrConfig extends BxBaseModTextConfig
             'OBJECT_REPORTS' => 'bx_glossary',
             'OBJECT_VIEWS' => 'bx_glossary',
             'OBJECT_VOTES' => 'bx_glossary',
+        	'OBJECT_SCORES' => 'bx_glossary',
             'OBJECT_FAVORITES' => 'bx_glossary',
             'OBJECT_FEATURED' => 'bx_glossary',
             'OBJECT_METATAGS' => 'bx_glossary',

+ 26 - 0
modules/boonex/glossary/install/sql/install.sql

@@ -14,6 +14,9 @@ CREATE TABLE IF NOT EXISTS `bx_glossary_terms` (
   `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',
@@ -147,6 +150,25 @@ CREATE TABLE `bx_glossary_favorites_track` (
   KEY `id` (`object_id`,`author_id`)
 );
 
+-- TABLE: scores
+CREATE TABLE IF NOT EXISTS `bx_glossary_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_glossary_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`)
+);
+
 
 -- 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
@@ -251,6 +273,10 @@ INSERT INTO `sys_objects_cmts` (`Name`, `Module`, `Table`, `CharsPostMin`, `Char
 INSERT INTO `sys_objects_vote` (`Name`, `TableMain`, `TableTrack`, `PostTimeout`, `MinValue`, `MaxValue`, `IsUndo`, `IsOn`, `TriggerTable`, `TriggerFieldId`, `TriggerFieldAuthor`, `TriggerFieldRate`, `TriggerFieldRateCount`, `ClassName`, `ClassFile`) VALUES 
 ('bx_glossary', 'bx_glossary_votes', 'bx_glossary_votes_track', '604800', '1', '1', '0', '1', 'bx_glossary_terms', '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_glossary', 'bx_glossary', 'bx_glossary_scores', 'bx_glossary_scores_track', '604800', '0', 'bx_glossary_terms', '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_glossary', 'bx_glossary_reports', 'bx_glossary_reports_track', '1', 'page.php?i=view-glossary&id={object_id}', 'bx_glossary_terms', 'id', 'author', 'reports', '', '');

+ 4 - 1
modules/boonex/glossary/install/sql/uninstall.sql

@@ -1,6 +1,6 @@
 
 -- TABLES
-DROP TABLE IF EXISTS `bx_glossary_terms`, `bx_glossary_files`, `bx_glossary_photos_resized`, `bx_glossary_cmts`, `bx_glossary_votes`, `bx_glossary_votes_track`, `bx_glossary_views_track`, `bx_glossary_meta_keywords`, `bx_glossary_meta_mentions`, `bx_glossary_reports`, `bx_glossary_reports_track`, `bx_glossary_favorites_track`;
+DROP TABLE IF EXISTS `bx_glossary_terms`, `bx_glossary_files`, `bx_glossary_photos_resized`, `bx_glossary_cmts`, `bx_glossary_votes`, `bx_glossary_votes_track`, `bx_glossary_views_track`, `bx_glossary_meta_keywords`, `bx_glossary_meta_mentions`, `bx_glossary_reports`, `bx_glossary_reports_track`, `bx_glossary_favorites_track`, `bx_glossary_scores`, `bx_glossary_scores_track`;
 
 -- STORAGES & TRANSCODERS
 DELETE FROM `sys_objects_storage` WHERE `object` = 'bx_glossary_files' OR `object` = 'bx_glossary_photos_resized';
@@ -27,6 +27,9 @@ DELETE FROM `sys_objects_cmts` WHERE `Name` = 'bx_glossary';
 -- VOTES
 DELETE FROM `sys_objects_vote` WHERE `Name` = 'bx_glossary';
 
+-- SCORES
+DELETE FROM `sys_objects_score` WHERE `name` = 'bx_glossary';
+
 -- REPORTS
 DELETE FROM `sys_objects_report` WHERE `name` = 'bx_glossary';
 

+ 1 - 0
modules/boonex/market/classes/BxMarketConfig.php

@@ -117,6 +117,7 @@ class BxMarketConfig extends BxBaseModTextConfig
         	'OBJECT_REPORTS' => 'bx_market',
             'OBJECT_VIEWS' => 'bx_market',
             'OBJECT_VOTES' => 'bx_market',
+        	'OBJECT_SCORES' => 'bx_market',
         	'OBJECT_FAVORITES' => 'bx_market',
             'OBJECT_FEATURED' => 'bx_market',
             'OBJECT_METATAGS' => 'bx_market',

+ 40 - 0
modules/boonex/market/classes/BxMarketScore.php

@@ -0,0 +1,40 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Market Market
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+class BxMarketScore extends BxTemplScore
+{
+	protected $MODULE;
+	protected $_oModule;
+
+    function __construct($sSystem, $iId, $iInit = 1)
+    {
+    	$this->MODULE = 'bx_market';
+    	$this->_oModule = BxDolModule::getInstance($this->MODULE);
+
+        parent::__construct($sSystem, $iId, $iInit);        
+    }
+
+    public function isAllowedVote($isPerformAction = false)
+    {
+    	$CNF = &$this->_oModule->_oConfig->CNF;
+
+    	if($this->getObjectAuthorId() == $this->_getAuthorId())
+    		return false;
+
+    	$oPrivacy = BxDolPrivacy::getObjectInstance($CNF['OBJECT_PRIVACY_VOTE']);
+		if($oPrivacy && !$oPrivacy->check($this->_iId))
+			return false;
+
+    	return parent::isAllowedVote($isPerformAction);
+    }
+}
+
+/** @} */

+ 26 - 0
modules/boonex/market/install/sql/install.sql

@@ -22,6 +22,9 @@ CREATE TABLE IF NOT EXISTS `bx_market_products` (
   `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',
@@ -271,6 +274,25 @@ CREATE TABLE `bx_market_favorites_track` (
   KEY `id` (`object_id`,`author_id`)
 );
 
+-- TABLE: scores
+CREATE TABLE IF NOT EXISTS `bx_market_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_market_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`)
+);
+
 
 -- 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
@@ -473,6 +495,10 @@ INSERT INTO `sys_objects_cmts` (`Name`, `Module`, `Table`, `CharsPostMin`, `Char
 INSERT INTO `sys_objects_vote` (`Name`, `TableMain`, `TableTrack`, `PostTimeout`, `MinValue`, `MaxValue`, `IsUndo`, `IsOn`, `TriggerTable`, `TriggerFieldId`, `TriggerFieldAuthor`, `TriggerFieldRate`, `TriggerFieldRateCount`, `ClassName`, `ClassFile`) VALUES 
 ('bx_market', 'bx_market_votes', 'bx_market_votes_track', '604800', '1', '5', '0', '1', 'bx_market_products', 'id', 'author', 'rate', 'votes', 'BxMarketVote', 'modules/boonex/market/classes/BxMarketVote.php');
 
+-- 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_market', 'bx_market', 'bx_market_scores', 'bx_market_scores_track', '604800', '0', 'bx_market_products', 'id', 'author', 'score', 'sc_up', 'sc_down', 'BxMarketScore', 'modules/boonex/market/classes/BxMarketScore.php');
+
 -- 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_market', 'bx_market_reports', 'bx_market_reports_track', '1', 'page.php?i=view-product&id={object_id}', 'bx_market_products', 'id', 'author', 'reports', '', '');

+ 4 - 1
modules/boonex/market/install/sql/uninstall.sql

@@ -1,6 +1,6 @@
 
 -- TABLES
-DROP TABLE IF EXISTS `bx_market_products`, `bx_market_subproducts`, `bx_market_licenses`, `bx_market_licenses_deleted`, `bx_market_files`, `bx_market_files2products`, `bx_market_downloads_track`, `bx_market_photos`, `bx_market_photos2products`, `bx_market_photos_resized`, `bx_market_cmts`, `bx_market_votes`, `bx_market_votes_track`, `bx_market_views_track`, `bx_market_meta_keywords`, `bx_market_meta_locations`, `bx_market_meta_mentions`, `bx_market_reports`, `bx_market_reports_track`, `bx_market_favorites_track`;
+DROP TABLE IF EXISTS `bx_market_products`, `bx_market_subproducts`, `bx_market_licenses`, `bx_market_licenses_deleted`, `bx_market_files`, `bx_market_files2products`, `bx_market_downloads_track`, `bx_market_photos`, `bx_market_photos2products`, `bx_market_photos_resized`, `bx_market_cmts`, `bx_market_votes`, `bx_market_votes_track`, `bx_market_views_track`, `bx_market_meta_keywords`, `bx_market_meta_locations`, `bx_market_meta_mentions`, `bx_market_reports`, `bx_market_reports_track`, `bx_market_favorites_track`, `bx_market_scores`, `bx_market_scores_track`;
 
 -- STORAGES & TRANSCODERS
 DELETE FROM `sys_objects_storage` WHERE `object` IN('bx_market_files', 'bx_market_photos', 'bx_market_photos_resized');
@@ -27,6 +27,9 @@ DELETE FROM `sys_objects_cmts` WHERE `Name` = 'bx_market';
 -- VOTES
 DELETE FROM `sys_objects_vote` WHERE `Name` = 'bx_market';
 
+-- SCORES
+DELETE FROM `sys_objects_score` WHERE `name` = 'bx_market';
+
 -- REPORTS
 DELETE FROM `sys_objects_report` WHERE `name` = 'bx_market';
 

+ 1 - 0
modules/boonex/photos/classes/BxPhotosConfig.php

@@ -82,6 +82,7 @@ class BxPhotosConfig extends BxBaseModTextConfig
             'OBJECT_VIEWS' => 'bx_photos',
             'OBJECT_VOTES' => 'bx_photos',
             'OBJECT_VOTES_STARS' => 'bx_photos_stars',
+        	'OBJECT_SCORES' => 'bx_photos',
         	'OBJECT_FAVORITES' => 'bx_photos',
             'OBJECT_FEATURED' => 'bx_photos',
             'OBJECT_METATAGS' => 'bx_photos',

+ 27 - 0
modules/boonex/photos/install/sql/install.sql

@@ -16,6 +16,9 @@ CREATE TABLE IF NOT EXISTS `bx_photos_entries` (
   `votes` int(11) NOT NULL default '0',
   `srate` float NOT NULL default '0',
   `svotes` 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',
@@ -181,6 +184,25 @@ CREATE TABLE `bx_photos_favorites_track` (
   KEY `id` (`object_id`,`author_id`)
 );
 
+-- TABLE: scores
+CREATE TABLE IF NOT EXISTS `bx_photos_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_photos_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`)
+);
+
 
 -- 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
@@ -278,6 +300,11 @@ INSERT INTO `sys_objects_vote` (`Name`, `TableMain`, `TableTrack`, `PostTimeout`
 ('bx_photos_stars', 'bx_photos_svotes', 'bx_photos_svotes_track', '604800', '1', '5', '0', '1', 'bx_photos_entries', 'id', 'author', 'srate', 'svotes', '', '');
 
 
+-- 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_photos', 'bx_photos', 'bx_photos_scores', 'bx_photos_scores_track', '604800', '0', 'bx_photos_entries', '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_photos', 'bx_photos_reports', 'bx_photos_reports_track', '1', 'page.php?i=view-photo&id={object_id}', 'bx_photos_entries', 'id', 'author', 'reports', '', '');

+ 5 - 1
modules/boonex/photos/install/sql/uninstall.sql

@@ -1,6 +1,6 @@
 
 -- TABLES
-DROP TABLE IF EXISTS `bx_photos_entries`, `bx_photos_photos`, `bx_photos_media_resized`, `bx_photos_cmts`, `bx_photos_votes`, `bx_photos_votes_track`, `bx_photos_svotes`, `bx_photos_svotes_track`, `bx_photos_views_track`, `bx_photos_meta_keywords`, `bx_photos_meta_locations`, `bx_photos_meta_mentions`, `bx_photos_reports`, `bx_photos_reports_track`, `bx_photos_favorites_track`;
+DROP TABLE IF EXISTS `bx_photos_entries`, `bx_photos_photos`, `bx_photos_media_resized`, `bx_photos_cmts`, `bx_photos_votes`, `bx_photos_votes_track`, `bx_photos_svotes`, `bx_photos_svotes_track`, `bx_photos_views_track`, `bx_photos_meta_keywords`, `bx_photos_meta_locations`, `bx_photos_meta_mentions`, `bx_photos_reports`, `bx_photos_reports_track`, `bx_photos_favorites_track`, `bx_photos_scores`, `bx_photos_scores_track`;
 
 
 -- STORAGES & TRANSCODERS
@@ -33,6 +33,10 @@ DELETE FROM `sys_objects_cmts` WHERE `Name` = 'bx_photos';
 DELETE FROM `sys_objects_vote` WHERE `Name` IN ('bx_photos', 'bx_photos_stars');
 
 
+-- SCORES
+DELETE FROM `sys_objects_score` WHERE `name` = 'bx_photos';
+
+
 -- REPORTS
 DELETE FROM `sys_objects_report` WHERE `name` = 'bx_photos';
 

+ 1 - 0
modules/boonex/polls/classes/BxPollsConfig.php

@@ -84,6 +84,7 @@ class BxPollsConfig extends BxBaseModTextConfig
             'OBJECT_VIEWS' => 'bx_polls',
             'OBJECT_VOTES' => 'bx_polls',
         	'OBJECT_VOTES_SUBENTRIES' => 'bx_polls_subentries',
+        	'OBJECT_SCORES' => 'bx_polls',
         	'OBJECT_FAVORITES' => 'bx_polls',
         	'OBJECT_FEATURED' => 'bx_polls',
             'OBJECT_METATAGS' => 'bx_polls',

+ 27 - 0
modules/boonex/polls/install/sql/install.sql

@@ -13,6 +13,9 @@ CREATE TABLE IF NOT EXISTS `bx_polls_entries` (
   `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',
@@ -191,6 +194,25 @@ CREATE TABLE `bx_polls_favorites_track` (
   KEY `id` (`object_id`,`author_id`)
 );
 
+-- TABLE: scores
+CREATE TABLE IF NOT EXISTS `bx_polls_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_polls_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`)
+);
+
 
 -- 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
@@ -301,6 +323,11 @@ INSERT INTO `sys_objects_vote` (`Name`, `TableMain`, `TableTrack`, `PostTimeout`
 ('bx_polls_subentries', 'bx_polls_votes_subentries', 'bx_polls_votes_subentries_track', '604800', '1', '1', '0', '1', 'bx_polls_subentries', 'id', 'author', 'rate', 'votes', 'BxPollsVoteSubentries', 'modules/boonex/polls/classes/BxPollsVoteSubentries.php');
 
 
+-- 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_polls', 'bx_polls', 'bx_polls_scores', 'bx_polls_scores_track', '604800', '0', 'bx_polls_entries', '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_polls', 'bx_polls_reports', 'bx_polls_reports_track', '1', 'page.php?i=view-poll&id={object_id}', 'bx_polls_entries', 'id', 'author', 'reports', '', '');

+ 5 - 1
modules/boonex/polls/install/sql/uninstall.sql

@@ -1,6 +1,6 @@
 
 -- TABLES
-DROP TABLE IF EXISTS `bx_polls_entries`, `bx_polls_subentries`, `bx_polls_files`, `bx_polls_photos_resized`, `bx_polls_cmts`, `bx_polls_votes`, `bx_polls_votes_track`, `bx_polls_votes_subentries`, `bx_polls_votes_subentries_track`, `bx_polls_views_track`, `bx_polls_meta_keywords`, `bx_polls_meta_locations`, `bx_polls_meta_mentions`, `bx_polls_reports`, `bx_polls_reports_track`, `bx_polls_favorites_track`;
+DROP TABLE IF EXISTS `bx_polls_entries`, `bx_polls_subentries`, `bx_polls_files`, `bx_polls_photos_resized`, `bx_polls_cmts`, `bx_polls_votes`, `bx_polls_votes_track`, `bx_polls_votes_subentries`, `bx_polls_votes_subentries_track`, `bx_polls_views_track`, `bx_polls_meta_keywords`, `bx_polls_meta_locations`, `bx_polls_meta_mentions`, `bx_polls_reports`, `bx_polls_reports_track`, `bx_polls_favorites_track`, `bx_polls_scores`, `bx_polls_scores_track`;
 
 
 -- STORAGES & TRANSCODERS
@@ -32,6 +32,10 @@ DELETE FROM `sys_objects_cmts` WHERE `Name` = 'bx_polls';
 DELETE FROM `sys_objects_vote` WHERE `Name` IN ('bx_polls', 'bx_polls_subentries');
 
 
+-- SCORES
+DELETE FROM `sys_objects_score` WHERE `name` = 'bx_polls';
+
+
 -- REPORTS
 DELETE FROM `sys_objects_report` WHERE `name` = 'bx_polls';
 

+ 1 - 0
modules/boonex/shopify/classes/BxShopifyConfig.php

@@ -81,6 +81,7 @@ class BxShopifyConfig extends BxBaseModTextConfig
         	'OBJECT_REPORTS' => 'bx_shopify',
             'OBJECT_VIEWS' => 'bx_shopify',
             'OBJECT_VOTES' => 'bx_shopify',
+        	'OBJECT_SCORES' => 'bx_shopify',
         	'OBJECT_FAVORITES' => 'bx_shopify',
             'OBJECT_FEATURED' => 'bx_shopify',
             'OBJECT_METATAGS' => 'bx_shopify',

+ 27 - 0
modules/boonex/shopify/install/sql/install.sql

@@ -13,6 +13,9 @@ CREATE TABLE IF NOT EXISTS `bx_shopify_entries` (
   `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',
@@ -138,6 +141,25 @@ CREATE TABLE IF NOT EXISTS `bx_shopify_favorites_track` (
   KEY `id` (`object_id`,`author_id`)
 );
 
+-- TABLE: scores
+CREATE TABLE IF NOT EXISTS `bx_shopify_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_shopify_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`)
+);
+
 
 -- FORMS
 INSERT INTO `sys_objects_form`(`object`, `module`, `title`, `action`, `form_attrs`, `table`, `key`, `uri`, `uri_title`, `submit_name`, `params`, `deletable`, `active`, `override_class_name`, `override_class_file`) VALUES 
@@ -230,6 +252,11 @@ INSERT INTO `sys_objects_vote` (`Name`, `TableMain`, `TableTrack`, `PostTimeout`
 ('bx_shopify', 'bx_shopify_votes', 'bx_shopify_votes_track', '604800', '1', '1', '0', '1', 'bx_shopify_entries', '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_shopify', 'bx_shopify', 'bx_shopify_scores', 'bx_shopify_scores_track', '604800', '0', 'bx_shopify_entries', '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_shopify', 'bx_shopify_reports', 'bx_shopify_reports_track', '1', 'page.php?i=view-shopify-entry&id={object_id}', 'bx_shopify_entries', 'id', 'author', 'reports', '', '');

+ 5 - 1
modules/boonex/shopify/install/sql/uninstall.sql

@@ -1,6 +1,6 @@
 
 -- TABLES
-DROP TABLE IF EXISTS `bx_shopify_entries`, `bx_shopify_settings`, `bx_shopify_cmts`, `bx_shopify_votes`, `bx_shopify_votes_track`, `bx_shopify_views_track`, `bx_shopify_meta_keywords`, `bx_shopify_meta_locations`, `bx_shopify_meta_mentions`, `bx_shopify_reports`, `bx_shopify_reports_track`, `bx_shopify_favorites_track`;
+DROP TABLE IF EXISTS `bx_shopify_entries`, `bx_shopify_settings`, `bx_shopify_cmts`, `bx_shopify_votes`, `bx_shopify_votes_track`, `bx_shopify_views_track`, `bx_shopify_meta_keywords`, `bx_shopify_meta_locations`, `bx_shopify_meta_mentions`, `bx_shopify_reports`, `bx_shopify_reports_track`, `bx_shopify_favorites_track`, `bx_shopify_scores`, `bx_shopify_scores_track`;
 
 
 -- FORMS
@@ -23,6 +23,10 @@ DELETE FROM `sys_objects_cmts` WHERE `Name` = 'bx_shopify';
 DELETE FROM `sys_objects_vote` WHERE `Name` = 'bx_shopify';
 
 
+-- SCORES
+DELETE FROM `sys_objects_score` WHERE `name` = 'bx_shopify';
+
+
 -- REPORTS
 DELETE FROM `sys_objects_report` WHERE `name` = 'bx_shopify';
 

+ 1 - 0
modules/boonex/snipcart/classes/BxSnipcartConfig.php

@@ -81,6 +81,7 @@ class BxSnipcartConfig extends BxBaseModTextConfig
         	'OBJECT_REPORTS' => 'bx_snipcart',
             'OBJECT_VIEWS' => 'bx_snipcart',
             'OBJECT_VOTES' => 'bx_snipcart',
+        	'OBJECT_SCORES' => 'bx_snipcart',
         	'OBJECT_FAVORITES' => 'bx_snipcart',
             'OBJECT_FEATURED' => 'bx_snipcart',
             'OBJECT_METATAGS' => 'bx_snipcart',

+ 27 - 0
modules/boonex/snipcart/install/sql/install.sql

@@ -16,6 +16,9 @@ CREATE TABLE IF NOT EXISTS `bx_snipcart_entries` (
   `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',
@@ -175,6 +178,25 @@ CREATE TABLE IF NOT EXISTS `bx_snipcart_favorites_track` (
   KEY `id` (`object_id`,`author_id`)
 );
 
+-- TABLE: scores
+CREATE TABLE IF NOT EXISTS `bx_snipcart_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_snipcart_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`)
+);
+
 
 -- 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
@@ -307,6 +329,11 @@ INSERT INTO `sys_objects_vote` (`Name`, `TableMain`, `TableTrack`, `PostTimeout`
 ('bx_snipcart', 'bx_snipcart_votes', 'bx_snipcart_votes_track', '604800', '1', '1', '0', '1', 'bx_snipcart_entries', '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_snipcart', 'bx_snipcart', 'bx_snipcart_scores', 'bx_snipcart_scores_track', '604800', '0', 'bx_snipcart_entries', '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_snipcart', 'bx_snipcart_reports', 'bx_snipcart_reports_track', '1', 'page.php?i=view-snipcart-entry&id={object_id}', 'bx_snipcart_entries', 'id', 'author', 'reports', '', '');

+ 5 - 1
modules/boonex/snipcart/install/sql/uninstall.sql

@@ -1,6 +1,6 @@
 
 -- TABLES
-DROP TABLE IF EXISTS `bx_snipcart_entries`, `bx_snipcart_settings`, `bx_snipcart_files`, `bx_snipcart_photos_resized`, `bx_snipcart_cmts`, `bx_snipcart_votes`, `bx_snipcart_votes_track`, `bx_snipcart_views_track`, `bx_snipcart_meta_keywords`, `bx_snipcart_meta_locations`, `bx_snipcart_meta_mentions`, `bx_snipcart_reports`, `bx_snipcart_reports_track`, `bx_snipcart_favorites_track`;
+DROP TABLE IF EXISTS `bx_snipcart_entries`, `bx_snipcart_settings`, `bx_snipcart_files`, `bx_snipcart_photos_resized`, `bx_snipcart_cmts`, `bx_snipcart_votes`, `bx_snipcart_votes_track`, `bx_snipcart_views_track`, `bx_snipcart_meta_keywords`, `bx_snipcart_meta_locations`, `bx_snipcart_meta_mentions`, `bx_snipcart_reports`, `bx_snipcart_reports_track`, `bx_snipcart_favorites_track`, `bx_snipcart_scores`, `bx_snipcart_scores_track`;
 
 
 -- STORAGES & TRANSCODERS
@@ -32,6 +32,10 @@ DELETE FROM `sys_objects_cmts` WHERE `Name` = 'bx_snipcart';
 DELETE FROM `sys_objects_vote` WHERE `Name` = 'bx_snipcart';
 
 
+-- SCORES
+DELETE FROM `sys_objects_score` WHERE `name` = 'bx_snipcart';
+
+
 -- REPORTS
 DELETE FROM `sys_objects_report` WHERE `name` = 'bx_snipcart';
 

+ 1 - 0
modules/boonex/videos/classes/BxVideosConfig.php

@@ -91,6 +91,7 @@ class BxVideosConfig extends BxBaseModTextConfig
             'OBJECT_VIEWS' => 'bx_videos',
             'OBJECT_VOTES' => 'bx_videos',
             'OBJECT_VOTES_STARS' => 'bx_videos_stars',
+            'OBJECT_SCORES' => 'bx_videos',
         	'OBJECT_FAVORITES' => 'bx_videos',
             'OBJECT_FEATURED' => 'bx_videos',
             'OBJECT_METATAGS' => 'bx_videos',

+ 27 - 0
modules/boonex/videos/install/sql/install.sql

@@ -16,6 +16,9 @@ CREATE TABLE IF NOT EXISTS `bx_videos_entries` (
   `votes` int(11) NOT NULL default '0',
   `srate` float NOT NULL default '0',
   `svotes` 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',
@@ -197,6 +200,25 @@ CREATE TABLE `bx_videos_favorites_track` (
   KEY `id` (`object_id`,`author_id`)
 );
 
+-- TABLE: scores
+CREATE TABLE IF NOT EXISTS `bx_videos_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_videos_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`)
+);
+
 
 -- STORAGES & TRANSCODERS
 SET @sStorageEngine = (SELECT `value` FROM `sys_options` WHERE `name` = 'sys_storage_default');
@@ -313,6 +335,11 @@ INSERT INTO `sys_objects_vote` (`Name`, `TableMain`, `TableTrack`, `PostTimeout`
 ('bx_videos_stars', 'bx_videos_svotes', 'bx_videos_svotes_track', '604800', '1', '5', '0', '1', 'bx_videos_entries', 'id', 'author', 'srate', 'svotes', '', '');
 
 
+-- 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_videos', 'bx_videos', 'bx_videos_scores', 'bx_videos_scores_track', '604800', '0', 'bx_videos_entries', '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_videos', 'bx_videos_reports', 'bx_videos_reports_track', '1', 'page.php?i=view-video&id={object_id}', 'bx_videos_entries', 'id', 'author', 'reports', '', '');

+ 5 - 1
modules/boonex/videos/install/sql/uninstall.sql

@@ -1,6 +1,6 @@
 
 -- TABLES
-DROP TABLE IF EXISTS `bx_videos_entries`, `bx_videos_photos`, `bx_videos_videos`, `bx_videos_media_resized`, `bx_videos_cmts`, `bx_videos_votes`, `bx_videos_votes_track`, `bx_videos_svotes`, `bx_videos_svotes_track`, `bx_videos_views_track`, `bx_videos_meta_keywords`, `bx_videos_meta_locations`, `bx_videos_meta_mentions`, `bx_videos_reports`, `bx_videos_reports_track`, `bx_videos_favorites_track`;
+DROP TABLE IF EXISTS `bx_videos_entries`, `bx_videos_photos`, `bx_videos_videos`, `bx_videos_media_resized`, `bx_videos_cmts`, `bx_videos_votes`, `bx_videos_votes_track`, `bx_videos_svotes`, `bx_videos_svotes_track`, `bx_videos_views_track`, `bx_videos_meta_keywords`, `bx_videos_meta_locations`, `bx_videos_meta_mentions`, `bx_videos_reports`, `bx_videos_reports_track`, `bx_videos_favorites_track`, `bx_videos_scores`, `bx_videos_scores_track`;
 
 
 -- STORAGES & TRANSCODERS
@@ -34,6 +34,10 @@ DELETE FROM `sys_objects_cmts` WHERE `Name` = 'bx_videos';
 DELETE FROM `sys_objects_vote` WHERE `Name` IN ('bx_videos', 'bx_videos_stars');
 
 
+-- SCORES
+DELETE FROM `sys_objects_score` WHERE `name` = 'bx_videos';
+
+
 -- REPORTS
 DELETE FROM `sys_objects_report` WHERE `name` = 'bx_videos';