Alex Trofimov 5 лет назад
Родитель
Сommit
7deea8ae50
65 измененных файлов с 3144 добавлено и 0 удалено
  1. 21 0
      modules/boonex/stream/classes/BxStrmAlertsResponse.php
  2. 24 0
      modules/boonex/stream/classes/BxStrmCmtsSearchResult.php
  3. 233 0
      modules/boonex/stream/classes/BxStrmConfig.php
  4. 36 0
      modules/boonex/stream/classes/BxStrmCronPublishing.php
  5. 23 0
      modules/boonex/stream/classes/BxStrmDb.php
  6. 20 0
      modules/boonex/stream/classes/BxStrmEngineNGINX.php
  7. 116 0
      modules/boonex/stream/classes/BxStrmEngineOvenMediaEngine.php
  8. 193 0
      modules/boonex/stream/classes/BxStrmFormEntry.php
  9. 24 0
      modules/boonex/stream/classes/BxStrmFormPoll.php
  10. 23 0
      modules/boonex/stream/classes/BxStrmFormsEntryHelper.php
  11. 21 0
      modules/boonex/stream/classes/BxStrmGridAdministration.php
  12. 21 0
      modules/boonex/stream/classes/BxStrmGridCommon.php
  13. 24 0
      modules/boonex/stream/classes/BxStrmMenu.php
  14. 25 0
      modules/boonex/stream/classes/BxStrmMenuAttachments.php
  15. 25 0
      modules/boonex/stream/classes/BxStrmMenuManageTools.php
  16. 22 0
      modules/boonex/stream/classes/BxStrmMenuSnippetMeta.php
  17. 24 0
      modules/boonex/stream/classes/BxStrmMenuView.php
  18. 35 0
      modules/boonex/stream/classes/BxStrmMenuViewActions.php
  19. 153 0
      modules/boonex/stream/classes/BxStrmModule.php
  20. 24 0
      modules/boonex/stream/classes/BxStrmPageAuthor.php
  21. 24 0
      modules/boonex/stream/classes/BxStrmPageBrowse.php
  22. 32 0
      modules/boonex/stream/classes/BxStrmPageEntry.php
  23. 24 0
      modules/boonex/stream/classes/BxStrmPageListEntry.php
  24. 129 0
      modules/boonex/stream/classes/BxStrmSearchResult.php
  25. 26 0
      modules/boonex/stream/classes/BxStrmStudioPage.php
  26. 74 0
      modules/boonex/stream/classes/BxStrmTemplate.php
  27. 27 0
      modules/boonex/stream/classes/BxStrmUploaderHTML5.php
  28. 27 0
      modules/boonex/stream/classes/BxStrmUploaderHTML5Attach.php
  29. 27 0
      modules/boonex/stream/classes/BxStrmUploaderSimple.php
  30. 27 0
      modules/boonex/stream/classes/BxStrmUploaderSimpleAttach.php
  31. 22 0
      modules/boonex/stream/classes/BxStrmVotePollAnswers.php
  32. 136 0
      modules/boonex/stream/install/config.php
  33. 20 0
      modules/boonex/stream/install/installer.php
  34. 250 0
      modules/boonex/stream/install/langs/en.xml
  35. 47 0
      modules/boonex/stream/install/sql/disable.sql
  36. 362 0
      modules/boonex/stream/install/sql/enable.sql
  37. 399 0
      modules/boonex/stream/install/sql/install.sql
  38. 60 0
      modules/boonex/stream/install/sql/uninstall.sql
  39. 56 0
      modules/boonex/stream/js/manage_tools.js
  40. 21 0
      modules/boonex/stream/js/polls.js
  41. 18 0
      modules/boonex/stream/request.php
  42. 3 0
      modules/boonex/stream/template/author.html
  43. 1 0
      modules/boonex/stream/template/author_link.html
  44. 1 0
      modules/boonex/stream/template/badges.html
  45. 1 0
      modules/boonex/stream/template/category_list_inline.html
  46. 1 0
      modules/boonex/stream/template/context.html
  47. 1 0
      modules/boonex/stream/template/css/categories.css
  48. 1 0
      modules/boonex/stream/template/css/forms.css
  49. 1 0
      modules/boonex/stream/template/css/manage_tools.css
  50. 3 0
      modules/boonex/stream/template/entry-all-actions.html
  51. 3 0
      modules/boonex/stream/template/entry-location.html
  52. 1 0
      modules/boonex/stream/template/entry-share.html
  53. 1 0
      modules/boonex/stream/template/entry-text.html
  54. 1 0
      modules/boonex/stream/template/form_categories.html
  55. 16 0
      modules/boonex/stream/template/form_ghost_template_cover.html
  56. 169 0
      modules/boonex/stream/template/images/icons/std-icon.svg
  57. 31 0
      modules/boonex/stream/template/stream_player.html
  58. 11 0
      modules/boonex/stream/template/stream_viewers.html
  59. 1 0
      modules/boonex/stream/template/title_link.html
  60. 1 0
      modules/boonex/stream/template/uploader_button_html5_attach.html
  61. 1 0
      modules/boonex/stream/template/uploader_button_simple_attach.html
  62. 0 0
      plugins_public/ovenplayer/dash.all.min.js
  63. 0 0
      plugins_public/ovenplayer/hls.min.js
  64. 0 0
      plugins_public/ovenplayer/ovenplayer.js
  65. 0 0
      plugins_public/ovenplayer/ovenplayer.js.map

+ 21 - 0
modules/boonex/stream/classes/BxStrmAlertsResponse.php

@@ -0,0 +1,21 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Stream Stream
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+class BxStrmAlertsResponse extends BxBaseModTextAlertsResponse
+{
+    public function __construct()
+    {
+        $this->MODULE = 'bx_stream';
+        parent::__construct();
+    }
+}
+
+/** @} */

+ 24 - 0
modules/boonex/stream/classes/BxStrmCmtsSearchResult.php

@@ -0,0 +1,24 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Stream Stream
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+class BxStrmCmtsSearchResult extends BxBaseModGeneralCmtsSearchResult
+{
+    function __construct($sMode = '', $aParams = array())
+    {
+    	$this->sModule = 'bx_stream';
+
+        parent::__construct($sMode, $aParams);
+
+        $this->aCurrent['title'] = _t('_bx_stream_page_block_title_browse_cmts');
+    }
+}
+
+/** @} */

+ 233 - 0
modules/boonex/stream/classes/BxStrmConfig.php

@@ -0,0 +1,233 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Stream Stream
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+class BxStrmConfig extends BxBaseModTextConfig
+{
+    function __construct($aModule)
+    {
+        parent::__construct($aModule);
+
+        $aMenuItems2Methods = array (
+            'approve' => 'checkAllowedApprove',
+            'edit-stream' => 'checkAllowedEdit',
+            'delete-stream' => 'checkAllowedDelete',
+        );
+
+        $this->CNF = array_merge($this->CNF, array (
+
+            // module icon
+            'ICON' => 'rss col-red3',
+
+            // database tables
+            'TABLE_ENTRIES' => $aModule['db_prefix'] . 'streams',
+            'TABLE_ENTRIES_FULLTEXT' => 'title_text',
+            'TABLE_POLLS' => '',
+
+            // database fields
+            'FIELD_ID' => 'id',
+            'FIELD_AUTHOR' => 'author',
+            'FIELD_ADDED' => 'added',
+            'FIELD_CHANGED' => 'changed',
+            'FIELD_PUBLISHED' => 'published',
+            'FIELD_TITLE' => 'title',
+            'FIELD_TEXT' => 'text',
+            'FIELD_TEXT_ID' => 'stream-text',
+            'FIELD_CATEGORY' => 'cat',
+            'FIELD_MULTICAT' => 'multicat',
+            'FIELD_ALLOW_VIEW_TO' => 'allow_view_to',
+            'FIELD_COVER' => 'covers',
+            'FIELD_PHOTO' => 'pictures',
+            'FIELD_VIDEO' => 'videos',
+            'FIELD_SOUND' => 'sounds',
+            'FIELD_FILE' => 'files',
+            'FIELD_POLL' => 'polls',
+            'FIELD_THUMB' => 'thumb',
+            'FIELD_ATTACHMENTS' => 'attachments',
+            'FIELD_VIEWS' => 'views',
+            'FIELD_COMMENTS' => 'comments',
+            'FIELD_STATUS' => 'status',
+            'FIELD_STATUS_ADMIN' => 'status_admin',
+            'FIELD_LOCATION' => 'location',
+            'FIELD_LOCATION_PREFIX' => 'location',
+            'FIELD_LABELS' => 'labels',
+            'FIELD_ANONYMOUS' => 'anonymous',
+            'FIELD_DISABLE_COMMENTS' => 'disable_comments',
+            'FIELDS_WITH_KEYWORDS' => 'auto', // can be 'auto', array of fields or comma separated string of field names, works only when OBJECT_METATAGS is specified
+            'FIELD_KEY' => 'key',
+            
+            'PARAM_POLL_ENABLED' => false,
+
+            // page URIs
+            'URI_VIEW_ENTRY' => 'view-stream',
+            'URI_AUTHOR_ENTRIES' => '',
+            'URI_ENTRIES_BY_CONTEXT' => '',
+            'URI_ADD_ENTRY' => 'create-stream',
+            'URI_EDIT_ENTRY' => 'edit-stream',
+            'URI_MANAGE_COMMON' => 'streams-manage',
+            'URI_FAVORITES_LIST' => '',
+
+            'URL_HOME' => '',
+            'URL_POPULAR' => '',
+            'URL_TOP' => '',
+            'URL_UPDATED' => '',
+            'URL_MANAGE_COMMON' => 'page.php?i=streams-manage',
+            'URL_MANAGE_ADMINISTRATION' => 'page.php?i=streams-administration',
+
+            // some params
+            'PARAM_AUTO_APPROVE' => 'bx_stream_enable_auto_approve',
+            'PARAM_CHARS_SUMMARY' => 'bx_stream_summary_chars',
+            'PARAM_CHARS_SUMMARY_PLAIN' => 'bx_stream_plain_summary_chars',
+            'PARAM_NUM_RSS' => 'bx_stream_rss_num',
+            'PARAM_SEARCHABLE_FIELDS' => 'bx_stream_searchable_fields',
+            'PARAM_PER_PAGE_BROWSE_SHOWCASE' => 'bx_stream_per_page_browse_showcase',
+            'PARAM_PER_PAGE_FOR_FAVORITES_LISTS' => 'bx_stream_per_page_for_favorites_lists',
+
+            'PARAM_MULTICAT_ENABLED' => true,
+            'PARAM_MULTICAT_AUTO_ACTIVATION_FOR_CATEGORIES' => 'bx_stream_auto_activation_for_categories',
+
+            // objects
+            'OBJECT_STORAGE' => 'bx_stream_covers',
+            'OBJECT_STORAGE_FILES' => '',
+            'OBJECT_STORAGE_PHOTOS' => '',
+            'OBJECT_STORAGE_VIDEOS' => '',
+            'OBJECT_STORAGE_SOUNDS' => '',
+            'OBJECT_IMAGES_TRANSCODER_PREVIEW' => 'bx_stream_preview',
+            'OBJECT_IMAGES_TRANSCODER_GALLERY' => 'bx_stream_gallery',
+            'OBJECT_IMAGES_TRANSCODER_COVER' => 'bx_stream_cover',
+            'OBJECT_IMAGES_TRANSCODER_PREVIEW_FILES' => '',
+            'OBJECT_IMAGES_TRANSCODER_GALLERY_FILES' => '',
+            'OBJECT_IMAGES_TRANSCODER_PREVIEW_PHOTOS' => '',
+            'OBJECT_IMAGES_TRANSCODER_GALLERY_PHOTOS' => '',
+            'OBJECT_SOUNDS_TRANSCODER' => '',
+            'OBJECT_VIDEOS_TRANSCODERS' => array(),
+            'OBJECT_VIDEO_TRANSCODER_HEIGHT' => '',
+            'OBJECT_REPORTS' => 'bx_stream',
+            'OBJECT_VIEWS' => 'bx_stream',
+            'OBJECT_VOTES' => 'bx_stream',
+            'OBJECT_REACTIONS' => 'bx_stream_reactions',
+            'OBJECT_SCORES' => 'bx_stream',
+            'OBJECT_FEATURED' => 'bx_stream',
+            'OBJECT_METATAGS' => 'bx_stream',
+            'OBJECT_COMMENTS' => 'bx_stream',
+            'OBJECT_NOTES' => 'bx_stream_notes',
+            'OBJECT_CATEGORY' => 'bx_stream_cats',
+            'OBJECT_PRIVACY_VIEW' => 'bx_stream_allow_view_to',
+            'OBJECT_PRIVACY_LIST_VIEW' => 'bx_stream_allow_view_favorite_list',
+            'OBJECT_FORM_ENTRY' => 'bx_stream',
+            'OBJECT_FORM_ENTRY_DISPLAY_VIEW' => 'bx_stream_entry_view',
+            'OBJECT_FORM_ENTRY_DISPLAY_ADD' => 'bx_stream_entry_add',
+            'OBJECT_FORM_ENTRY_DISPLAY_EDIT' => 'bx_stream_entry_edit',
+            'OBJECT_FORM_ENTRY_DISPLAY_DELETE' => 'bx_stream_entry_delete',
+            'OBJECT_FORM_POLL' => '',
+            'OBJECT_FORM_POLL_DISPLAY_ADD' => '',
+            'OBJECT_MENU_ENTRY_ATTACHMENTS' => '', // attachments menu in create/edit forms
+            'OBJECT_MENU_ACTIONS_VIEW_ENTRY' => 'bx_stream_view', // actions menu on view entry page
+            'OBJECT_MENU_ACTIONS_VIEW_ENTRY_ALL' => 'bx_stream_view_actions', // all actions menu on view entry page
+            'OBJECT_MENU_ACTIONS_MY_ENTRIES' => 'bx_stream_my', // actions menu on my entries page
+            'OBJECT_MENU_SUBMENU' => '', // main module submenu
+            'OBJECT_MENU_SUBMENU_VIEW_ENTRY' => '', // view entry submenu
+            'OBJECT_MENU_SUBMENU_VIEW_ENTRY_MAIN_SELECTION' => '', // first item in view entry submenu from main module submenu
+            'OBJECT_MENU_SNIPPET_META' => 'bx_stream_snippet_meta', // menu for snippet meta info
+            'OBJECT_MENU_MANAGE_TOOLS' => 'bx_stream_menu_manage_tools', //manage menu in content administration tools
+            'OBJECT_GRID_ADMINISTRATION' => 'bx_stream_administration',
+            'OBJECT_GRID_COMMON' => 'bx_stream_common',
+            'OBJECT_GRID_CATEGORIES' => 'bx_stream_categories',
+            'OBJECT_UPLOADERS' => array('bx_stream_simple', 'bx_stream_html5'),
+            'OBJECT_CONTENT_INFO' => 'bx_stream',
+            'OBJECT_CMTS_CONTENT_INFO' => 'bx_stream_cmts',
+            
+            'BADGES_AVALIABLE' => true,
+
+            // menu items which visibility depends on custom visibility checking
+            'MENU_ITEM_TO_METHOD' => array (
+                'bx_stream_my' => array (
+                    'create-stream' => 'checkAllowedAdd',
+                ),
+                'bx_stream_view' => $aMenuItems2Methods,
+            ),
+
+            // informer messages
+            'INFORMERS' => array (
+                'approving' => array (
+                    'name' => 'bx-stream-approving',
+                    'map' => array (
+                        'pending' => array('msg' => '_bx_stream_txt_msg_status_pending', 'type' => BX_INFORMER_ALERT),
+                        'hidden' => array('msg' => '_bx_stream_txt_msg_status_hidden', 'type' => BX_INFORMER_ERROR),
+                    ),
+                ),
+                'processing' => array (
+                    'name' => 'bx-stream-processing',
+                    'map' => array (
+                        'awaiting' => array('msg' => '_bx_stream_txt_processing_awaiting', 'type' => BX_INFORMER_ALERT),
+                        'failed' => array('msg' => '_bx_stream_txt_processing_failed', 'type' => BX_INFORMER_ERROR)
+                    ),
+                ),
+                'scheduled' => array (
+                    'name' => 'bx-stream-scheduled',
+                    'map' => array (
+                        'awaiting' => array('msg' => '_bx_stream_txt_scheduled_awaiting', 'type' => BX_INFORMER_ALERT),
+                    ),
+                ),
+            ),
+
+            // some language keys
+            'T' => array (
+                'txt_sample_single' => '_bx_stream_txt_sample_single',
+            	'txt_sample_single_with_article' => '_bx_stream_txt_sample_single_with_article',
+            	'txt_sample_comment_single' => '_bx_stream_txt_sample_comment_single',
+            	'txt_sample_vote_single' => '_bx_stream_txt_sample_vote_single',
+                'txt_sample_reaction_single' => '_bx_stream_txt_sample_reaction_single',
+                'txt_sample_score_up_single' => '_bx_stream_txt_sample_score_up_single',
+                'txt_sample_score_down_single' => '_bx_stream_txt_sample_score_down_single',
+                'form_field_author' => '_bx_stream_form_entry_input_author',
+            	'grid_action_err_delete' => '_bx_stream_grid_action_err_delete',
+            	'grid_txt_account_manager' => '_bx_stream_grid_txt_account_manager',
+                'filter_item_active' => '_bx_stream_grid_filter_item_title_adm_active',
+            	'filter_item_hidden' => '_bx_stream_grid_filter_item_title_adm_hidden',
+                'filter_item_pending' => '_bx_stream_grid_filter_item_title_adm_pending',
+            	'filter_item_select_one_filter1' => '_bx_stream_grid_filter_item_title_adm_select_one_filter1',
+            	'menu_item_manage_my' => '_bx_stream_menu_item_title_manage_my',
+            	'menu_item_manage_all' => '_bx_stream_menu_item_title_manage_all',
+                'txt_all_entries_by' => '_bx_stream_txt_all_entries_by',
+                'txt_all_entries_in' => '_bx_stream_txt_all_entries_in',
+                'txt_all_entries_by_author' => '_bx_stream_page_title_browse_by_author',
+                'txt_all_entries_by_context' => '_bx_stream_page_title_browse_by_context',
+                'txt_err_cannot_perform_action' => '_bx_stream_txt_err_cannot_perform_action',
+                'txt_poll_form_answers_add' => '_bx_stream_form_poll_input_answers_add',
+                'txt_poll_menu_view_answers' => '_bx_stream_txt_poll_view_answers',
+                'txt_poll_menu_view_results' => '_bx_stream_txt_poll_view_results',
+                'txt_poll_menu_view_' => '_bx_stream_txt_poll_view_',
+                'txt_poll_answer_vote_do_by' => '_bx_stream_txt_poll_answer_vote_do_by',
+                'txt_poll_answer_vote_counter' => '_bx_stream_txt_poll_answer_vote_counter',
+                'txt_poll_answer_vote_percent' => '_bx_stream_txt_poll_answer_vote_percent'
+            ),
+        ));
+        
+        $this->_aJsClasses = array_merge($this->_aJsClasses, array(
+            'manage_tools' => 'BxStrmManageTools',
+            'categories' => 'BxDolCategories'
+        ));
+
+        $this->_aJsObjects = array_merge($this->_aJsObjects, array(
+            'manage_tools' => 'oBxStrmManageTools',
+             'categories' => 'oBxDolCategories'
+        ));
+
+        $this->_aGridObjects = array(
+            'common' => $this->CNF['OBJECT_GRID_COMMON'],
+            'administration' => $this->CNF['OBJECT_GRID_ADMINISTRATION'],
+        );
+
+        $this->_bAttachmentsInTimeline = true;
+    }
+}
+
+/** @} */

+ 36 - 0
modules/boonex/stream/classes/BxStrmCronPublishing.php

@@ -0,0 +1,36 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Stream Stream
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+class BxStrmCronPublishing extends BxDolCron
+{
+    protected $_sModule;
+    protected $_oModule;
+
+    public function __construct()
+    {
+        parent::__construct();
+
+    	$this->_sModule = 'bx_stream';
+    	$this->_oModule = BxDolModule::getInstance($this->_sModule);
+    }
+
+    function processing()
+    {
+        $mixedIds = $this->_oModule->_oDb->publishEntries();
+        if($mixedIds === false)
+            return;
+
+        foreach($mixedIds as $iId)
+            $this->_oModule->onPublished($iId);
+    }
+}
+
+/** @} */

+ 23 - 0
modules/boonex/stream/classes/BxStrmDb.php

@@ -0,0 +1,23 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Stream Stream
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+/*
+ * Module database queries
+ */
+class BxStrmDb extends BxBaseModTextDb
+{
+    function __construct(&$oConfig)
+    {
+        parent::__construct($oConfig);
+    }
+}
+
+/** @} */

+ 20 - 0
modules/boonex/stream/classes/BxStrmEngineNGINX.php

@@ -0,0 +1,20 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Stream Stream
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+class BxStrmEngineNGINX extends BxDol
+{
+    public function getViewersNum($aContentInfo)
+    {
+        return false;
+    }
+}
+
+/** @} */

+ 116 - 0
modules/boonex/stream/classes/BxStrmEngineOvenMediaEngine.php

@@ -0,0 +1,116 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Stream Stream
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+class BxStrmEngineOvenMediaEngine extends BxDol
+{
+    public function getViewersNum($sStreamKey)
+    {
+        $a = $this->getStreamStats($sStreamKey);
+        if (!$a)
+            return false;
+
+        return $a['totalConnections'];
+    }
+
+    public function getStreamStats($sStreamKey)
+    {
+        $sApiProtocol = getParam('bx_stream_server_ome_api_protocol');
+        $sHost = getParam('bx_stream_server_host');
+        $iApiPort = (int)getParam('bx_stream_server_ome_api_port');
+        $sApp = getParam('bx_stream_app');
+        $sApiKey = getParam('bx_stream_server_ome_api_key');
+
+        if (!$sApiProtocol || !$sHost || !$iApiPort || !$sApp || !$sApiKey)
+            return false;
+
+        $sUrl = "http://{$sHost}:$iApiPort/v1/stats/current/vhosts/default/apps/{$sApp}/streams/{$sStreamKey}";
+        $s = bx_file_get_contents($sUrl, [], 'get', ['Authorization: Basic ' . $sApiKey]);
+        bx_log('bx_stream_ome_api', $sUrl . "\n" . $s);
+        if (!$s)
+            return false;
+
+        $a = @json_decode($s, true);
+        if (null === $a)
+            return false;
+
+        if (!isset($a['response']))
+            return false;
+
+        return $a['response'];
+    }
+
+    public function getRtmpSettings($sStreamKey)
+    {
+        $sHost = getParam('bx_stream_server_host');
+        $sApp = getParam('bx_stream_app');
+        $sPolicySecret = getParam('bx_stream_server_ome_policy_secret');
+        
+        if (!$sHost || !$sApp)
+            return false;
+
+        $sBaseUrl = "rtmp://$sHost:1935/$sApp";
+        if (!$sPolicySecret)
+            return [$sBaseUrl, $sStreamKey];
+
+        return ['server' => $sBaseUrl, 'key' => str_replace($sBaseUrl . '/', '', $this->_signUrl($sBaseUrl . '/' . $sStreamKey, $sPolicySecret))];
+    }
+
+    public function getRtmpIngestUrl($sStreamKey)
+    {
+        if (!($a = $this->getRtmpSettings($sStreamKey)))
+            return false;
+        list ($sBaseUrl, $sStreamKey) = $a;
+        return $a['server'] . '/' . $a['key'];
+        
+
+        $sHost = getParam('bx_stream_server_host');
+        $sApp = getParam('bx_stream_app');
+        $sPolicySecret = getParam('bx_stream_server_ome_policy_secret');
+        
+        if (!$sHost || !$sApp)
+            return false;
+
+        $sBaseUrl = "rtmp://$sHost:1935/$sApp/$sStreamKey";
+        if (!$sPolicySecret)
+            return $sBaseUrl;
+
+        return $this->_signUrl($sBaseUrl, $sPolicySecret);
+    }
+
+    protected function _signUrl($sBaseUrl, $sPolicySecret)
+    {
+        $sSignatureQueryKeyName = 'signature';
+        $sPolicyQueryKeyName = 'policy';
+        $sPolicy = json_encode(['url_expire' => 2556104400000]);//(time() + 50*365*24*60*60)*1000]);
+
+        // 1. Perform base64url() for POLICY (RFC 4648 5.)        
+        $sPolicyBase64 = $this->_base64URLEncode($sPolicy);
+
+        // 2. Generates an URL such as "ws://ome_host:3333/app/stream?policy=${POLICY_BASE64}"
+        $sPolicyUrl = bx_append_url_params($sBaseUrl, [$sPolicyQueryKeyName => $sPolicyBase64]);
+
+        // 3. Perform sha1(base64url()) for SIGNATURE (RFC 4648 5.)
+        $sSha1 = hash_hmac('sha1', $sPolicyUrl, $sPolicySecret, true);
+        $sSignature = $this->_base64URLEncode($sSha1);
+
+        // 4. Create the whole URL
+        $sWholeUrl = bx_append_url_params($sPolicyUrl, [$sSignatureQueryKeyName => $sSignature]);
+
+        return $sWholeUrl;
+    }
+
+    protected function _base64URLEncode($s)
+    {
+        return trim(strtr(base64_encode($s), '+/', '-_'), '=');
+    }
+}
+
+/** @} */

+ 193 - 0
modules/boonex/stream/classes/BxStrmFormEntry.php

@@ -0,0 +1,193 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Stream Stream
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+/**
+ * Create/Edit entry form
+ */
+class BxStrmFormEntry extends BxBaseModTextFormEntry
+{
+    protected $_sGhostTemplateCover = 'form_ghost_template_cover.html';
+	
+    public function __construct($aInfo, $oTemplate = false)
+    {
+        $this->MODULE = 'bx_stream';
+        parent::__construct($aInfo, $oTemplate);
+
+        $CNF = &$this->_oModule->_oConfig->CNF;
+
+    	if(isset($CNF['FIELD_COVER']) && isset($this->aInputs[$CNF['FIELD_COVER']])) {
+            if($this->_oModule->checkAllowedSetThumb() === CHECK_ACTION_RESULT_ALLOWED) {
+                $this->aInputs[$CNF['FIELD_COVER']]['storage_object'] = $CNF['OBJECT_STORAGE'];
+                $this->aInputs[$CNF['FIELD_COVER']]['uploaders'] = !empty($this->aInputs[$CNF['FIELD_COVER']]['value']) ? unserialize($this->aInputs[$CNF['FIELD_COVER']]['value']) : $CNF['OBJECT_UPLOADERS'];
+                $this->aInputs[$CNF['FIELD_COVER']]['upload_buttons_titles'] = array(
+                    'Simple' => _t('_bx_stream_form_entry_input_covers_uploader_simple_title'), 
+                    'HTML5' => _t('_bx_stream_form_entry_input_covers_uploader_html5_title')
+                );
+                $this->aInputs[$CNF['FIELD_COVER']]['images_transcoder'] = $CNF['OBJECT_IMAGES_TRANSCODER_PREVIEW'];
+                $this->aInputs[$CNF['FIELD_COVER']]['storage_private'] = 0;
+                $this->aInputs[$CNF['FIELD_COVER']]['multiple'] = false;
+                $this->aInputs[$CNF['FIELD_COVER']]['content_id'] = 0;
+                $this->aInputs[$CNF['FIELD_COVER']]['ghost_template'] = '';
+            }
+            else
+                unset($this->aInputs[$CNF['FIELD_COVER']]);
+        }
+
+        if(isset($CNF['FIELD_PHOTO']) && isset($this->aInputs[$CNF['FIELD_PHOTO']])) {
+            $this->aInputs[$CNF['FIELD_PHOTO']]['storage_object'] = $CNF['OBJECT_STORAGE_PHOTOS'];
+            $this->aInputs[$CNF['FIELD_PHOTO']]['uploaders'] = !empty($this->aInputs[$CNF['FIELD_PHOTO']]['value']) ? unserialize($this->aInputs[$CNF['FIELD_PHOTO']]['value']) : $CNF['OBJECT_UPLOADERS'];
+            $this->aInputs[$CNF['FIELD_PHOTO']]['images_transcoder'] = $CNF['OBJECT_IMAGES_TRANSCODER_PREVIEW_PHOTOS'];
+            $this->aInputs[$CNF['FIELD_PHOTO']]['storage_private'] = 0;
+            $this->aInputs[$CNF['FIELD_PHOTO']]['multiple'] = true;
+            $this->aInputs[$CNF['FIELD_PHOTO']]['content_id'] = 0;
+            $this->aInputs[$CNF['FIELD_PHOTO']]['ghost_template'] = '';
+            $this->aInputs[$CNF['FIELD_PHOTO']]['tr_attrs'] = array('class'=> 'bx-base-text-attachment-item');
+        }
+
+        if(isset($this->aInputs[$CNF['FIELD_VIDEO']])) {
+            $this->aInputs[$CNF['FIELD_VIDEO']]['storage_object'] = $CNF['OBJECT_STORAGE_VIDEOS'];
+            $this->aInputs[$CNF['FIELD_VIDEO']]['uploaders'] = !empty($this->aInputs[$CNF['FIELD_VIDEO']]['value']) ? unserialize($this->aInputs[$CNF['FIELD_VIDEO']]['value']) : $CNF['OBJECT_UPLOADERS'];
+            $this->aInputs[$CNF['FIELD_VIDEO']]['images_transcoder'] = $CNF['OBJECT_VIDEOS_TRANSCODERS']['poster_preview'];
+            $this->aInputs[$CNF['FIELD_VIDEO']]['storage_private'] = 0;
+            $this->aInputs[$CNF['FIELD_VIDEO']]['multiple'] = true;
+            $this->aInputs[$CNF['FIELD_VIDEO']]['content_id'] = 0;
+            $this->aInputs[$CNF['FIELD_VIDEO']]['ghost_template'] = '';
+            $this->aInputs[$CNF['FIELD_VIDEO']]['tr_attrs'] = array('class'=> 'bx-base-text-attachment-item');
+        }
+        
+        if(isset($this->aInputs[$CNF['FIELD_SOUND']])) {
+            $this->aInputs[$CNF['FIELD_SOUND']]['storage_object'] = $CNF['OBJECT_STORAGE_SOUNDS'];
+            $this->aInputs[$CNF['FIELD_SOUND']]['uploaders'] = !empty($this->aInputs[$CNF['FIELD_SOUND']]['value']) ? unserialize($this->aInputs[$CNF['FIELD_SOUND']]['value']) : $CNF['OBJECT_UPLOADERS'];
+            $this->aInputs[$CNF['FIELD_SOUND']]['images_transcoder'] = $CNF['OBJECT_IMAGES_TRANSCODER_PREVIEW_FILES'];
+            $this->aInputs[$CNF['FIELD_SOUND']]['storage_private'] = 0;
+            $this->aInputs[$CNF['FIELD_SOUND']]['multiple'] = true;
+            $this->aInputs[$CNF['FIELD_SOUND']]['content_id'] = 0;
+            $this->aInputs[$CNF['FIELD_SOUND']]['ghost_template'] = '';
+            $this->aInputs[$CNF['FIELD_SOUND']]['tr_attrs'] = array('class'=> 'bx-base-text-attachment-item');
+        }
+
+        if (isset($CNF['FIELD_FILE']) && isset($this->aInputs[$CNF['FIELD_FILE']])) {
+            $this->aInputs[$CNF['FIELD_FILE']]['storage_object'] = $CNF['OBJECT_STORAGE_FILES'];
+            $this->aInputs[$CNF['FIELD_FILE']]['uploaders'] = !empty($this->aInputs[$CNF['FIELD_FILE']]['value']) ? unserialize($this->aInputs[$CNF['FIELD_FILE']]['value']) : $CNF['OBJECT_UPLOADERS'];
+            $this->aInputs[$CNF['FIELD_FILE']]['images_transcoder'] = $CNF['OBJECT_IMAGES_TRANSCODER_PREVIEW_FILES'];
+            $this->aInputs[$CNF['FIELD_FILE']]['storage_private'] = 0;
+            $this->aInputs[$CNF['FIELD_FILE']]['multiple'] = true;
+            $this->aInputs[$CNF['FIELD_FILE']]['content_id'] = 0;
+            $this->aInputs[$CNF['FIELD_FILE']]['ghost_template'] = '';
+            $this->aInputs[$CNF['FIELD_FILE']]['tr_attrs'] = array('class'=> 'bx-base-text-attachment-item');
+        }
+
+        if(isset($this->aInputs[$CNF['FIELD_POLL']])) {
+            $this->aInputs[$CNF['FIELD_POLL']]['tr_attrs'] = array('class'=> 'bx-base-text-attachment-item');
+        }
+    }
+
+    function initChecker ($aValues = array (), $aSpecificValues = array())
+    {
+        $CNF = &$this->_oModule->_oConfig->CNF;
+
+        $bValues = $aValues && !empty($aValues['id']);
+        $aContentInfo = $bValues ? $this->_oModule->_oDb->getContentInfoById($aValues['id']) : false;
+
+        if($this->aParams['display'] == $CNF['OBJECT_FORM_ENTRY_DISPLAY_EDIT'] && isset($CNF['FIELD_PUBLISHED']) && isset($this->aInputs[$CNF['FIELD_PUBLISHED']]))
+            if($bValues && in_array($aValues[$CNF['FIELD_STATUS']], array('active', 'hidden')))
+                unset($this->aInputs[$CNF['FIELD_PUBLISHED']]);
+
+        if (isset($CNF['FIELD_COVER']) && isset($this->aInputs[$CNF['FIELD_COVER']])) {
+            if($bValues)
+                $this->aInputs[$CNF['FIELD_COVER']]['content_id'] = $aValues['id'];
+
+            $this->aInputs[$CNF['FIELD_COVER']]['ghost_template'] = $this->_oModule->_oTemplate->parseHtmlByName($this->_sGhostTemplateCover, $this->_getCoverGhostTmplVars($aContentInfo));
+        }
+
+        parent::initChecker ($aValues, $aSpecificValues);
+    }
+
+    public function insert ($aValsToAdd = array(), $isIgnore = false)
+    {
+        $CNF = &$this->_oModule->_oConfig->CNF;
+
+        if(isset($CNF['FIELD_ADDED']) && empty($aValsToAdd[$CNF['FIELD_ADDED']])) {
+            $iAdded = 0;
+            if(isset($this->aInputs[$CNF['FIELD_ADDED']]))
+                $iAdded = $this->getCleanValue($CNF['FIELD_ADDED']);
+
+            if(empty($iAdded))
+                 $iAdded = time();
+
+            $aValsToAdd[$CNF['FIELD_ADDED']] = $iAdded;
+        }
+
+        if(empty($aValsToAdd[$CNF['FIELD_PUBLISHED']])) {
+            $iPublished = 0;
+            if(isset($this->aInputs[$CNF['FIELD_PUBLISHED']]))
+                $iPublished = $this->getCleanValue($CNF['FIELD_PUBLISHED']);
+                
+             if(empty($iPublished))
+                 $iPublished = time();
+
+             $aValsToAdd[$CNF['FIELD_PUBLISHED']] = $iPublished;
+        }
+
+        $aValsToAdd[$CNF['FIELD_STATUS']] = $aValsToAdd[$CNF['FIELD_PUBLISHED']] > $aValsToAdd[$CNF['FIELD_ADDED']] ? 'awaiting' : 'active';
+
+        $aValsToAdd[$CNF['FIELD_KEY']] = genRndPwd(12, false);
+
+        $iContentId = parent::insert ($aValsToAdd, $isIgnore);
+        if(!empty($iContentId)){
+            $this->processFiles($CNF['FIELD_COVER'], $iContentId, true);
+        }
+        return $iContentId;
+    }
+
+    function update ($iContentId, $aValsToAdd = array(), &$aTrackTextFieldsChanges = null)
+    {
+        $CNF = &$this->_oModule->_oConfig->CNF;
+
+        if(empty($aValsToAdd[$CNF['FIELD_PUBLISHED']]) && isset($this->aInputs[$CNF['FIELD_PUBLISHED']])) {
+            $iPublished = $this->getCleanValue($CNF['FIELD_PUBLISHED']);
+            if(empty($iPublished))
+                $iPublished = time();
+
+            $aValsToAdd[$CNF['FIELD_PUBLISHED']] = $iPublished;
+        }
+
+        $iResult = parent::update ($iContentId, $aValsToAdd, $aTrackTextFieldsChanges);
+        $this->processFiles($CNF['FIELD_COVER'], $iContentId, false);   
+        return $iResult;
+    }
+
+    protected function _getCoverGhostTmplVars($aContentInfo = array())
+    {
+    	$CNF = &$this->_oModule->_oConfig->CNF;
+
+    	return array (
+            'name' => $this->aInputs[$CNF['FIELD_COVER']]['name'],
+            'content_id' => $this->aInputs[$CNF['FIELD_COVER']]['content_id'],
+            'editor_id' => isset($CNF['FIELD_TEXT_ID']) ? $CNF['FIELD_TEXT_ID'] : '',
+            'thumb_id' => isset($CNF['FIELD_THUMB']) && isset($aContentInfo[$CNF['FIELD_THUMB']]) ? $aContentInfo[$CNF['FIELD_THUMB']] : 0,
+            'name_thumb' => isset($CNF['FIELD_THUMB']) ? $CNF['FIELD_THUMB'] : ''
+        );
+    }
+
+    protected function _getPhotoGhostTmplVars($aContentInfo = array())
+    {
+    	$CNF = &$this->_oModule->_oConfig->CNF;
+
+    	return array (
+            'name' => $this->aInputs[$CNF['FIELD_PHOTO']]['name'],
+            'content_id' => (int)$this->aInputs[$CNF['FIELD_PHOTO']]['content_id'],
+            'editor_id' => isset($CNF['FIELD_TEXT_ID']) ? $CNF['FIELD_TEXT_ID'] : ''
+    	);
+    }
+}
+
+/** @} */

+ 24 - 0
modules/boonex/stream/classes/BxStrmFormPoll.php

@@ -0,0 +1,24 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Stream Stream
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+class BxStrmFormPoll extends BxBaseModTextFormPoll
+{
+    public function __construct($aInfo, $oTemplate = false)
+    {
+        $this->_sModule = 'bx_stream';
+        $this->_aFieldsCheckForSpam = array('answers');
+        parent::__construct($aInfo, $oTemplate);
+    }
+}
+
+class BxStrmFormPollCheckerHelper extends BxBaseModTextFormPollCheckerHelper {}
+
+/** @} */

+ 23 - 0
modules/boonex/stream/classes/BxStrmFormsEntryHelper.php

@@ -0,0 +1,23 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Stream Stream
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+/**
+ * Entry forms helper functions
+ */
+class BxStrmFormsEntryHelper extends BxBaseModTextFormsEntryHelper
+{
+    public function __construct($oModule)
+    {
+        parent::__construct($oModule);
+    }
+}
+
+/** @} */

+ 21 - 0
modules/boonex/stream/classes/BxStrmGridAdministration.php

@@ -0,0 +1,21 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Stream Stream
+ * @ingroup     UnaModules
+ * 
+ * @{
+ */
+
+class BxStrmGridAdministration extends BxBaseModTextGridAdministration
+{
+    public function __construct ($aOptions, $oTemplate = false)
+    {
+    	$this->MODULE = 'bx_stream';
+        parent::__construct ($aOptions, $oTemplate);
+    }
+}
+
+/** @} */

+ 21 - 0
modules/boonex/stream/classes/BxStrmGridCommon.php

@@ -0,0 +1,21 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Stream Stream
+ * @ingroup     UnaModules
+ * 
+ * @{
+ */
+
+class BxStrmGridCommon extends BxBaseModTextGridCommon
+{
+    public function __construct ($aOptions, $oTemplate = false)
+    {
+    	$this->MODULE = 'bx_stream';
+        parent::__construct ($aOptions, $oTemplate);
+    }
+}
+
+/** @} */

+ 24 - 0
modules/boonex/stream/classes/BxStrmMenu.php

@@ -0,0 +1,24 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Stream Stream
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+/**
+ * General class for module menu.
+ */
+class BxStrmMenu extends BxBaseModTextMenu
+{
+    public function __construct($aObject, $oTemplate = false)
+    {
+        $this->MODULE = 'bx_stream';
+        parent::__construct($aObject, $oTemplate);
+    }
+}
+
+/** @} */

+ 25 - 0
modules/boonex/stream/classes/BxStrmMenuAttachments.php

@@ -0,0 +1,25 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Stream Stream
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+/**
+ * View entry menu
+ */
+class BxStrmMenuAttachments extends BxBaseModTextMenuAttachments
+{
+    public function __construct($aObject, $oTemplate = false)
+    {
+        $this->_sModule = 'bx_stream';
+
+        parent::__construct($aObject, $oTemplate);
+    }
+}
+
+/** @} */

+ 25 - 0
modules/boonex/stream/classes/BxStrmMenuManageTools.php

@@ -0,0 +1,25 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Stream Stream
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+/**
+ * 'Stream manage tools' menu.
+ */
+class BxStrmMenuManageTools extends BxBaseModTextMenuManageTools
+{
+
+    public function __construct($aObject, $oTemplate = false)
+    {
+        $this->MODULE = 'bx_stream';
+        parent::__construct($aObject, $oTemplate);
+    }
+}
+
+/** @} */

+ 22 - 0
modules/boonex/stream/classes/BxStrmMenuSnippetMeta.php

@@ -0,0 +1,22 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Stream Stream
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+class BxStrmMenuSnippetMeta extends BxBaseModTextMenuSnippetMeta
+{
+    public function __construct($aObject, $oTemplate = false)
+    {
+        $this->_sModule = 'bx_stream';
+
+        parent::__construct($aObject, $oTemplate);
+    }
+}
+
+/** @} */

+ 24 - 0
modules/boonex/stream/classes/BxStrmMenuView.php

@@ -0,0 +1,24 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Stream Stream
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+/**
+ * View entry menu
+ */
+class BxStrmMenuView extends BxBaseModTextMenuView
+{
+    public function __construct($aObject, $oTemplate = false)
+    {
+        $this->MODULE = 'bx_stream';
+        parent::__construct($aObject, $oTemplate);
+    }
+}
+
+/** @} */

+ 35 - 0
modules/boonex/stream/classes/BxStrmMenuViewActions.php

@@ -0,0 +1,35 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Stream Stream
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+/**
+ * View entry social actions menu
+ */
+class BxStrmMenuViewActions extends BxBaseModTextMenuViewActions
+{
+    public function __construct($aObject, $oTemplate = false)
+    {
+        $this->_sModule = 'bx_stream';
+
+        parent::__construct($aObject, $oTemplate);
+    }
+
+    protected function _getMenuItemEditStream($aItem)
+    {
+        return $this->_getMenuItemByNameActions($aItem);
+    }
+
+    protected function _getMenuItemDeleteStream($aItem)
+    {
+        return $this->_getMenuItemByNameActions($aItem);
+    }
+}
+
+/** @} */

+ 153 - 0
modules/boonex/stream/classes/BxStrmModule.php

@@ -0,0 +1,153 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Stream Stream
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+/**
+ * Stream module
+ */
+class BxStrmModule extends BxBaseModTextModule
+{
+    protected $_oEngine;
+
+    function __construct(&$aModule)
+    {
+        parent::__construct($aModule);
+
+        $CNF = &$this->_oConfig->CNF;
+        $this->_aSearchableNamesExcept = array_merge($this->_aSearchableNamesExcept, array(
+            $CNF['FIELD_PUBLISHED'],
+            $CNF['FIELD_ANONYMOUS'],
+            $CNF['FIELD_DISABLE_COMMENTS']
+        ));
+    }
+
+    public function getStreamEngine ()
+    {
+        if ($this->_oEngine)
+            return $this->_oEngine;
+
+        $sEngine = getParam('bx_stream_engine');
+        bx_import('Engine' . $sEngine, $this->_aModule);
+        $sClass = 'BxStrmEngine' . $sEngine;
+        $this->_oEngine = new $sClass;
+        return $this->_oEngine;
+    }
+
+    public function actionStreamViewers ($iContentId = 0)
+    {
+        header('Content-Type:text/javascript; charset=utf-8');
+     
+        $CNF = &$this->_oConfig->CNF;
+        $mixedContent = $this->_getContent($iContentId, 'getContentInfoById');
+        if ($mixedContent === false) {
+            echo json_encode(['viewers' => _t('_sys_txt_error_occured')]);
+            exit;
+        }
+        list($iContentId, $aContentInfo) = $mixedContent;
+
+        $iNum = $this->getStreamEngine()->getViewersNum($aContentInfo[$CNF['FIELD_KEY']]);
+        
+        echo json_encode(['viewers' => $iNum !== false ? _t('_bx_stream_txt_viewers', (int)$iNum) : _t('_bx_stream_txt_wait_for_stream'), 'num' => $iNum]);
+    }
+
+    public function serviceStreamViewers ($iContentId = 0)
+    {
+        return $this->_serviceTemplateFunc ('entryStreamViewers', $iContentId);
+    }
+
+    public function serviceStreamPlayer ($iContentId = 0)
+    {
+        return $this->_serviceTemplateFunc ('entryStreamPlayer', $iContentId);
+    }
+
+    public function serviceStreamRtmpSettings ($iContentId = 0)
+    {
+        $CNF = &$this->_oConfig->CNF;
+        $mixedContent = $this->_getContent($iContentId, 'getContentInfoById');
+        if ($mixedContent === false)
+            return false;
+        list($iContentId, $aContentInfo) = $mixedContent;
+
+        if ($aContentInfo[$CNF['FIELD_AUTHOR']] !== bx_get_logged_profile_id() && !isAdmin()) 
+            return false;
+
+        $a = $this->getStreamEngine()->getRtmpSettings($aContentInfo[$CNF['FIELD_KEY']]);
+        if (!$a)
+            return false;
+
+        $aForm = array(
+            'form_attrs' => array(
+                'name' => 'bx-stream-stmp-settings',
+            ),
+            'inputs' => array(
+                'url' => array(
+                    'type' => 'text',
+                    'name' => 'url',
+                    'caption' => _t('_bx_stream_form_entry_input_server'),
+                    'value' => $a['server'],
+                ),
+                'key' => array(
+                    'type' => 'password',
+                    'name' => 'key',
+                    'caption' => _t('_bx_stream_form_entry_input_stream_key'),
+                    'value' => $a['key'],
+                ),
+            ),
+        );
+        
+        $oForm = new BxTemplFormView ($aForm);
+        return $oForm->getCode();
+    }
+
+    /**
+     * Entry post for Timeline module
+     */
+    public function serviceGetTimelinePost($aEvent, $aBrowseParams = array())
+    {
+        $CNF = &$this->_oConfig->CNF;
+
+        $aResult = parent::serviceGetTimelinePost($aEvent, $aBrowseParams);
+        if(empty($aResult) || !is_array($aResult) || empty($aResult['date']))
+            return $aResult;
+
+        $aContentInfo = $this->_oDb->getContentInfoById($aEvent['object_id']);
+        if($aContentInfo[$CNF['FIELD_PUBLISHED']] > $aResult['date'])
+            $aResult['date'] = $aContentInfo[$CNF['FIELD_PUBLISHED']];
+
+        return $aResult;
+    }
+
+    public function serviceCheckAllowedCommentsPost($iContentId, $sObjectComments) 
+    {
+        $CNF = &$this->_oConfig->CNF;
+        $aContentInfo = $this->_oDb->getContentInfoById($iContentId);
+        if ($aContentInfo && $aContentInfo[$CNF['FIELD_DISABLE_COMMENTS']] == 1)
+            return false;
+        
+        return parent::serviceCheckAllowedCommentsPost($iContentId, $sObjectComments);
+    }
+	
+	public function serviceCheckAllowedCommentsView($iContentId, $sObjectComments) 
+    {
+        $CNF = &$this->_oConfig->CNF;
+        $aContentInfo = $this->_oDb->getContentInfoById($iContentId);
+        if ($aContentInfo && $aContentInfo[$CNF['FIELD_DISABLE_COMMENTS']] == 1)
+            return false;
+
+        return parent::serviceCheckAllowedCommentsView($iContentId, $sObjectComments);
+    }
+
+    public function checkAllowedSetThumb ($iContentId = 0)
+    {
+        return CHECK_ACTION_RESULT_ALLOWED;
+    }
+}
+
+/** @} */

+ 24 - 0
modules/boonex/stream/classes/BxStrmPageAuthor.php

@@ -0,0 +1,24 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Stream Stream
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+/**
+ * Profile's entries page.
+ */
+class BxStrmPageAuthor extends BxBaseModTextPageAuthor
+{
+    public function __construct($aObject, $oTemplate = false)
+    {
+        parent::__construct($aObject, $oTemplate);
+    }
+
+}
+
+/** @} */

+ 24 - 0
modules/boonex/stream/classes/BxStrmPageBrowse.php

@@ -0,0 +1,24 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Stream Stream
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+/**
+ * Browse entries pages.
+ */
+class BxStrmPageBrowse extends BxBaseModTextPageBrowse
+{
+    public function __construct($aObject, $oTemplate = false)
+    {
+        $this->MODULE = 'bx_stream';
+        parent::__construct($aObject, $oTemplate);
+    }
+}
+
+/** @} */

+ 32 - 0
modules/boonex/stream/classes/BxStrmPageEntry.php

@@ -0,0 +1,32 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Stream Stream
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+/**
+ * Entry create/edit pages
+ */
+class BxStrmPageEntry extends BxBaseModTextPageEntry
+{
+    public function __construct($aObject, $oTemplate = false)
+    {
+        $this->MODULE = 'bx_stream';
+        parent::__construct($aObject, $oTemplate);
+    }
+
+    protected function _setSubmenu($aParams)
+    {
+    	parent::_setSubmenu(array_merge($aParams, array(
+    		'title' => '',
+    		'icon' => ''
+    	)));
+    }
+}
+
+/** @} */

+ 24 - 0
modules/boonex/stream/classes/BxStrmPageListEntry.php

@@ -0,0 +1,24 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Stream Stream
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+/**
+ * List entry page
+ */
+class BxStrmPageListEntry extends BxBaseModTextPageListEntry
+{    
+    public function __construct($aObject, $oTemplate = false)
+    {
+        $this->MODULE = 'bx_stream';
+        parent::__construct($aObject, $oTemplate);
+    }
+}
+
+/** @} */

+ 129 - 0
modules/boonex/stream/classes/BxStrmSearchResult.php

@@ -0,0 +1,129 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Stream Stream
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+class BxStrmSearchResult extends BxBaseModTextSearchResult
+{
+    function __construct($sMode = '', $aParams = array())
+    {
+        parent::__construct($sMode, $aParams);
+
+        $this->aCurrent = array(
+            'name' => 'bx_stream',
+            'module_name' => 'bx_stream',
+            'object_metatags' => 'bx_stream',
+            'title' => _t('_bx_stream_page_title_browse'),
+            'table' => 'bx_stream_streams',
+            'ownFields' => array('id', 'title', 'text', 'thumb', 'author', 'added'),
+            'searchFields' => array(),
+            'restriction' => array(
+                'author' => array('value' => '', 'field' => 'author', 'operator' => '='),
+        		'featured' => array('value' => '', 'field' => 'featured', 'operator' => '<>'),
+        		'status' => array('value' => 'active', 'field' => 'status', 'operator' => '='),
+        		'statusAdmin' => array('value' => 'active', 'field' => 'status_admin', 'operator' => '='),
+            ),
+            'paginate' => array('perPage' => getParam('bx_stream_per_page_browse'), 'start' => 0),
+            'sorting' => 'last',
+            'rss' => array(
+                'title' => '',
+                'link' => '',
+                'image' => '',
+                'profile' => 0,
+                'fields' => array (
+                    'Guid' => 'link',
+                    'Link' => 'link',
+                    'Title' => 'title',
+                    'DateTimeUTS' => 'added',
+                    'Desc' => 'text',
+                    'Image' => 'thumb'
+                ),
+            ),
+            'ident' => 'id',
+        );
+
+        $this->sFilterName = 'bx_stream_filter';
+        $this->oModule = $this->getMain();
+
+        $CNF = &$this->oModule->_oConfig->CNF;
+
+        $sSearchFields = getParam($CNF['PARAM_SEARCHABLE_FIELDS']);
+        $this->aCurrent['searchFields'] = !empty($sSearchFields) ? explode(',', $sSearchFields) : '';
+
+        $oProfileAuthor = null;
+
+        switch ($sMode) {
+            case 'author':
+                if(!$this->_updateCurrentForAuthor($sMode, $aParams, $oProfileAuthor))
+                    $this->isError = true;
+                break;
+
+            case 'context':
+                if(!$this->_updateCurrentForContext($sMode, $aParams, $oProfileAuthor))
+                    $this->isError = true;
+                break;
+                
+            case 'favorite':
+                if(!$this->_updateCurrentForFavorite($sMode, $aParams, $oProfileAuthor))
+                    $this->isError = true;
+                break;
+
+            case 'public':
+                $this->sBrowseUrl = BxDolPermalinks::getInstance()->permalink($CNF['URL_HOME']);
+                $this->aCurrent['title'] = _t('_bx_stream_page_title_browse_recent');
+                $this->aCurrent['rss']['link'] = 'modules/?r=stream/rss/' . $sMode;
+                break;
+
+            case 'featured':
+                $this->sBrowseUrl = BxDolPermalinks::getInstance()->permalink($CNF['URL_HOME']);
+                $this->aCurrent['title'] = _t('_bx_stream_page_title_browse_featured');
+                $this->aCurrent['restriction']['featured']['value'] = '0';
+                $this->aCurrent['rss']['link'] = 'modules/?r=stream/rss/' . $sMode;
+                $this->aCurrent['sorting'] = 'featured';
+                break;
+
+            case 'popular':
+                $this->sBrowseUrl = BxDolPermalinks::getInstance()->permalink($CNF['URL_TOP']);
+                $this->aCurrent['title'] = _t('_bx_stream_page_title_browse_popular');
+                $this->aCurrent['rss']['link'] = 'modules/?r=stream/rss/' . $sMode;
+                $this->aCurrent['sorting'] = 'popular';
+                break;
+
+            case 'top':
+                $this->sBrowseUrl = BxDolPermalinks::getInstance()->permalink($CNF['URL_POPULAR']);
+                $this->aCurrent['title'] = _t('_bx_stream_page_title_browse_top');
+                $this->aCurrent['rss']['link'] = 'modules/?r=stream/rss/' . $sMode;
+                $this->aCurrent['sorting'] = 'top';
+                break;
+
+            case 'updated':
+                $this->sBrowseUrl = BxDolPermalinks::getInstance()->permalink($CNF['URL_UPDATED']);
+                $this->aCurrent['title'] = _t('_bx_stream_page_title_browse_updated');
+                $this->aCurrent['rss']['link'] = 'modules/?r=stream/rss/' . $sMode;
+                $this->aCurrent['sorting'] = 'updated';
+                break;
+
+            case '': // search results
+                $this->sBrowseUrl = BX_DOL_SEARCH_KEYWORD_PAGE;
+                $this->aCurrent['title'] = _t('_bx_stream');
+                unset($this->aCurrent['paginate']['perPage'], $this->aCurrent['rss']);
+                break;
+
+            default:
+                $sMode = '';
+                $this->isError = true;
+        }
+
+        $this->processReplaceableMarkers($oProfileAuthor);
+
+        $this->addConditionsForPrivateContent($CNF, $oProfileAuthor);
+    }
+}
+
+/** @} */

+ 26 - 0
modules/boonex/stream/classes/BxStrmStudioPage.php

@@ -0,0 +1,26 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Stream Stream
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+class BxStrmStudioPage extends BxTemplStudioModule
+{
+    protected $_sModule;
+    protected $_oModule;
+    
+    function __construct($sModule, $mixedPageName, $sPage = "")
+    {
+    	$this->_sModule = 'bx_stream';
+    	$this->_oModule = BxDolModule::getInstance($this->_sModule);
+
+        parent::__construct($sModule, $mixedPageName, $sPage);
+    }
+}
+
+/** @} */

+ 74 - 0
modules/boonex/stream/classes/BxStrmTemplate.php

@@ -0,0 +1,74 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Stream Stream
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+/*
+ * Module representation.
+ */
+class BxStrmTemplate extends BxBaseModTextTemplate
+{
+    function __construct(&$oConfig, &$oDb)
+    {
+        $this->MODULE = 'bx_stream';
+
+        parent::__construct($oConfig, $oDb);
+    }
+
+    public function entryStreamViewers ($aContentInfo)
+    {
+        $CNF = &$this->getModule()->_oConfig->CNF;
+        return $this->parseHtmlByName('stream_viewers.html', array(
+            'viewers' => _t('_bx_stream_txt_viewers_loading'),
+            'suffix' => md5($aContentInfo[$CNF['FIELD_KEY']]),
+            'url' => BX_DOL_URL_MODULES . '?r=' . $this->getModule()->_oConfig->getUri() . '/stream_viewers/' . $aContentInfo[$CNF['FIELD_ID']]
+        ));
+    }
+ 
+    public function entryStreamPlayer ($aContentInfo)
+    {
+        $CNF = &$this->getModule()->_oConfig->CNF;
+
+        $sSources = getParam('bx_stream_sources_pattern');
+        $sHost = getParam('bx_stream_server_host');
+        $sApp = getParam('bx_stream_app');
+        if (!$sSources || !$sHost)
+            return MsgBox(_t('_bx_stream_txt_no_config'));
+
+        $sSources = str_replace(
+            ['{host}', '{app}', '{key}', '{params}'],
+            [$sHost, $sApp, $aContentInfo[$CNF['FIELD_KEY']], ''],
+            $sSources
+        );
+
+        $this->addJs('ovenplayer/ovenplayer.js');
+        if (getParam('bx_stream_dash_enabled'))
+            $this->addJs('ovenplayer/dash.all.min.js');
+        if (getParam('bx_stream_hls_enabled'))
+            $this->addJs('ovenplayer/hls.min.js');
+        $this->addJsTranslation('_bx_stream_txt_wait_for_stream');
+
+        return $this->parseHtmlByName('stream_player.html', array(
+            'suffix' => md5($aContentInfo[$CNF['FIELD_KEY']]),
+            'sources' => $sSources,
+        ));
+    }
+
+    /**
+     * Use Gallery image for both because currently there is no Unit types with small thumbnails.
+     */
+    protected function getUnitThumbAndGallery ($aData)
+    {
+        list($sPhotoThumb, $sPhotoGallery) = parent::getUnitThumbAndGallery($aData);
+
+        return array($sPhotoGallery, $sPhotoGallery);
+    }
+}
+
+/** @} */

+ 27 - 0
modules/boonex/stream/classes/BxStrmUploaderHTML5.php

@@ -0,0 +1,27 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Stream Stream
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+class BxStrmUploaderHTML5 extends BxBaseModTextUploaderHTML5
+{
+    public function __construct ($aObject, $sStorageObject, $sUniqId, $oTemplate)
+    {
+        $this->_sModule = 'bx_stream';
+
+        parent::__construct($aObject, $sStorageObject, $sUniqId, $oTemplate);
+    }
+
+    protected function isAdmin ($iContentId = 0)
+    {
+        return $this->_oModule->_isModerator (false);
+    }
+}
+
+/** @} */

+ 27 - 0
modules/boonex/stream/classes/BxStrmUploaderHTML5Attach.php

@@ -0,0 +1,27 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Stream Stream
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+class BxStrmUploaderHTML5Attach extends BxBaseModTextUploaderHTML5Attach
+{
+    public function __construct ($aObject, $sStorageObject, $sUniqId, $oTemplate)
+    {
+        $this->_sModule = 'bx_stream';
+
+        parent::__construct($aObject, $sStorageObject, $sUniqId, $oTemplate);
+    }
+
+    protected function isAdmin ($iContentId = 0)
+    {
+        return $this->_oModule->_isModerator (false);
+    }
+}
+
+/** @} */

+ 27 - 0
modules/boonex/stream/classes/BxStrmUploaderSimple.php

@@ -0,0 +1,27 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Stream Stream
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+class BxStrmUploaderSimple extends BxBaseModTextUploaderSimple
+{
+    public function __construct ($aObject, $sStorageObject, $sUniqId, $oTemplate)
+    {
+        $this->_sModule = 'bx_stream';
+        
+        parent::__construct($aObject, $sStorageObject, $sUniqId, $oTemplate);
+    }
+
+    protected function isAdmin ($iContentId = 0)
+    {
+        return $this->_oModule->_isModerator (false);
+    }
+}
+
+/** @} */

+ 27 - 0
modules/boonex/stream/classes/BxStrmUploaderSimpleAttach.php

@@ -0,0 +1,27 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Stream Stream
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+class BxStrmUploaderSimpleAttach extends BxBaseModTextUploaderSimpleAttach
+{
+    public function __construct ($aObject, $sStorageObject, $sUniqId, $oTemplate)
+    {
+        $this->_sModule = 'bx_stream';
+
+        parent::__construct($aObject, $sStorageObject, $sUniqId, $oTemplate);
+    }
+
+    protected function isAdmin ($iContentId = 0)
+    {
+        return $this->_oModule->_isModerator (false);
+    }
+}
+
+/** @} */

+ 22 - 0
modules/boonex/stream/classes/BxStrmVotePollAnswers.php

@@ -0,0 +1,22 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Stream Stream
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+class BxStrmVotePollAnswers extends BxBaseModTextVotePollAnswers
+{
+    function __construct($sSystem, $iId, $iInit = 1)
+    {
+    	$this->_sModule = 'bx_stream';
+
+        parent::__construct($sSystem, $iId, $iInit);
+    }
+}
+
+/** @} */

+ 136 - 0
modules/boonex/stream/install/config.php

@@ -0,0 +1,136 @@
+<?php
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Stream Stream
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+$aConfig = array(
+
+    /**
+     * Main Section.
+     */
+    'type' => BX_DOL_MODULE_TYPE_MODULE,
+    'name' => 'bx_stream',
+    'title' => 'Stream',
+    'note' => 'Live streaming module.',
+    'version' => '12.0.0.DEV',
+    'vendor' => 'BoonEx',
+    'help_url' => 'http://feed.una.io/?section={module_name}',
+
+    'compatible_with' => array(
+        '12.1.x'
+    ),
+
+    /**
+     * 'home_dir' and 'home_uri' - should be unique. Don't use spaces in 'home_uri' and the other special chars.
+     */
+    'home_dir' => 'boonex/stream/',
+    'home_uri' => 'stream',
+
+    'db_prefix' => 'bx_stream_',
+    'class_prefix' => 'BxStrm',
+
+    /**
+     * Category for language keys.
+     */
+    'language_category' => 'Stream',
+
+    /**
+     * List of page triggers.
+     */
+    'page_triggers' => array (
+    	'trigger_page_profile_view_entry',
+    ),
+    
+    /**
+     * Menu triggers.
+     */
+    'menu_triggers' => array(
+        'trigger_profile_view_submenu',
+        'trigger_group_view_submenu',
+    ),
+
+    /**
+     * Storage objects to automatically delete files from upon module uninstallation.
+     * Note. Don't add storage objects used in transcoder objects.
+     */
+    'storages' => array(
+        'bx_stream_covers',
+    ),
+
+    /**
+     * Transcoders.
+     */
+    'transcoders' => array(
+        'bx_stream_preview',
+        'bx_stream_gallery',
+        'bx_stream_cover',
+    ),
+
+    /**
+     * Extended Search Forms.
+     */
+    'esearches' => array(
+        'bx_stream',
+    	'bx_stream_cmts'
+    ),
+
+    /**
+     * Installation/Uninstallation Section.
+     */
+    'install' => array(
+        'execute_sql' => 1,
+        'update_languages' => 1,
+        'clear_db_cache' => 1,
+    ),
+    'uninstall' => array (
+    	'process_esearches' => 1,
+        'execute_sql' => 1,
+        'update_languages' => 1,
+        'update_relations' => 1,
+        'clear_db_cache' => 1,
+    ),
+    'enable' => array(
+        'execute_sql' => 1,
+        'update_relations' => 1,
+        'clear_db_cache' => 1,
+    ),
+    'enable_success' => array(
+        'process_menu_triggers' => 1,
+        'process_page_triggers' => 1,
+    	'process_esearches' => 1,
+        'register_transcoders' => 1,
+        'clear_db_cache' => 1,
+    ),
+    'disable' => array (
+        'execute_sql' => 1,
+        'update_relations' => 1,
+        'unregister_transcoders' => 1,
+        'clear_db_cache' => 1,
+    ),
+    'disable_failed' => array (
+        'register_transcoders' => 1,
+        'clear_db_cache' => 1,
+    ),
+
+    /**
+     * Dependencies Section
+     */
+    'dependencies' => array(),
+
+    /**
+     * Relations Section
+     */
+    'relations' => array(
+    	'bx_timeline',
+    	'bx_notifications'
+    ),
+
+);
+
+/** @} */

+ 20 - 0
modules/boonex/stream/install/installer.php

@@ -0,0 +1,20 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Stream Stream
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+class BxStrmInstaller extends BxBaseModTextInstaller
+{
+    function __construct($aConfig)
+    {
+        parent::__construct($aConfig);
+    }
+}
+
+/** @} */

+ 250 - 0
modules/boonex/stream/install/langs/en.xml

@@ -0,0 +1,250 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources name="en" flag="gb" title="English">
+
+    <string name="_bx_stream"><![CDATA[Streams]]></string>
+    <string name="_bx_stream_cmts"><![CDATA[Streams' Comments]]></string>
+    <string name="_bx_stream_reactions"><![CDATA[Streams' Reactions]]></string>
+
+    <string name="_bx_stream_options_cat_streaming"><![CDATA[Streaming]]></string>
+    <string name="_bx_stream_options_cat_engine_ome"><![CDATA[OvenMediaEngine]]></string>
+    <string name="_bx_stream_options_cat_general"><![CDATA[General]]></string>
+
+    <string name="_bx_stream_option_engine"><![CDATA[Server Software]]></string>
+    <string name="_bx_stream_option_ome_api_key"><![CDATA[OvenMediaEngine API Key]]></string>
+    <string name="_bx_stream_option_ome_api_protocol"><![CDATA[OvenMediaEngine API Protocol]]></string>
+    <string name="_bx_stream_option_ome_policy_secret"><![CDATA[OvenMediaEngine Signed Policy Secret Key]]></string>
+
+    <string name="_bx_stream_option_ome_api_port"><![CDATA[OvenMediaEngine API Port]]></string>
+    <string name="_bx_stream_option_server_host"><![CDATA[Server Hostname]]></string>
+    <string name="_bx_stream_option_app"><![CDATA[Application Name]]></string>
+    <string name="_bx_stream_option_sources_pattern"><![CDATA[Sources Pattern]]></string>
+    <string name="_bx_stream_option_dash_enabled"><![CDATA[Enable MPEG-DASH streaming]]></string>
+    <string name="_bx_stream_option_hls_enabled"><![CDATA[Enable HLS streaming]]></string>
+    <string name="_bx_stream_option_enable_auto_approve"><![CDATA[Auto approve a stream after creation]]></string>
+    <string name="_bx_stream_option_summary_chars"><![CDATA[Number of characters in auto-cropped stream summary]]></string>
+    <string name="_bx_stream_option_plain_summary_chars"><![CDATA[Number of characters in plain stream description when stream hasn't thumb]]></string>
+    <string name="_bx_stream_option_per_page_browse"><![CDATA[Number of items per page]]></string>
+    <string name="_bx_stream_option_per_page_profile"><![CDATA[Number of items on profile/group page]]></string>
+    <string name="_bx_stream_option_rss_num"><![CDATA[Number of items in RSS feed]]></string>
+    <string name="_bx_stream_option_auto_activation_for_categories"><![CDATA[Auto-Activation For Categories]]></string>
+
+    <string name="_bx_stream_form_entry"><![CDATA[Streams]]></string>
+    <string name="_bx_stream_form_entry_display_add"><![CDATA[Add Stream]]></string>
+    <string name="_bx_stream_form_entry_display_edit"><![CDATA[Edit Stream]]></string>
+    <string name="_bx_stream_form_entry_display_delete"><![CDATA[Delete Stream]]></string>
+    <string name="_bx_stream_form_entry_display_view"><![CDATA[View Stream]]></string>
+    <string name="_bx_stream_form_entry_input_author"><![CDATA[Author]]></string>
+    <string name="_bx_stream_form_entry_input_sys_do_submit"><![CDATA[Submit]]></string>
+    <string name="_bx_stream_form_entry_input_do_submit"><![CDATA[Submit]]></string>
+    <string name="_bx_stream_form_entry_input_sys_do_publish"><![CDATA[Publish]]></string>
+    <string name="_bx_stream_form_entry_input_do_publish"><![CDATA[Publish]]></string>
+    <string name="_bx_stream_form_entry_input_sys_title"><![CDATA[Title]]></string>
+    <string name="_bx_stream_form_entry_input_title"><![CDATA[Title]]></string>
+    <string name="_bx_stream_form_entry_input_title_err"><![CDATA[Title is essential. Please, fill in this field]]></string>
+    <string name="_bx_stream_form_entry_input_sys_cat"><![CDATA[Category]]></string>
+    <string name="_bx_stream_form_entry_input_cat"><![CDATA[Category]]></string>
+    <string name="_bx_stream_form_entry_input_cat_err"><![CDATA[Please select category]]></string>
+    <string name="_bx_stream_form_entry_input_sys_multicat"><![CDATA[Categories]]></string>
+    <string name="_bx_stream_form_entry_input_multicat"><![CDATA[Categories]]></string>
+    <string name="_bx_stream_form_entry_input_multicat_err"><![CDATA[Please select category]]></string>
+    <string name="_bx_stream_form_entry_input_sys_text"><![CDATA[Text]]></string>
+    <string name="_bx_stream_form_entry_input_text"><![CDATA[Text]]></string>
+    <string name="_bx_stream_form_entry_input_text_err"><![CDATA[Text field can't be empty]]></string>
+    <string name="_bx_stream_form_entry_input_sys_delete_confirm"><![CDATA[Delete confirmation]]></string>
+    <string name="_bx_stream_form_entry_input_delete_confirm"><![CDATA[I am sure I want to delete this stream]]></string>
+    <string name="_bx_stream_form_entry_input_delete_confirm_info"><![CDATA[This action can not be undone]]></string>
+    <string name="_bx_stream_form_entry_input_delete_confirm_error"><![CDATA[Please check this checkbox if you really want to delete the stream]]></string>
+    <string name="_bx_stream_form_entry_input_sys_covers"><![CDATA[Header Image]]></string>
+    <string name="_bx_stream_form_entry_input_covers"><![CDATA[Header Image]]></string>
+    <string name="_bx_stream_form_entry_input_covers_uploader_simple_title"><![CDATA[Upload]]></string>
+    <string name="_bx_stream_form_entry_input_covers_uploader_html5_title"><![CDATA[Upload]]></string>
+    <string name="_bx_stream_form_entry_input_sys_allow_view_to"><![CDATA[Visibility]]></string>
+    <string name="_bx_stream_form_entry_input_allow_view_to"><![CDATA[Visibility]]></string>
+    <string name="_bx_stream_form_entry_input_allow_view_favorite_list"><![CDATA[Visibility]]></string>
+    <string name="_bx_stream_form_entry_input_sys_date_added"><![CDATA[Created]]></string>
+    <string name="_bx_stream_form_entry_input_date_added"><![CDATA[Created]]></string>
+    <string name="_bx_stream_form_entry_input_sys_date_changed"><![CDATA[Updated]]></string>
+    <string name="_bx_stream_form_entry_input_date_changed"><![CDATA[Updated]]></string>
+    <string name="_bx_stream_form_entry_input_sys_date_published"><![CDATA[Publishing time]]></string>
+    <string name="_bx_stream_form_entry_input_date_published"><![CDATA[Publishing time]]></string>
+    <string name="_bx_stream_form_entry_input_date_published_info"><![CDATA[Leave empty to publish immediately.]]></string>
+    <string name="_bx_stream_form_entry_input_sys_disable_comments"><![CDATA[Disable comments]]></string>
+    <string name="_bx_stream_form_entry_input_disable_comments"><![CDATA[Disable comments]]></string>
+    <string name="_bx_stream_form_entry_input_server"><![CDATA[Server]]></string>
+    <string name="_bx_stream_form_entry_input_stream_key"><![CDATA[Stream Key]]></string>
+
+    <string name="_bx_stream_category_form_entry"><![CDATA[Categories Form]]></string>
+    <string name="_bx_stream_category_display_add"><![CDATA[Add category]]></string>
+    <string name="_bx_stream_category_display_edit"><![CDATA[Edit category]]></string>
+    <string name="_bx_stream_category_form_entry_input_sys_value"><![CDATA[Value]]></string>
+    <string name="_bx_stream_category_form_entry_input_value"><![CDATA[Value]]></string>>
+    <string name="_bx_stream_category_form_entry_input_value_err"><![CDATA[Value is essential. Please, fill in this field]]></string>
+    <string name="_bx_stream_lmi_cpt_categories"><![CDATA[Categories]]></string>
+
+  <string name="_bx_stream_acl_action_create_entry"><![CDATA[Create Stream]]></string>
+    <string name="_bx_stream_acl_action_delete_entry"><![CDATA[Delete Stream]]></string>
+    <string name="_bx_stream_acl_action_view_entry"><![CDATA[View Stream]]></string>
+    <string name="_bx_stream_acl_action_set_thumb"><![CDATA[Set Stream Header Image]]></string>
+    <string name="_bx_stream_acl_action_edit_any_entry"><![CDATA[Edit Any Stream]]></string>
+    <string name="_bx_stream_acl_action_delete_any_entry"><![CDATA[Delete Any Account]]></string>
+
+    <string name="_bx_stream_page_title_sys_create_entry"><![CDATA[New Stream]]></string>
+    <string name="_bx_stream_page_title_create_entry"><![CDATA[New Stream]]></string>
+    <string name="_bx_stream_page_block_title_create_entry"><![CDATA[New Stream]]></string>
+    <string name="_bx_stream_page_title_sys_edit_entry"><![CDATA[Edit]]></string>
+    <string name="_bx_stream_page_title_edit_entry"><![CDATA[Edit]]></string>
+    <string name="_bx_stream_page_block_title_edit_entry"><![CDATA[Edit]]></string>
+    <string name="_bx_stream_page_title_sys_delete_entry"><![CDATA[Delete]]></string>
+    <string name="_bx_stream_page_title_delete_entry"><![CDATA[Delete]]></string>
+    <string name="_bx_stream_page_block_title_delete_entry"><![CDATA[Delete]]></string>
+    <string name="_bx_stream_page_title_sys_view_entry"><![CDATA[View Stream]]></string>
+    <string name="_bx_stream_page_title_view_entry"><![CDATA[{title}]]></string>
+    <string name="_bx_stream_page_block_title_entry_text"><![CDATA[Stream Text]]></string>
+    <string name="_bx_stream_page_title_browse"><![CDATA[Streams]]></string>
+    <string name="_bx_stream_page_title_search_results"><![CDATA[Streams matching "{0}"]]></string>
+    <string name="_bx_stream_page_block_title_entry_rtmp_settings"><![CDATA[RTMP Settings]]></string>
+    <string name="_bx_stream_page_block_title_viewers"><![CDATA[Stream Viewers]]></string>
+    <string name="_bx_stream_page_block_title_player"><![CDATA[Stream Player]]></string>
+
+    <string name="_bx_stream_page_block_title_featured_entries_view_extended"><![CDATA[Featured Streams]]></string>
+    <string name="_bx_stream_page_block_title_recent_entries"><![CDATA[Latest Streams (Gallery View)]]></string>
+    <string name="_bx_stream_page_block_title_recent_entries_view_extended"><![CDATA[Latest Streams]]></string>
+    <string name="_bx_stream_page_block_title_recent_entries_view_full"><![CDATA[Latest Streams (Full View)]]></string>
+    <string name="_bx_stream_page_block_title_entry_social_sharing"><![CDATA[Share]]></string>
+    <string name="_bx_stream_page_block_title_entry_author"><![CDATA[Author]]></string>
+    <string name="_bx_stream_page_block_title_entry_actions"><![CDATA[Actions]]></string>
+    <string name="_bx_stream_page_block_title_entry_comments"><![CDATA[Comments]]></string>
+    <string name="_bx_stream_page_block_title_entry_reports"><![CDATA[Reports]]></string>
+    <string name="_bx_stream_page_block_title_entry_comments_link"><![CDATA[Comments to <a href="{entry_link}">{title}</a>]]></string>
+    <string name="_bx_stream_page_block_title_entry_location"><![CDATA[Location]]></string>
+    <string name="_bx_stream_page_block_title_entry_all_actions"><![CDATA[All Actions]]></string>
+    <string name="_bx_stream_page_title_sys_view_entry_comments"><![CDATA[Stream Comments]]></string>
+    <string name="_bx_stream_page_title_view_entry_comments"><![CDATA[Comments to {title}]]></string>
+    <string name="_bx_stream_page_block_title_entries_of_author"><![CDATA[Streams by <a href="{profile_link}">{display_name}</a>]]></string>
+    <string name="_bx_stream_page_block_title_sys_entries_of_author"><![CDATA[Streams of author]]></string>
+    <string name="_bx_stream_page_block_title_entries_in_context"><![CDATA[Streams in <a href="{profile_link}">{display_name}</a>]]></string>
+    <string name="_bx_stream_page_block_title_sys_entries_in_context"><![CDATA[Streams in context]]></string>
+    <string name="_bx_stream_page_block_title_entries_actions"><![CDATA[Streams actions]]></string>
+    <string name="_bx_stream_page_block_title_browse_cmts"><![CDATA[Streams' Comments]]></string>
+    <string name="_bx_stream_page_title_sys_manage"><![CDATA[Manage Own]]></string>
+    <string name="_bx_stream_page_title_sys_manage_administration"><![CDATA[Manage All]]></string>
+    <string name="_bx_stream_page_title_manage"><![CDATA[Manage]]></string>
+    <string name="_bx_stream_page_block_title_system_manage"><![CDATA[Manage Own]]></string>
+    <string name="_bx_stream_page_block_title_system_manage_administration"><![CDATA[Manage All]]></string>
+    <string name="_bx_stream_page_block_title_manage"><![CDATA[Manage]]></string>
+    <string name="_bx_stream_page_block_title_cats"><![CDATA[Streams Categories]]></string>
+    <string name="_bx_stream_page_block_title_sys_multicats"><![CDATA[Streams Categories(Multi)]]></string>
+    <string name="_bx_stream_page_block_title_multicats"><![CDATA[Streams Categories]]></string>
+    <string name="_bx_stream_page_block_title_entry_info"><![CDATA[Info]]></string>
+    <string name="_bx_stream_page_block_title_sys_my_entries"><![CDATA[User Streams]]></string>
+    <string name="_bx_stream_page_block_title_my_entries"><![CDATA[{display_name} Streams]]></string>
+
+    <string name="_bx_stream_page_block_title_sys_entry_context"><![CDATA[Streamed in]]></string>
+    <string name="_bx_stream_page_block_title_entry_context"><![CDATA[Streamed in]]></string>
+
+    <string name="_bx_stream_menu_set_title_view_entry"><![CDATA[Stream Actions]]></string>
+    <string name="_bx_stream_menu_title_view_entry"><![CDATA[Stream Actions]]></string>
+    <string name="_bx_stream_menu_title_submenu"><![CDATA[Streams Submenu]]></string>
+    <string name="_bx_stream_menu_set_title_submenu"><![CDATA[Streams Submenu]]></string>
+    <string name="_bx_stream_menu_item_title_system_create_entry"><![CDATA[Stream]]></string>
+    <string name="_bx_stream_menu_item_title_create_entry"><![CDATA[Stream]]></string>
+    <string name="_bx_stream_menu_item_title_system_edit_entry"><![CDATA[Edit]]></string>
+    <string name="_bx_stream_menu_item_title_edit_entry"><![CDATA[Edit]]></string>
+    <string name="_bx_stream_menu_item_title_system_delete_entry"><![CDATA[Delete]]></string>
+    <string name="_bx_stream_menu_item_title_delete_entry"><![CDATA[Delete]]></string>
+    <string name="_bx_stream_menu_item_title_system_view_entry"><![CDATA[View Stream]]></string>
+    <string name="_bx_stream_menu_item_title_system_entries_home"><![CDATA[Streams]]></string>
+    <string name="_bx_stream_menu_item_title_entries_home"><![CDATA[Streams]]></string>
+    <string name="_bx_stream_menu_item_title_system_entries_manage"><![CDATA[Manage]]></string>
+    <string name="_bx_stream_menu_item_title_entries_manage"><![CDATA[Manage]]></string>
+
+    <string name="_bx_stream_menu_title_entries_my"><![CDATA[My Streams Action Menu]]></string>
+    <string name="_bx_stream_menu_set_title_manage_tools"><![CDATA[Manage Tools Submenu]]></string>
+    <string name="_bx_stream_menu_title_manage_tools"><![CDATA[Manage Tools Submenu]]></string>
+    <string name="_bx_stream_menu_item_title_system_manage_account"><![CDATA[Manage account]]></string>
+    <string name="_bx_stream_menu_item_title_manage_account"><![CDATA[Manage account]]></string>
+    <string name="_bx_stream_menu_item_title_system_admt_stream"><![CDATA[Streams]]></string>
+    <string name="_bx_stream_menu_item_title_admt_stream"><![CDATA[Streams]]></string>
+    <string name="_bx_stream_menu_item_title_manage_my"><![CDATA[My Streams]]></string>
+    <string name="_bx_stream_menu_item_title_manage_all"><![CDATA[All Streams]]></string>
+    <string name="_bx_stream_menu_item_title_system_manage_my_stream"><![CDATA[My streams]]></string>
+    <string name="_bx_stream_menu_item_title_manage_my_stream"><![CDATA[Streams]]></string>
+
+    <string name="_bx_stream_grid_filter_item_title_adm_select_one_filter1"><![CDATA[All Statuses]]></string>
+    <string name="_bx_stream_grid_filter_item_title_adm_active"><![CDATA[Active]]></string>
+    <string name="_bx_stream_grid_filter_item_title_adm_hidden"><![CDATA[Hidden]]></string>
+    <string name="_bx_stream_grid_filter_item_title_adm_pending"><![CDATA[Pending]]></string>
+    <string name="_bx_stream_grid_column_title_adm_active"><![CDATA[Active]]></string>
+    <string name="_bx_stream_grid_column_title_adm_title"><![CDATA[Title]]></string>
+    <string name="_bx_stream_grid_action_title_adm_audit_content"><![CDATA[Audit actions]]></string>
+    <string name="_bx_stream_grid_column_title_adm_added"><![CDATA[Added]]></string>
+    <string name="_bx_stream_grid_column_title_adm_author"><![CDATA[Author]]></string>>
+    <string name="_bx_stream_grid_action_title_adm_add"><![CDATA[Add]]></string>
+    <string name="_bx_stream_grid_action_title_adm_edit"><![CDATA[Edit]]></string>
+    <string name="_bx_stream_grid_action_title_adm_delete"><![CDATA[Delete]]></string>
+    <string name="_bx_stream_grid_action_title_adm_clear_reports"><![CDATA[Clear reports]]></string>
+    <string name="_bx_stream_grid_action_title_adm_more_actions"><![CDATA[More Actions]]></string>
+    <string name="_bx_stream_grid_column_title_adm_status_admin"><![CDATA[Moderation]]></string>
+    <string name="_bx_stream_grid_action_err_delete"><![CDATA[Cannot delete the selected stream(s).]]></string>
+    <string name="_bx_stream_grid_txt_account_manager"><![CDATA[Redirect to manage account.]]></string>
+
+    <string name="_bx_stream_chart_growth"><![CDATA[Streams: Growth]]></string>
+    <string name="_bx_stream_chart_growth_speed"><![CDATA[Streams: Growth Speed]]></string>
+
+    <string name="_bx_stream_search_extended"><![CDATA[Streams Search]]></string>
+    <string name="_bx_stream_search_extended_cmts"><![CDATA[Streams Comments Search]]></string>
+
+    <string name="_bx_stream_pre_lists_cats"><![CDATA[Stream categories]]></string>
+    <string name="_bx_stream_cat_Animals_Pets"><![CDATA[Animals & Pets]]></string>
+    <string name="_bx_stream_cat_Architecture"><![CDATA[Architecture]]></string>
+    <string name="_bx_stream_cat_Art"><![CDATA[Art]]></string>
+    <string name="_bx_stream_cat_Cars_Motorcycles"><![CDATA[Cars & Motorcycles]]></string>
+    <string name="_bx_stream_cat_Celebrities"><![CDATA[Celebrities]]></string>
+    <string name="_bx_stream_cat_Design"><![CDATA[Design]]></string>
+    <string name="_bx_stream_cat_DIY_Crafts"><![CDATA[DIY & Crafts]]></string>
+    <string name="_bx_stream_cat_Education"><![CDATA[Education]]></string>
+    <string name="_bx_stream_cat_Film_Music_Books"><![CDATA[Film, Music & Books]]></string>
+    <string name="_bx_stream_cat_Food_Drink"><![CDATA[Food & Drink]]></string>
+    <string name="_bx_stream_cat_Gardening"><![CDATA[Gardening]]></string>
+    <string name="_bx_stream_cat_Geek"><![CDATA[Geek]]></string>
+    <string name="_bx_stream_cat_Hair_Beauty"><![CDATA[Hair & Beauty]]></string>
+    <string name="_bx_stream_cat_Health_Fitness"><![CDATA[Health & Fitness]]></string>
+    <string name="_bx_stream_cat_History"><![CDATA[History]]></string>
+    <string name="_bx_stream_cat_Holidays_Events"><![CDATA[Holidays & Events]]></string>
+    <string name="_bx_stream_cat_Home_Decor"><![CDATA[Home Decor]]></string>
+    <string name="_bx_stream_cat_Humor"><![CDATA[Humor]]></string>
+    <string name="_bx_stream_cat_Illustrations_Posters"><![CDATA[Illustrations & Posters]]></string>
+    <string name="_bx_stream_cat_Kids_Parenting"><![CDATA[Kids & Parenting]]></string>
+    <string name="_bx_stream_cat_Mens_Fashion"><![CDATA[Men's Fashion]]></string>
+    <string name="_bx_stream_cat_Outdoors"><![CDATA[Outdoors]]></string>
+    <string name="_bx_stream_cat_Photography"><![CDATA[Photography]]></string>
+    <string name="_bx_stream_cat_Products"><![CDATA[Products]]></string>
+    <string name="_bx_stream_cat_Quotes"><![CDATA[Quotes]]></string>
+    <string name="_bx_stream_cat_Science_Nature"><![CDATA[Science & Nature]]></string>
+    <string name="_bx_stream_cat_Sports"><![CDATA[Sports]]></string>
+    <string name="_bx_stream_cat_Tattoos"><![CDATA[Tattoos]]></string>
+    <string name="_bx_stream_cat_Technology"><![CDATA[Technology]]></string>
+    <string name="_bx_stream_cat_Travel"><![CDATA[Travel]]></string>
+    <string name="_bx_stream_cat_Weddings"><![CDATA[Weddings]]></string>
+    <string name="_bx_stream_cat_Womens_Fashion"><![CDATA[Women's Fashion]]></string>
+
+    <string name="_bx_stream_txt_all_entries_in"><![CDATA[<a href="{0}">All Streams in {1} ({2})</a>]]></string>
+    <string name="_bx_stream_txt_all_entries_by"><![CDATA[{0} stream]]></string>
+    <string name="_bx_stream_txt_sample_single"><![CDATA[stream]]></string>
+    <string name="_bx_stream_txt_sample_single_with_article"><![CDATA[a stream]]></string>
+    <string name="_bx_stream_txt_sample_comment_single"><![CDATA[comment to stream]]></string>
+    <string name="_bx_stream_txt_sample_vote_single"><![CDATA[vote to stream]]></string>
+    <string name="_bx_stream_txt_sample_reaction_single"><![CDATA['{0}' reaction to stream]]></string>
+    <string name="_bx_stream_txt_sample_score_up_single"><![CDATA[score up vote to stream]]></string>
+    <string name="_bx_stream_txt_sample_score_down_single"><![CDATA[score down vote to stream]]></string>
+    <string name="_bx_stream_txt_scheduled_awaiting"><![CDATA[Stream publishing date is {date_publish_uf}]]></string>
+
+    <string name="_bx_stream_txt_msg_status_hidden"><![CDATA[This stream was hidden.]]></string>
+    <string name="_bx_stream_txt_msg_status_pending"><![CDATA[This stream is pending approval.]]></string>
+    <string name="_bx_stream_txt_err_cannot_perform_action"><![CDATA[Cannot perform action. Please report.]]></string>
+    <string name="_bx_stream_txt_viewers"><![CDATA[{0} viewers]]></string>
+    <string name="_bx_stream_txt_viewers_loading"><![CDATA[Getting number of viewers...]]></string>
+    <string name="_bx_stream_txt_no_config"><![CDATA[No configuration is defined]]></string>
+    <string name="_bx_stream_txt_wait_for_stream"><![CDATA[Waiting for live streaming...]]></string>
+    <string name="_bx_stream_logs_ome_api"><![CDATA[OvenMediaEngine API Logs]]></string>
+</resources>

+ 47 - 0
modules/boonex/stream/install/sql/disable.sql

@@ -0,0 +1,47 @@
+
+-- SETTINGS
+DELETE FROM `top`, `toc`, `to` USING `sys_options_types` AS `top` LEFT JOIN `sys_options_categories` AS `toc` ON `top`.`id`=`toc`.`type_id` LEFT JOIN `sys_options` AS `to` ON `toc`.`id`=`to`.`category_id` WHERE `top`.`name`='bx_stream';
+
+-- PAGES
+DELETE FROM `sys_objects_page` WHERE `module` = 'bx_stream';
+DELETE FROM `sys_pages_blocks` WHERE `module` = 'bx_stream' OR `object` IN('bx_stream_create_entry', 'bx_stream_edit_entry', 'bx_stream_delete_entry', 'bx_stream_view_entry', 'bx_stream_view_entry_comments', 'bx_stream_manage');
+
+-- MENU
+DELETE FROM `sys_objects_menu` WHERE `module` = 'bx_stream';
+DELETE FROM `sys_menu_sets` WHERE `module` = 'bx_stream';
+DELETE FROM `sys_menu_items` WHERE `module` = 'bx_stream' OR `set_name` IN('bx_stream_view', 'bx_stream_view_actions', 'bx_stream_snippet_meta', 'bx_stream_menu_manage_tools');
+
+-- PRIVACY 
+DELETE FROM `sys_objects_privacy` WHERE `object` IN ('bx_stream_allow_view_to');
+
+-- ACL
+DELETE `sys_acl_actions`, `sys_acl_matrix` FROM `sys_acl_actions`, `sys_acl_matrix` WHERE `sys_acl_matrix`.`IDAction` = `sys_acl_actions`.`ID` AND `sys_acl_actions`.`Module` = 'bx_stream';
+DELETE FROM `sys_acl_actions` WHERE `Module` = 'bx_stream';
+
+-- METATAGS
+DELETE FROM `sys_objects_metatags` WHERE `object` = 'bx_stream';
+
+-- CATEGORY
+DELETE FROM `sys_objects_category` WHERE `object` = 'bx_stream_cats';
+
+-- STATS
+DELETE FROM `sys_statistics` WHERE `name` LIKE 'bx_stream%';
+
+-- CHARTS
+DELETE FROM `sys_objects_chart` WHERE `object` LIKE 'bx_stream%';
+
+-- GRIDS
+DELETE FROM `sys_objects_grid` WHERE `object` IN ('bx_stream_administration', 'bx_stream_common');
+DELETE FROM `sys_grid_fields` WHERE `object` IN ('bx_stream_administration', 'bx_stream_common');
+DELETE FROM `sys_grid_actions` WHERE `object` IN ('bx_stream_administration', 'bx_stream_common');
+
+-- UPLOADERS
+DELETE FROM `sys_objects_uploader` WHERE `object` LIKE 'bx_stream_%';
+
+-- ALERTS
+SET @iHandler := (SELECT `id` FROM `sys_alerts_handlers` WHERE `name` = 'bx_stream' LIMIT 1);
+DELETE FROM `sys_alerts` WHERE `handler_id` = @iHandler;
+DELETE FROM `sys_alerts_handlers` WHERE `id` = @iHandler;
+
+-- CRON
+DELETE FROM `sys_cron_jobs` WHERE `name` LIKE 'bx_stream%';

+ 362 - 0
modules/boonex/stream/install/sql/enable.sql

@@ -0,0 +1,362 @@
+
+-- SETTINGS
+
+SET @iTypeOrder = (SELECT MAX(`order`) FROM `sys_options_types` WHERE `group` = 'modules');
+INSERT INTO `sys_options_types`(`group`, `name`, `caption`, `icon`, `order`) VALUES 
+('modules', 'bx_stream', '_bx_stream', 'bx_stream@modules/boonex/stream/|std-icon.svg', IF(ISNULL(@iTypeOrder), 1, @iTypeOrder + 1));
+SET @iTypeId = LAST_INSERT_ID();
+
+INSERT INTO `sys_options_categories` (`type_id`, `name`, `caption`, `order`)
+VALUES (@iTypeId, 'bx_stream_streaming', '_bx_stream_options_cat_streaming', 1);
+SET @iCategId = LAST_INSERT_ID();
+
+INSERT INTO `sys_options` (`name`, `value`, `category_id`, `caption`, `type`, `check`, `check_error`, `extra`, `order`) VALUES
+
+('bx_stream_engine', 'OvenMediaEngine', @iCategId, '_bx_stream_option_engine', 'select', '', '', 'OvenMediaEngine,NGINX', 10),
+
+('bx_stream_server_host', '', @iCategId, '_bx_stream_option_server_host', 'digit', '', '', '', 20),
+('bx_stream_app', '', @iCategId, '_bx_stream_option_app', 'digit', '', '', '', 22),
+('bx_stream_sources_pattern', '', @iCategId, '_bx_stream_option_sources_pattern', 'text', '', '', '', 24),
+('bx_stream_dash_enabled', '', @iCategId, '_bx_stream_option_dash_enabled', 'checkbox', '', '', '', 26),
+('bx_stream_hls_enabled', '', @iCategId, '_bx_stream_option_hls_enabled', 'checkbox', '', '', '', 28);
+
+INSERT INTO `sys_options_categories` (`type_id`, `name`, `caption`, `order`)
+VALUES (@iTypeId, 'bx_stream_engine_ome', '_bx_stream_options_cat_engine_ome', 2);
+SET @iCategId = LAST_INSERT_ID();
+
+INSERT INTO `sys_options` (`name`, `value`, `category_id`, `caption`, `type`, `check`, `check_error`, `extra`, `order`) VALUES
+
+('bx_stream_server_ome_api_key', '', @iCategId, '_bx_stream_option_ome_api_key', 'digit', '', '', '', 10),
+('bx_stream_server_ome_api_protocol', 'http', @iCategId, '_bx_stream_option_ome_api_protocol', 'select', '', '', 'http,https', 12),
+('bx_stream_server_ome_api_port', '8081', @iCategId, '_bx_stream_option_ome_api_port', 'digit', '', '', '', 14),
+('bx_stream_server_ome_policy_secret', '', @iCategId, '_bx_stream_option_ome_policy_secret', 'digit', '', '', '', 20);
+
+INSERT INTO `sys_options_categories` (`type_id`, `name`, `caption`, `order`)
+VALUES (@iTypeId, 'bx_stream_general', '_bx_stream_options_cat_general', 3);
+SET @iCategId = LAST_INSERT_ID();
+
+INSERT INTO `sys_options` (`name`, `value`, `category_id`, `caption`, `type`, `check`, `check_error`, `extra`, `order`) VALUES
+('bx_stream_enable_auto_approve', 'on', @iCategId, '_bx_stream_option_enable_auto_approve', 'checkbox', '', '', '', 100),
+('bx_stream_summary_chars', '700', @iCategId, '_bx_stream_option_summary_chars', 'digit', '', '', '', 110),
+('bx_stream_plain_summary_chars', '240', @iCategId, '_bx_stream_option_plain_summary_chars', 'digit', '', '', '', 120),
+('bx_stream_per_page_browse', '12', @iCategId, '_bx_stream_option_per_page_browse', 'digit', '', '', '', 130),
+('bx_stream_per_page_profile', '6', @iCategId, '_bx_stream_option_per_page_profile', 'digit', '', '', '', 140),
+('bx_stream_per_page_browse_showcase', '32', @iCategId, '_sys_option_per_page_browse_showcase', 'digit', '', '', '', 150),
+('bx_stream_rss_num', '10', @iCategId, '_bx_stream_option_rss_num', 'digit', '', '', '', 20),
+('bx_stream_auto_activation_for_categories', 'on', @iCategId, '_bx_stream_option_auto_activation_for_categories', 'checkbox', '', '', '', 160);
+
+-- PAGE: create entry
+
+INSERT INTO `sys_objects_page`(`object`, `title_system`, `title`, `module`, `layout_id`, `visible_for_levels`, `visible_for_levels_editable`, `uri`, `url`, `meta_description`, `meta_keywords`, `meta_robots`, `cache_lifetime`, `cache_editable`, `deletable`, `override_class_name`, `override_class_file`) VALUES 
+('bx_stream_create_entry', '_bx_stream_page_title_sys_create_entry', '_bx_stream_page_title_create_entry', 'bx_stream', 5, 2147483647, 1, 'create-stream', 'page.php?i=create-stream', '', '', '', 0, 1, 0, 'BxStrmPageBrowse', 'modules/boonex/stream/classes/BxStrmPageBrowse.php');
+
+INSERT INTO `sys_pages_blocks` (`object`, `cell_id`, `module`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `order`) VALUES
+('bx_stream_create_entry', 1, 'bx_stream', '_bx_stream_page_block_title_create_entry', 11, 2147483647, 'service', 'a:2:{s:6:"module";s:9:"bx_stream";s:6:"method";s:13:"entity_create";}', 0, 1, 1);
+
+
+-- PAGE: edit entry
+
+INSERT INTO `sys_objects_page`(`object`, `title_system`, `title`, `module`, `layout_id`, `visible_for_levels`, `visible_for_levels_editable`, `uri`, `url`, `meta_description`, `meta_keywords`, `meta_robots`, `cache_lifetime`, `cache_editable`, `deletable`, `override_class_name`, `override_class_file`) VALUES 
+('bx_stream_edit_entry', '_bx_stream_page_title_sys_edit_entry', '_bx_stream_page_title_edit_entry', 'bx_stream', 5, 2147483647, 1, 'edit-stream', '', '', '', '', 0, 1, 0, 'BxStrmPageEntry', 'modules/boonex/stream/classes/BxStrmPageEntry.php');
+
+INSERT INTO `sys_pages_blocks` (`object`, `cell_id`, `module`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `order`) VALUES
+('bx_stream_edit_entry', 1, 'bx_stream', '_bx_stream_page_block_title_edit_entry', 11, 2147483647, 'service', 'a:2:{s:6:"module";s:9:"bx_stream";s:6:"method";s:11:"entity_edit";}', 0, 0, 0);
+
+
+-- PAGE: delete entry
+
+INSERT INTO `sys_objects_page`(`object`, `title_system`, `title`, `module`, `layout_id`, `visible_for_levels`, `visible_for_levels_editable`, `uri`, `url`, `meta_description`, `meta_keywords`, `meta_robots`, `cache_lifetime`, `cache_editable`, `deletable`, `override_class_name`, `override_class_file`) VALUES 
+('bx_stream_delete_entry', '_bx_stream_page_title_sys_delete_entry', '_bx_stream_page_title_delete_entry', 'bx_stream', 5, 2147483647, 1, 'delete-stream', '', '', '', '', 0, 1, 0, 'BxStrmPageEntry', 'modules/boonex/stream/classes/BxStrmPageEntry.php');
+
+INSERT INTO `sys_pages_blocks` (`object`, `cell_id`, `module`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `order`) VALUES
+('bx_stream_delete_entry', 1, 'bx_stream', '_bx_stream_page_block_title_delete_entry', 11, 2147483647, 'service', 'a:2:{s:6:"module";s:9:"bx_stream";s:6:"method";s:13:"entity_delete";}', 0, 0, 0);
+
+
+-- PAGE: view entry
+
+INSERT INTO `sys_objects_page`(`object`, `title_system`, `title`, `module`, `layout_id`, `visible_for_levels`, `visible_for_levels_editable`, `uri`, `url`, `meta_description`, `meta_keywords`, `meta_robots`, `cache_lifetime`, `cache_editable`, `deletable`, `override_class_name`, `override_class_file`) VALUES 
+('bx_stream_view_entry', '_bx_stream_page_title_sys_view_entry', '_bx_stream_page_title_view_entry', 'bx_stream', 12, 2147483647, 1, 'view-stream', '', '', '', '', 0, 1, 0, 'BxStrmPageEntry', 'modules/boonex/stream/classes/BxStrmPageEntry.php');
+
+INSERT INTO `sys_pages_blocks`(`object`, `cell_id`, `module`, `title_system`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `active`, `order`) VALUES 
+('bx_stream_view_entry', 1, 'bx_stream', '', '_bx_stream_page_block_title_viewers', 13, 2147483647, 'service', 'a:2:{s:6:\"module\";s:9:\"bx_stream\";s:6:\"method\";s:14:\"stream_viewers\";}', 0, 0, 1, 1),
+('bx_stream_view_entry', 1, 'bx_stream', '', '_bx_stream_page_block_title_player', 3, 2147483647, 'service', 'a:2:{s:6:\"module\";s:9:\"bx_stream\";s:6:\"method\";s:13:\"stream_player\";}', 0, 0, 1, 2),
+('bx_stream_view_entry', 2, 'bx_stream', '', '_bx_stream_page_block_title_entry_text', 13, 2147483647, 'service', 'a:2:{s:6:\"module\";s:9:\"bx_stream\";s:6:\"method\";s:17:\"entity_text_block\";}', 0, 0, 1, 2),
+('bx_stream_view_entry', 3, 'bx_stream', '_bx_stream_page_block_title_sys_entry_context', '_bx_stream_page_block_title_entry_context', 13, 2147483647, 'service', 'a:2:{s:6:\"module\";s:9:\"bx_stream\";s:6:\"method\";s:14:\"entity_context\";}', 0, 0, 1, 1),
+('bx_stream_view_entry', 3, 'bx_stream', '', '_bx_stream_page_block_title_entry_info', 11, 2147483647, 'service', 'a:2:{s:6:\"module\";s:9:\"bx_stream\";s:6:\"method\";s:11:\"entity_info\";}', 0, 0, 1, 2),
+('bx_stream_view_entry', 3, 'bx_stream', '', '_bx_stream_page_block_title_entry_author', 13, 2147483647, 'service', 'a:2:{s:6:\"module\";s:9:\"bx_stream\";s:6:\"method\";s:13:\"entity_author\";}', 0, 0, 1, 3),
+('bx_stream_view_entry', 3, 'bx_stream', '', '_bx_stream_page_block_title_entry_rtmp_settings', 11, 2147483647, 'service', 'a:2:{s:6:\"module\";s:9:\"bx_stream\";s:6:\"method\";s:20:\"stream_rtmp_settings\";}', 0, 0, 1, 4),
+('bx_stream_view_entry', 3, 'bx_stream', '', '_bx_stream_page_block_title_entry_location', 13, 2147483647, 'service', 'a:2:{s:6:\"module\";s:9:\"bx_stream\";s:6:\"method\";s:15:\"entity_location\";}', 0, 0, 0, 0),
+('bx_stream_view_entry', 2, 'bx_stream', '', '_bx_stream_page_block_title_entry_all_actions', 13, 2147483647, 'service', 'a:2:{s:6:\"module\";s:9:\"bx_stream\";s:6:\"method\";s:18:\"entity_all_actions\";}', 0, 0, 1, 3),
+('bx_stream_view_entry', 4, 'bx_stream', '', '_bx_stream_page_block_title_entry_actions', 13, 2147483647, 'service', 'a:2:{s:6:\"module\";s:9:\"bx_stream\";s:6:\"method\";s:14:\"entity_actions\";}', 0, 0, 0, 0),
+('bx_stream_view_entry', 4, 'bx_stream', '', '_bx_stream_page_block_title_entry_social_sharing', 11, 2147483647, 'service', 'a:2:{s:6:\"module\";s:9:\"bx_stream\";s:6:\"method\";s:21:\"entity_social_sharing\";}', 0, 0, 0, 0),
+('bx_stream_view_entry', 2, 'bx_stream', '', '_bx_stream_page_block_title_entry_comments', 11, 2147483647, 'service', 'a:2:{s:6:\"module\";s:9:\"bx_stream\";s:6:\"method\";s:15:\"entity_comments\";}', 0, 0, 1, 6),
+('bx_stream_view_entry', 3, 'bx_stream', '', '_bx_stream_page_block_title_entry_location', 3, 2147483647, 'service', 'a:4:{s:6:\"module\";s:6:\"system\";s:6:\"method\";s:13:\"locations_map\";s:6:\"params\";a:2:{i:0;s:9:\"bx_stream\";i:1;s:4:\"{id}\";}s:5:\"class\";s:20:\"TemplServiceMetatags\";}', 0, 0, 1, 3),
+('bx_stream_view_entry', 2, 'bx_stream', '', '_bx_stream_page_block_title_entry_reports', 11, 2147483647, 'service', 'a:2:{s:6:\"module\";s:9:\"bx_stream\";s:6:\"method\";s:14:\"entity_reports\";}', 0, 0, 1, 6);
+
+
+-- PAGE: view entry comments
+
+INSERT INTO `sys_objects_page`(`object`, `title_system`, `title`, `module`, `layout_id`, `visible_for_levels`, `visible_for_levels_editable`, `uri`, `url`, `meta_description`, `meta_keywords`, `meta_robots`, `cache_lifetime`, `cache_editable`, `deletable`, `override_class_name`, `override_class_file`) VALUES 
+('bx_stream_view_entry_comments', '_bx_stream_page_title_sys_view_entry_comments', '_bx_stream_page_title_view_entry_comments', 'bx_stream', 5, 2147483647, 1, 'view-stream-comments', '', '', '', '', 0, 1, 0, 'BxStrmPageEntry', 'modules/boonex/stream/classes/BxStrmPageEntry.php');
+
+INSERT INTO `sys_pages_blocks`(`object`, `cell_id`, `module`, `title_system`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `order`) VALUES 
+('bx_stream_view_entry_comments', 1, 'bx_stream', '_bx_stream_page_block_title_entry_comments', '_bx_stream_page_block_title_entry_comments_link', 11, 2147483647, 'service', 'a:2:{s:6:\"module\";s:9:\"bx_stream\";s:6:\"method\";s:15:\"entity_comments\";}', 0, 0, 1);
+
+
+-- PAGE: module manage own
+INSERT INTO `sys_objects_page`(`object`, `title_system`, `title`, `module`, `layout_id`, `visible_for_levels`, `visible_for_levels_editable`, `uri`, `url`, `meta_description`, `meta_keywords`, `meta_robots`, `cache_lifetime`, `cache_editable`, `deletable`, `override_class_name`, `override_class_file`) VALUES 
+('bx_stream_manage', '_bx_stream_page_title_sys_manage', '_bx_stream_page_title_manage', 'bx_stream', 5, 2147483647, 1, 'streams-manage', 'page.php?i=streams-manage', '', '', '', 0, 1, 0, 'BxStrmPageBrowse', 'modules/boonex/stream/classes/BxStrmPageBrowse.php');
+
+INSERT INTO `sys_pages_blocks`(`object`, `cell_id`, `module`, `title_system`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `order`) VALUES 
+('bx_stream_manage', 1, 'bx_stream', '_bx_stream_page_block_title_system_manage', '_bx_stream_page_block_title_manage', 11, 2147483647, 'service', 'a:2:{s:6:\"module\";s:9:\"bx_stream\";s:6:\"method\";s:12:\"manage_tools\";}}', 0, 1, 0);
+
+-- PAGE: module manage all
+INSERT INTO `sys_objects_page`(`object`, `title_system`, `title`, `module`, `layout_id`, `visible_for_levels`, `visible_for_levels_editable`, `uri`, `url`, `meta_description`, `meta_keywords`, `meta_robots`, `cache_lifetime`, `cache_editable`, `deletable`, `override_class_name`, `override_class_file`) VALUES 
+('bx_stream_administration', '_bx_stream_page_title_sys_manage_administration', '_bx_stream_page_title_manage', 'bx_stream', 5, 192, 1, 'streams-administration', 'page.php?i=streams-administration', '', '', '', 0, 1, 0, 'BxStrmPageBrowse', 'modules/boonex/stream/classes/BxStrmPageBrowse.php');
+
+INSERT INTO `sys_pages_blocks`(`object`, `cell_id`, `module`, `title_system`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `order`) VALUES 
+('bx_stream_administration', 1, 'bx_stream', '_bx_stream_page_block_title_system_manage_administration', '_bx_stream_page_block_title_manage', 11, 192, 'service', 'a:3:{s:6:\"module\";s:9:\"bx_stream\";s:6:\"method\";s:12:\"manage_tools\";s:6:\"params\";a:1:{i:0;s:14:\"administration\";}}', 0, 1, 0);
+
+-- PAGE: add block to homepage
+
+SET @iBlockOrder = (SELECT `order` FROM `sys_pages_blocks` WHERE `object` = 'sys_home' AND `cell_id` = 1 ORDER BY `order` DESC LIMIT 1);
+INSERT INTO `sys_pages_blocks`(`object`, `cell_id`, `module`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `active`, `order`) VALUES 
+('sys_home', 1, 'bx_stream', '_bx_stream_page_block_title_recent_entries', 11, 2147483647, 'service', 'a:3:{s:6:"module";s:9:"bx_stream";s:6:"method";s:13:"browse_public";s:6:"params";a:2:{i:0;b:0;i:1;b:0;}}', 1, 0, 0, IFNULL(@iBlockOrder, 0) + 1);
+
+-- PAGES: add page block to profiles modules (trigger* page objects are processed separately upon modules enable/disable)
+SET @iPBCellProfile = 3;
+INSERT INTO `sys_pages_blocks` (`object`, `cell_id`, `module`, `title_system`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `order`) VALUES
+('trigger_page_profile_view_entry', @iPBCellProfile, 'bx_stream', '_bx_stream_page_block_title_sys_my_entries', '_bx_stream_page_block_title_my_entries', 11, 2147483647, 'service', 'a:3:{s:6:"module";s:9:"bx_stream";s:6:"method";s:13:"browse_author";s:6:"params";a:2:{i:0;s:12:"{profile_id}";i:1;a:2:{s:8:"per_page";s:26:"bx_stream_per_page_profile";s:13:"empty_message";b:0;}}}', 0, 0, 0);
+
+-- PAGE: service blocks
+
+SET @iBlockOrder = (SELECT `order` FROM `sys_pages_blocks` WHERE `object` = '' AND `cell_id` = 0 ORDER BY `order` DESC LIMIT 1);
+INSERT INTO `sys_pages_blocks`(`object`, `cell_id`, `module`, `title_system` , `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `order`) VALUES 
+('', 0, 'bx_stream', '', '_bx_stream_page_block_title_recent_entries', 11, 2147483647, 'service', 'a:3:{s:6:\"module\";s:9:\"bx_stream\";s:6:\"method\";s:13:\"browse_public\";s:6:\"params\";a:3:{s:9:\"unit_view\";s:7:\"gallery\";s:13:\"empty_message\";b:1;s:13:\"ajax_paginate\";b:0;}}', 0, 1, IFNULL(@iBlockOrder, 0) + 1);
+
+-- MENU: add to "add content" menu
+
+SET @iAddMenuOrder = (SELECT `order` FROM `sys_menu_items` WHERE `set_name` = 'sys_add_content_links' AND `active` = 1 ORDER BY `order` DESC LIMIT 1);
+INSERT INTO `sys_menu_items` (`set_name`, `module`, `name`, `title_system`, `title`, `link`, `onclick`, `target`, `icon`, `submenu_object`, `visible_for_levels`, `active`, `copyable`, `order`) VALUES 
+('sys_add_content_links', 'bx_stream', 'create-stream', '_bx_stream_menu_item_title_system_create_entry', '_bx_stream_menu_item_title_create_entry', 'page.php?i=create-stream', '', '', 'rss col-red3', '', 2147483647, 1, 1, IFNULL(@iAddMenuOrder, 0) + 1);
+
+-- MENU: actions menu for view entry 
+
+INSERT INTO `sys_objects_menu`(`object`, `title`, `set_name`, `module`, `template_id`, `deletable`, `active`, `override_class_name`, `override_class_file`) VALUES 
+('bx_stream_view', '_bx_stream_menu_title_view_entry', 'bx_stream_view', 'bx_stream', 9, 0, 1, 'BxStrmMenuView', 'modules/boonex/stream/classes/BxStrmMenuView.php');
+
+INSERT INTO `sys_menu_sets`(`set_name`, `module`, `title`, `deletable`) VALUES 
+('bx_stream_view', 'bx_stream', '_bx_stream_menu_set_title_view_entry', 0);
+
+INSERT INTO `sys_menu_items`(`set_name`, `module`, `name`, `title_system`, `title`, `link`, `onclick`, `target`, `icon`, `submenu_object`, `visible_for_levels`, `active`, `copyable`, `order`) VALUES 
+('bx_stream_view', 'bx_stream', 'edit-stream', '_bx_stream_menu_item_title_system_edit_entry', '_bx_stream_menu_item_title_edit_entry', 'page.php?i=edit-stream&id={content_id}', '', '', 'pencil-alt', '', 2147483647, 1, 0, 1),
+('bx_stream_view', 'bx_stream', 'delete-stream', '_bx_stream_menu_item_title_system_delete_entry', '_bx_stream_menu_item_title_delete_entry', 'page.php?i=delete-stream&id={content_id}', '', '', 'remove', '', 2147483647, 1, 0, 2),
+('bx_stream_view', 'bx_stream', 'approve', '_sys_menu_item_title_system_va_approve', '_sys_menu_item_title_va_approve', 'javascript:void(0)', 'javascript:bx_approve(this, ''{module_uri}'', {content_id});', '', 'check', '', 2147483647, 1, 0, 3);
+
+
+-- MENU: all actions menu for view entry 
+
+INSERT INTO `sys_objects_menu`(`object`, `title`, `set_name`, `module`, `template_id`, `deletable`, `active`, `override_class_name`, `override_class_file`) VALUES 
+('bx_stream_view_actions', '_sys_menu_title_view_actions', 'bx_stream_view_actions', 'bx_stream', 15, 0, 1, 'BxStrmMenuViewActions', 'modules/boonex/stream/classes/BxStrmMenuViewActions.php');
+
+INSERT INTO `sys_menu_sets`(`set_name`, `module`, `title`, `deletable`) VALUES 
+('bx_stream_view_actions', 'bx_stream', '_sys_menu_set_title_view_actions', 0);
+
+INSERT INTO `sys_menu_items`(`set_name`, `module`, `name`, `title_system`, `title`, `link`, `onclick`, `target`, `icon`, `addon`, `submenu_object`, `submenu_popup`, `visible_for_levels`, `visibility_custom`, `active`, `copyable`, `order`) VALUES 
+('bx_stream_view_actions', 'bx_stream', 'edit-stream', '_bx_stream_menu_item_title_system_edit_entry', '', '', '', '', '', '', '', 0, 2147483647, '', 1, 0, 10),
+('bx_stream_view_actions', 'bx_stream', 'delete-stream', '_bx_stream_menu_item_title_system_delete_entry', '', '', '', '', '', '', '', 0, 2147483647, '', 1, 0, 20),
+('bx_stream_view_actions', 'bx_stream', 'approve', '_sys_menu_item_title_system_va_approve', '', '', '', '', '', '', '', 0, 2147483647, '', 1, 0, 30),
+('bx_stream_view_actions', 'bx_stream', 'set-badges', '_sys_menu_item_title_system_set_badges', '_sys_menu_item_title_set_badges', 'javascript:void(0)', 'bx_menu_popup(''sys_set_badges'', window, {}, {module: ''bx_stream'', content_id: {content_id}});', '', 'check-circle', '', '', 0, 2147483647, 'a:2:{s:6:"module";s:9:"bx_stream";s:6:"method";s:19:"is_badges_avaliable";}', 1, 0, 40),
+('bx_stream_view_actions', 'bx_stream', 'comment', '_sys_menu_item_title_system_va_comment', '', '', '', '', '', '', '', 0, 2147483647, '', 0, 0, 200),
+('bx_stream_view_actions', 'bx_stream', 'view', '_sys_menu_item_title_system_va_view', '', '', '', '', '', '', '', 0, 2147483647, '', 1, 0, 210),
+('bx_stream_view_actions', 'bx_stream', 'vote', '_sys_menu_item_title_system_va_vote', '', '', '', '', '', '', '', 0, 2147483647, '', 0, 0, 220),
+('bx_stream_view_actions', 'bx_stream', 'reaction', '_sys_menu_item_title_system_va_reaction', '', '', '', '', '', '', '', 0, 2147483647, '', 1, 0, 225),
+('bx_stream_view_actions', 'bx_stream', 'score', '_sys_menu_item_title_system_va_score', '', '', '', '', '', '', '', 0, 2147483647, '', 1, 0, 230),
+('bx_stream_view_actions', 'bx_stream', 'feature', '_sys_menu_item_title_system_va_feature', '', '', '', '', '', '', '', 0, 2147483647, '', 1, 0, 250),
+('bx_stream_view_actions', 'bx_stream', 'repost', '_sys_menu_item_title_system_va_repost', '', '', '', '', '', '', '', 0, 2147483647, '', 1, 0, 260),
+('bx_stream_view_actions', 'bx_stream', 'report', '_sys_menu_item_title_system_va_report', '', '', '', '', '', '', '', 0, 2147483647, '', 1, 0, 270),
+('bx_stream_view_actions', 'bx_stream', 'notes', '_sys_menu_item_title_system_va_notes', '_sys_menu_item_title_va_notes', 'javascript:void(0)', 'javascript:bx_get_notes(this,  ''{module_uri}'', {content_id});', '', 'exclamation-triangle', '', '', 0, 2147483647, '', 1, 0, 280),
+('bx_stream_view_actions', 'bx_stream', 'audit', '_sys_menu_item_title_system_va_audit', '_sys_menu_item_title_va_audit', 'page.php?i=dashboard-audit&module=bx_stream&content_id={content_id}', '', '', 'history', '', '', 0, 192, '', 1, 0, 290),
+('bx_stream_view_actions', 'bx_stream', 'social-sharing-facebook', '_sys_menu_item_title_system_social_sharing_facebook', '', '', '', '', '', '', '', 0, 2147483647, '', 1, 0, 300),
+('bx_stream_view_actions', 'bx_stream', 'social-sharing-twitter', '_sys_menu_item_title_system_social_sharing_twitter', '', '', '', '', '', '', '', 0, 2147483647, '', 1, 0, 320),
+('bx_stream_view_actions', 'bx_stream', 'social-sharing-pinterest', '_sys_menu_item_title_system_social_sharing_pinterest', '', '', '', '', '', '', '', 0, 2147483647, '', 1, 0, 330),
+('bx_stream_view_actions', 'bx_stream', 'more-auto', '_sys_menu_item_title_system_va_more_auto', '_sys_menu_item_title_va_more_auto', 'javascript:void(0)', '', '', 'ellipsis-v', '', '', 0, 2147483647, '', 1, 0, 9999);
+
+
+-- MENU: custom menu for snippet meta info
+INSERT INTO `sys_objects_menu`(`object`, `title`, `set_name`, `module`, `template_id`, `deletable`, `active`, `override_class_name`, `override_class_file`) VALUES 
+('bx_stream_snippet_meta', '_sys_menu_title_snippet_meta', 'bx_stream_snippet_meta', 'bx_stream', 15, 0, 1, 'BxStrmMenuSnippetMeta', 'modules/boonex/stream/classes/BxStrmMenuSnippetMeta.php');
+
+INSERT INTO `sys_menu_sets`(`set_name`, `module`, `title`, `deletable`) VALUES 
+('bx_stream_snippet_meta', 'bx_stream', '_sys_menu_set_title_snippet_meta', 0);
+
+INSERT INTO `sys_menu_items`(`set_name`, `module`, `name`, `title_system`, `title`, `link`, `onclick`, `target`, `icon`, `submenu_object`, `visible_for_levels`, `active`, `copyable`, `editable`, `order`) VALUES 
+('bx_stream_snippet_meta', 'bx_stream', 'date', '_sys_menu_item_title_system_sm_date', '_sys_menu_item_title_sm_date', '', '', '', '', '', 2147483647, 1, 0, 1, 1),
+('bx_stream_snippet_meta', 'bx_stream', 'author', '_sys_menu_item_title_system_sm_author', '_sys_menu_item_title_sm_author', '', '', '', '', '', 2147483647, 1, 0, 1, 2),
+('bx_stream_snippet_meta', 'bx_stream', 'category', '_sys_menu_item_title_system_sm_category', '_sys_menu_item_title_sm_category', '', '', '', '', '', 2147483647, 0, 0, 1, 3),
+('bx_stream_snippet_meta', 'bx_stream', 'tags', '_sys_menu_item_title_system_sm_tags', '_sys_menu_item_title_sm_tags', '', '', '', '', '', 2147483647, 0, 0, 1, 4),
+('bx_stream_snippet_meta', 'bx_stream', 'views', '_sys_menu_item_title_system_sm_views', '_sys_menu_item_title_sm_views', '', '', '', '', '', 2147483647, 0, 0, 1, 5),
+('bx_stream_snippet_meta', 'bx_stream', 'comments', '_sys_menu_item_title_system_sm_comments', '_sys_menu_item_title_sm_comments', '', '', '', '', '', 2147483647, 0, 0, 1, 6);
+
+-- MENU: profile stats
+SET @iNotifMenuOrder = (SELECT IFNULL(MAX(`order`), 0) FROM `sys_menu_items` WHERE `set_name` = 'sys_profile_stats' AND `active` = 1 LIMIT 1);
+INSERT INTO `sys_menu_items` (`set_name`, `module`, `name`, `title_system`, `title`, `link`, `onclick`, `target`, `icon`, `addon`, `submenu_object`, `visible_for_levels`, `active`, `copyable`, `order`) VALUES
+('sys_profile_stats', 'bx_stream', 'profile-stats-manage-streams', '_bx_stream_menu_item_title_system_manage_my_stream', '_bx_stream_menu_item_title_manage_my_stream', 'page.php?i=streams-manage', '', '_self', 'rss col-red3', 'a:2:{s:6:"module";s:9:"bx_stream";s:6:"method";s:41:"get_menu_addon_manage_tools_profile_stats";}', '', 2147483646, 1, 0, @iNotifMenuOrder + 1);
+
+-- MENU: manage tools submenu
+INSERT INTO `sys_objects_menu`(`object`, `title`, `set_name`, `module`, `template_id`, `deletable`, `active`, `override_class_name`, `override_class_file`) VALUES 
+('bx_stream_menu_manage_tools', '_bx_stream_menu_title_manage_tools', 'bx_stream_menu_manage_tools', 'bx_stream', 6, 0, 1, 'BxStrmMenuManageTools', 'modules/boonex/stream/classes/BxStrmMenuManageTools.php');
+
+INSERT INTO `sys_menu_sets`(`set_name`, `module`, `title`, `deletable`) VALUES 
+('bx_stream_menu_manage_tools', 'bx_stream', '_bx_stream_menu_set_title_manage_tools', 0);
+
+--INSERT INTO `sys_menu_items`(`set_name`, `module`, `name`, `title_system`, `title`, `link`, `onclick`, `target`, `icon`, `submenu_object`, `visible_for_levels`, `active`, `copyable`, `order`) VALUES 
+--('bx_stream_menu_manage_tools', 'bx_stream', 'delete-with-content', '_bx_stream_menu_item_title_system_delete_with_content', '_bx_stream_menu_item_title_delete_with_content', 'javascript:void(0)', 'javascript:{js_object}.onClickDeleteWithContent({content_id});', '_self', 'far trash-alt', '', 128, 1, 0, 0);
+
+-- MENU: dashboard manage tools
+SET @iManageMenuOrder = (SELECT IFNULL(MAX(`order`), 0) FROM `sys_menu_items` WHERE `set_name`='sys_account_dashboard_manage_tools' LIMIT 1);
+INSERT INTO `sys_menu_items`(`set_name`, `module`, `name`, `title_system`, `title`, `link`, `onclick`, `target`, `icon`, `addon`, `submenu_object`, `visible_for_levels`, `active`, `copyable`, `order`) VALUES 
+('sys_account_dashboard_manage_tools', 'bx_stream', 'streams-administration', '_bx_stream_menu_item_title_system_admt_stream', '_bx_stream_menu_item_title_admt_stream', 'page.php?i=streams-administration', '', '_self', 'rss', 'a:2:{s:6:"module";s:8:"bx_stream";s:6:"method";s:27:"get_menu_addon_manage_tools";}', '', 192, 1, 0, @iManageMenuOrder + 1);
+
+
+-- PRIVACY 
+
+INSERT INTO `sys_objects_privacy` (`object`, `module`, `action`, `title`, `default_group`, `table`, `table_field_id`, `table_field_author`, `override_class_name`, `override_class_file`) VALUES
+('bx_stream_allow_view_to', 'bx_stream', 'view', '_bx_stream_form_entry_input_allow_view_to', '3', 'bx_stream_streams', 'id', 'author', '', '');
+
+-- ACL
+
+INSERT INTO `sys_acl_actions` (`Module`, `Name`, `AdditionalParamName`, `Title`, `Desc`, `Countable`, `DisabledForLevels`) VALUES
+('bx_stream', 'create entry', NULL, '_bx_stream_acl_action_create_entry', '', 1, 3);
+SET @iIdActionEntryCreate = LAST_INSERT_ID();
+
+INSERT INTO `sys_acl_actions` (`Module`, `Name`, `AdditionalParamName`, `Title`, `Desc`, `Countable`, `DisabledForLevels`) VALUES
+('bx_stream', 'delete entry', NULL, '_bx_stream_acl_action_delete_entry', '', 1, 3);
+SET @iIdActionEntryDelete = LAST_INSERT_ID();
+
+INSERT INTO `sys_acl_actions` (`Module`, `Name`, `AdditionalParamName`, `Title`, `Desc`, `Countable`, `DisabledForLevels`) VALUES
+('bx_stream', 'view entry', NULL, '_bx_stream_acl_action_view_entry', '', 1, 0);
+SET @iIdActionEntryView = LAST_INSERT_ID();
+
+INSERT INTO `sys_acl_actions` (`Module`, `Name`, `AdditionalParamName`, `Title`, `Desc`, `Countable`, `DisabledForLevels`) VALUES
+('bx_stream', 'edit any entry', NULL, '_bx_stream_acl_action_edit_any_entry', '', 1, 3);
+SET @iIdActionEntryEditAny = LAST_INSERT_ID();
+
+INSERT INTO `sys_acl_actions` (`Module`, `Name`, `AdditionalParamName`, `Title`, `Desc`, `Countable`, `DisabledForLevels`) VALUES
+('bx_stream', 'delete any entry', NULL, '_bx_stream_acl_action_delete_any_entry', '', 1, 3);
+SET @iIdActionEntryDeleteAny = LAST_INSERT_ID();
+
+SET @iUnauthenticated = 1;
+SET @iAccount = 2;
+SET @iStandard = 3;
+SET @iUnconfirmed = 4;
+SET @iPending = 5;
+SET @iSuspended = 6;
+SET @iModerator = 7;
+SET @iAdministrator = 8;
+SET @iPremium = 9;
+
+INSERT INTO `sys_acl_matrix` (`IDLevel`, `IDAction`) VALUES
+
+-- entry create
+(@iModerator, @iIdActionEntryCreate),
+(@iAdministrator, @iIdActionEntryCreate),
+(@iPremium, @iIdActionEntryCreate),
+
+-- entry delete
+(@iModerator, @iIdActionEntryDelete),
+(@iAdministrator, @iIdActionEntryDelete),
+(@iPremium, @iIdActionEntryDelete),
+
+-- entry view
+(@iUnauthenticated, @iIdActionEntryView),
+(@iAccount, @iIdActionEntryView),
+(@iStandard, @iIdActionEntryView),
+(@iUnconfirmed, @iIdActionEntryView),
+(@iPending, @iIdActionEntryView),
+(@iModerator, @iIdActionEntryView),
+(@iAdministrator, @iIdActionEntryView),
+(@iPremium, @iIdActionEntryView),
+
+-- edit any entry
+(@iModerator, @iIdActionEntryEditAny),
+(@iAdministrator, @iIdActionEntryEditAny),
+
+-- delete any entry
+(@iAdministrator, @iIdActionEntryDeleteAny);
+
+-- METATAGS
+INSERT INTO `sys_objects_metatags` (`object`, `table_keywords`, `table_locations`, `table_mentions`, `override_class_name`, `override_class_file`) VALUES
+('bx_stream', 'bx_stream_meta_keywords', 'bx_stream_meta_locations', 'bx_stream_meta_mentions', '', '');
+
+-- CATEGORY
+INSERT INTO `sys_objects_category` (`object`, `search_object`, `form_object`, `list_name`, `table`, `field`, `join`, `where`, `override_class_name`, `override_class_file`) VALUES
+('bx_stream_cats', '', 'bx_stream', 'bx_stream_cats', 'bx_stream_streams', 'cat', 'INNER JOIN `sys_profiles` ON (`sys_profiles`.`id` = ABS(`bx_stream_streams`.`author`))', 'AND `sys_profiles`.`status` = ''active''', '', '');
+
+-- STATS
+SET @iMaxOrderStats = (SELECT IFNULL(MAX(`order`), 0) FROM `sys_statistics`);
+INSERT INTO `sys_statistics` (`module`, `name`, `title`, `link`, `icon`, `query`, `order`) VALUES 
+('bx_stream', 'bx_stream', '_bx_stream', 'page.php?i=streams-home', 'rss col-red3', 'SELECT COUNT(*) FROM `bx_stream_streams` WHERE 1 AND `status` = ''active'' AND `status_admin` = ''active''', @iMaxOrderStats + 1);
+
+-- CHARTS
+SET @iMaxOrderCharts = (SELECT IFNULL(MAX(`order`), 0) FROM `sys_objects_chart`);
+INSERT INTO `sys_objects_chart` (`object`, `title`, `table`, `field_date_ts`, `field_date_dt`, `field_status`, `query`, `active`, `order`, `class_name`, `class_file`) VALUES
+('bx_stream_growth', '_bx_stream_chart_growth', 'bx_stream_streams', 'added', '', 'status,status_admin', '', 1, @iMaxOrderCharts + 1, 'BxDolChartGrowth', ''),
+('bx_stream_growth_speed', '_bx_stream_chart_growth_speed', 'bx_stream_streams', 'added', '', 'status,status_admin', '', 1, @iMaxOrderCharts + 2, 'BxDolChartGrowthSpeed', '');
+
+-- GRIDS: moderation tools
+INSERT INTO `sys_objects_grid` (`object`, `source_type`, `source`, `table`, `field_id`, `field_order`, `field_active`, `paginate_url`, `paginate_per_page`, `paginate_simple`, `paginate_get_start`, `paginate_get_per_page`, `filter_fields`, `filter_fields_translatable`, `filter_mode`, `sorting_fields`, `sorting_fields_translatable`, `visible_for_levels`, `override_class_name`, `override_class_file`) VALUES
+('bx_stream_administration', 'Sql', 'SELECT * FROM `bx_stream_streams` WHERE 1 ', 'bx_stream_streams', 'id', 'added', 'status_admin', '', 20, NULL, 'start', '', 'title,text', '', 'like', 'reports', '', 192, 'BxStrmGridAdministration', 'modules/boonex/stream/classes/BxStrmGridAdministration.php'),
+('bx_stream_common', 'Sql', 'SELECT * FROM `bx_stream_streams` WHERE 1 ', 'bx_stream_streams', 'id', 'added', 'status', '', 20, NULL, 'start', '', 'title,text', '', 'like', '', '', 2147483647, 'BxStrmGridCommon', 'modules/boonex/stream/classes/BxStrmGridCommon.php');
+
+INSERT INTO `sys_grid_fields` (`object`, `name`, `title`, `width`, `translatable`, `chars_limit`, `params`, `order`) VALUES
+('bx_stream_administration', 'checkbox', '_sys_select', '2%', 0, '', '', 1),
+('bx_stream_administration', 'switcher', '_bx_stream_grid_column_title_adm_active', '8%', 0, '', '', 2),
+('bx_stream_administration', 'reports', '_sys_txt_reports_title', '5%', 0, '', '', 3),
+('bx_stream_administration', 'title', '_bx_stream_grid_column_title_adm_title', '25%', 0, '25', '', 4),
+('bx_stream_administration', 'added', '_bx_stream_grid_column_title_adm_added', '20%', 1, '25', '', 5),
+('bx_stream_administration', 'author', '_bx_stream_grid_column_title_adm_author', '20%', 0, '25', '', 6),
+('bx_stream_administration', 'actions', '', '20%', 0, '', '', 7),
+
+('bx_stream_common', 'checkbox', '_sys_select', '2%', 0, '', '', 1),
+('bx_stream_common', 'switcher', '_bx_stream_grid_column_title_adm_active', '8%', 0, '', '', 2),
+('bx_stream_common', 'title', '_bx_stream_grid_column_title_adm_title', '40%', 0, '35', '', 3),
+('bx_stream_common', 'added', '_bx_stream_grid_column_title_adm_added', '15%', 1, '25', '', 4),
+('bx_stream_common', 'status_admin', '_bx_stream_grid_column_title_adm_status_admin', '15%', 0, '16', '', 5),
+('bx_stream_common', 'actions', '', '20%', 0, '', '', 6);
+
+
+INSERT INTO `sys_grid_actions` (`object`, `type`, `name`, `title`, `icon`, `icon_only`, `confirm`, `order`) VALUES
+('bx_stream_administration', 'bulk', 'delete', '_bx_stream_grid_action_title_adm_delete', '', 0, 1, 1),
+('bx_stream_administration', 'bulk', 'clear_reports', '_bx_stream_grid_action_title_adm_clear_reports', '', 0, 1, 1),
+('bx_stream_administration', 'single', 'edit', '_bx_stream_grid_action_title_adm_edit', 'pencil-alt', 1, 0, 1),
+('bx_stream_administration', 'single', 'delete', '_bx_stream_grid_action_title_adm_delete', 'remove', 1, 1, 2),
+('bx_stream_administration', 'single', 'settings', '_bx_stream_grid_action_title_adm_more_actions', 'cog', 1, 0, 3),
+('bx_stream_administration', 'single', 'audit_content', '_bx_stream_grid_action_title_adm_audit_content', 'search', 1, 0, 4),
+('bx_stream_administration', 'single', 'clear_reports', '_bx_stream_grid_action_title_adm_clear_reports', 'eraser', 1, 0, 5),
+
+('bx_stream_common', 'bulk', 'delete', '_bx_stream_grid_action_title_adm_delete', '', 0, 1, 1),
+('bx_stream_common', 'single', 'edit', '_bx_stream_grid_action_title_adm_edit', 'pencil-alt', 1, 0, 1),
+('bx_stream_common', 'single', 'delete', '_bx_stream_grid_action_title_adm_delete', 'remove', 1, 1, 2),
+('bx_stream_common', 'single', 'settings', '_bx_stream_grid_action_title_adm_more_actions', 'cog', 1, 0, 3);
+
+-- UPLOADERS
+
+INSERT INTO `sys_objects_uploader` (`object`, `active`, `override_class_name`, `override_class_file`) VALUES
+('bx_stream_simple', 1, 'BxStrmUploaderSimple', 'modules/boonex/stream/classes/BxStrmUploaderSimple.php'),
+('bx_stream_html5', 1, 'BxStrmUploaderHTML5', 'modules/boonex/stream/classes/BxStrmUploaderHTML5.php');
+
+-- ALERTS
+
+INSERT INTO `sys_alerts_handlers` (`name`, `class`, `file`, `service_call`) VALUES 
+('bx_stream', 'BxStrmAlertsResponse', 'modules/boonex/stream/classes/BxStrmAlertsResponse.php', '');
+SET @iHandler := LAST_INSERT_ID();
+
+INSERT INTO `sys_alerts` (`unit`, `action`, `handler_id`) VALUES
+('system', 'save_setting', @iHandler),
+('profile', 'delete', @iHandler);
+
+-- CRON
+
+INSERT INTO `sys_cron_jobs` (`name`, `time`, `class`, `file`, `service_call`) VALUES
+('bx_stream_publishing', '* * * * *', 'BxStrmCronPublishing', 'modules/boonex/stream/classes/BxStrmCronPublishing.php', '');

+ 399 - 0
modules/boonex/stream/install/sql/install.sql

@@ -0,0 +1,399 @@
+-- TABLE: entries
+CREATE TABLE IF NOT EXISTS `bx_stream_streams` (
+  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
+  `author` int(11) NOT NULL,
+  `added` int(11) NOT NULL,
+  `changed` int(11) NOT NULL,
+  `published` int(11) NOT NULL,
+  `thumb` int(11) NOT NULL,
+  `title` varchar(255) NOT NULL,
+  `cat` int(11) NOT NULL,
+  `multicat` text NOT NULL,
+  `text` mediumtext NOT NULL,
+  `key` varchar(12) NOT NULL,
+  `labels` text NOT NULL,
+  `location` text NOT NULL,
+  `views` int(11) NOT NULL default '0',
+  `rate` float NOT NULL default '0',
+  `votes` int(11) NOT NULL default '0',
+  `rrate` float NOT NULL default '0',
+  `rvotes` 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',
+  `comments` int(11) NOT NULL default '0',
+  `reports` int(11) NOT NULL default '0',
+  `featured` int(11) NOT NULL default '0',
+  `allow_view_to` varchar(16) NOT NULL DEFAULT '3',
+  `disable_comments` tinyint(4) NOT NULL DEFAULT '0',
+  `status` enum('active','awaiting','failed','hidden') NOT NULL DEFAULT 'active',
+  `status_admin` enum('active','hidden','pending') NOT NULL DEFAULT 'active',
+  PRIMARY KEY (`id`),
+  FULLTEXT KEY `title_text` (`title`,`text`)
+);
+
+-- TABLE: storages & transcoders
+CREATE TABLE IF NOT EXISTS `bx_stream_covers` (
+  `id` int(11) NOT NULL AUTO_INCREMENT,
+  `profile_id` int(10) unsigned NOT NULL,
+  `remote_id` varchar(128) NOT NULL,
+  `path` varchar(255) NOT NULL,
+  `file_name` varchar(255) NOT NULL,
+  `mime_type` varchar(128) NOT NULL,
+  `ext` varchar(32) NOT NULL,
+  `size` bigint(20) NOT NULL,
+  `added` int(11) NOT NULL,
+  `modified` int(11) NOT NULL,
+  `private` int(11) NOT NULL,
+  PRIMARY KEY (`id`),
+  UNIQUE KEY `remote_id` (`remote_id`)
+);
+
+CREATE TABLE IF NOT EXISTS `bx_stream_photos_resized` (
+  `id` int(11) NOT NULL AUTO_INCREMENT,
+  `profile_id` int(10) unsigned NOT NULL,
+  `remote_id` varchar(128) NOT NULL,
+  `path` varchar(255) NOT NULL,
+  `file_name` varchar(255) NOT NULL,
+  `mime_type` varchar(128) NOT NULL,
+  `ext` varchar(32) NOT NULL,
+  `size` bigint(20) NOT NULL,
+  `added` int(11) NOT NULL,
+  `modified` int(11) NOT NULL,
+  `private` int(11) NOT NULL,
+  PRIMARY KEY (`id`),
+  UNIQUE KEY `remote_id` (`remote_id`)
+);
+
+-- TABLE: comments
+CREATE TABLE IF NOT EXISTS `bx_stream_cmts` (
+  `cmt_id` int(11) NOT NULL AUTO_INCREMENT,
+  `cmt_parent_id` int(11) NOT NULL DEFAULT '0',
+  `cmt_vparent_id` int(11) NOT NULL DEFAULT '0',
+  `cmt_object_id` int(11) NOT NULL DEFAULT '0',
+  `cmt_author_id` int(11) NOT NULL DEFAULT '0',
+  `cmt_level` int(11) NOT NULL DEFAULT '0',
+  `cmt_text` text NOT NULL,
+  `cmt_mood` tinyint(4) NOT NULL DEFAULT '0',
+  `cmt_rate` int(11) NOT NULL DEFAULT '0',
+  `cmt_rate_count` int(11) NOT NULL DEFAULT '0',
+  `cmt_time` int(11) unsigned NOT NULL DEFAULT '0',
+  `cmt_replies` int(11) NOT NULL DEFAULT '0',
+  `cmt_pinned` int(11) NOT NULL default '0',
+  PRIMARY KEY (`cmt_id`),
+  KEY `cmt_object_id` (`cmt_object_id`,`cmt_parent_id`),
+  FULLTEXT KEY `search_fields` (`cmt_text`)
+);
+
+CREATE TABLE IF NOT EXISTS `bx_stream_cmts_notes` (
+  `cmt_id` int(11) NOT NULL AUTO_INCREMENT,
+  `cmt_parent_id` int(11) NOT NULL DEFAULT '0',
+  `cmt_vparent_id` int(11) NOT NULL DEFAULT '0',
+  `cmt_object_id` int(11) NOT NULL DEFAULT '0',
+  `cmt_author_id` int(11) NOT NULL DEFAULT '0',
+  `cmt_level` int(11) NOT NULL DEFAULT '0',
+  `cmt_text` text NOT NULL,
+  `cmt_mood` tinyint(4) NOT NULL DEFAULT '0',
+  `cmt_rate` int(11) NOT NULL DEFAULT '0',
+  `cmt_rate_count` int(11) NOT NULL DEFAULT '0',
+  `cmt_time` int(11) unsigned NOT NULL DEFAULT '0',
+  `cmt_replies` int(11) NOT NULL DEFAULT '0',
+  `cmt_pinned` int(11) NOT NULL default '0',
+  PRIMARY KEY (`cmt_id`),
+  KEY `cmt_object_id` (`cmt_object_id`,`cmt_parent_id`),
+  FULLTEXT KEY `search_fields` (`cmt_text`)
+);
+
+-- TABLE: votes
+CREATE TABLE IF NOT EXISTS `bx_stream_votes` (
+  `object_id` int(11) NOT NULL default '0',
+  `count` int(11) NOT NULL default '0',
+  `sum` int(11) NOT NULL default '0',
+  UNIQUE KEY `object_id` (`object_id`)
+);
+
+CREATE TABLE IF NOT EXISTS `bx_stream_votes_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',
+  `value` tinyint(4) NOT NULL default '0',
+  `date` int(11) NOT NULL default '0',
+  PRIMARY KEY (`id`),
+  KEY `vote` (`object_id`, `author_nip`)
+);
+
+CREATE TABLE IF NOT EXISTS `bx_stream_reactions` (
+  `object_id` int(11) NOT NULL default '0',
+  `reaction` varchar(32) NOT NULL default '',
+  `count` int(11) NOT NULL default '0',
+  `sum` int(11) NOT NULL default '0',
+  UNIQUE KEY `reaction` (`object_id`, `reaction`)
+);
+
+CREATE TABLE IF NOT EXISTS `bx_stream_reactions_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',
+  `reaction` varchar(32) NOT NULL default '',
+  `value` tinyint(4) NOT NULL default '0',
+  `date` int(11) NOT NULL default '0',
+  PRIMARY KEY (`id`),
+  KEY `vote` (`object_id`, `author_nip`)
+);
+
+-- TABLE: views
+CREATE TABLE `bx_stream_views_track` (
+  `object_id` int(11) NOT NULL default '0',
+  `viewer_id` int(11) NOT NULL default '0',
+  `viewer_nip` int(11) unsigned NOT NULL default '0',
+  `date` int(11) NOT NULL default '0',
+  KEY `id` (`object_id`,`viewer_id`,`viewer_nip`)
+);
+
+-- TABLE: metas
+CREATE TABLE `bx_stream_meta_keywords` (
+  `object_id` int(10) unsigned NOT NULL,
+  `keyword` varchar(255) NOT NULL,
+  KEY `object_id` (`object_id`),
+  KEY `keyword` (`keyword`)
+);
+
+CREATE TABLE `bx_stream_meta_mentions` (
+  `object_id` int(10) unsigned NOT NULL,
+  `profile_id` int(10) unsigned NOT NULL,
+  KEY `object_id` (`object_id`),
+  KEY `profile_id` (`profile_id`)
+);
+
+CREATE TABLE `bx_stream_meta_locations` (
+  `object_id` int(10) unsigned NOT NULL,
+  `lat` double NOT NULL,
+  `lng` double NOT NULL,
+  `country` varchar(2) NOT NULL,
+  `state` varchar(255) NOT NULL,
+  `city` varchar(255) NOT NULL,
+  `zip` varchar(255) NOT NULL,
+  `street` varchar(255) NOT NULL,
+  `street_number` varchar(255) NOT NULL,
+  PRIMARY KEY (`object_id`),
+  KEY `country_state_city` (`country`,`state`(8),`city`(8))
+);
+
+-- TABLE: reports
+CREATE TABLE IF NOT EXISTS `bx_stream_reports` (
+  `object_id` int(11) NOT NULL default '0',
+  `count` int(11) NOT NULL default '0',
+  UNIQUE KEY `object_id` (`object_id`)
+);
+
+CREATE TABLE IF NOT EXISTS `bx_stream_reports_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(32) NOT NULL default '',
+  `text` text NOT NULL default '',
+  `date` int(11) NOT NULL default '0',
+  `checked_by` int(11) NOT NULL default '0',
+  `status` tinyint(11) NOT NULL default '0',
+  PRIMARY KEY (`id`),
+  KEY `report` (`object_id`, `author_nip`)
+);
+
+-- TABLE: scores
+CREATE TABLE IF NOT EXISTS `bx_stream_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_stream_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');
+
+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
+('bx_stream_covers', @sStorageEngine, '', 360, 2592000, 3, 'bx_stream_covers', 'allow-deny', 'jpg,jpeg,jpe,gif,png', '', 0, 0, 0, 0, 0, 0),
+
+('bx_stream_photos_resized', @sStorageEngine, '', 360, 2592000, 3, 'bx_stream_photos_resized', 'allow-deny', 'jpg,jpeg,jpe,gif,png', '', 0, 0, 0, 0, 0, 0);
+
+
+INSERT INTO `sys_objects_transcoder` (`object`, `storage_object`, `source_type`, `source_params`, `private`, `atime_tracking`, `atime_pruning`, `ts`, `override_class_name`, `override_class_file`) VALUES 
+('bx_stream_preview', 'bx_stream_photos_resized', 'Storage', 'a:1:{s:6:"object";s:16:"bx_stream_covers";}', 'no', '1', '2592000', '0', '', ''),
+('bx_stream_gallery', 'bx_stream_photos_resized', 'Storage', 'a:1:{s:6:"object";s:16:"bx_stream_covers";}', 'no', '1', '2592000', '0', '', ''),
+('bx_stream_cover', 'bx_stream_photos_resized', 'Storage', 'a:1:{s:6:"object";s:16:"bx_stream_covers";}', 'no', '1', '2592000', '0', '', '');
+
+INSERT INTO `sys_transcoder_filters` (`transcoder_object`, `filter`, `filter_params`, `order`) VALUES 
+('bx_stream_preview', 'Resize', 'a:3:{s:1:"w";s:3:"300";s:1:"h";s:3:"200";s:11:"crop_resize";s:1:"1";}', '0'),
+('bx_stream_gallery', 'Resize', 'a:1:{s:1:"w";s:3:"500";}', '0'),
+('bx_stream_cover', 'Resize', 'a:1:{s:1:"w";s:4:"2000";}', '0');
+
+
+-- FORMS: entry (post)
+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 
+('bx_stream', 'bx_stream', '_bx_stream_form_entry', '', 'a:1:{s:7:"enctype";s:19:"multipart/form-data";}', 'bx_stream_streams', 'id', '', '', 'a:2:{i:0;s:9:"do_submit";i:1;s:10:"do_publish";}', '', 0, 1, 'BxStrmFormEntry', 'modules/boonex/stream/classes/BxStrmFormEntry.php');
+
+INSERT INTO `sys_form_displays`(`object`, `display_name`, `module`, `view_mode`, `title`) VALUES 
+('bx_stream', 'bx_stream_entry_add', 'bx_stream', 0, '_bx_stream_form_entry_display_add'),
+('bx_stream', 'bx_stream_entry_delete', 'bx_stream', 0, '_bx_stream_form_entry_display_delete'),
+('bx_stream', 'bx_stream_entry_edit', 'bx_stream', 0, '_bx_stream_form_entry_display_edit'),
+('bx_stream', 'bx_stream_entry_view', 'bx_stream', 1, '_bx_stream_form_entry_display_view');
+
+INSERT INTO `sys_form_inputs`(`object`, `module`, `name`, `value`, `values`, `checked`, `type`, `caption_system`, `caption`, `info`, `required`, `collapsed`, `html`, `attrs`, `attrs_tr`, `attrs_wrapper`, `checker_func`, `checker_params`, `checker_error`, `db_pass`, `db_params`, `editable`, `deletable`) VALUES 
+('bx_stream', 'bx_stream', 'allow_view_to', '', '', 0, 'custom', '_bx_stream_form_entry_input_sys_allow_view_to', '_bx_stream_form_entry_input_allow_view_to', '', 1, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
+('bx_stream', 'bx_stream', 'delete_confirm', 1, '', 0, 'checkbox', '_bx_stream_form_entry_input_sys_delete_confirm', '_bx_stream_form_entry_input_delete_confirm', '_bx_stream_form_entry_input_delete_confirm_info', 1, 0, 0, '', '', '', 'Avail', '', '_bx_stream_form_entry_input_delete_confirm_error', '', '', 1, 0),
+('bx_stream', 'bx_stream', 'do_publish', '_bx_stream_form_entry_input_do_publish', '', 0, 'submit', '_bx_stream_form_entry_input_sys_do_publish', '', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
+('bx_stream', 'bx_stream', 'do_submit', '_bx_stream_form_entry_input_do_submit', '', 0, 'submit', '_bx_stream_form_entry_input_sys_do_submit', '', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
+('bx_stream', 'bx_stream', 'location', '', '', 0, 'location', '_sys_form_input_sys_location', '_sys_form_input_location', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
+('bx_stream', 'bx_stream', 'covers', 'a:1:{i:0;s:15:"bx_stream_html5";}', 'a:2:{s:16:"bx_stream_simple";s:26:"_sys_uploader_simple_title";s:15:"bx_stream_html5";s:25:"_sys_uploader_html5_title";}', 0, 'files', '_bx_stream_form_entry_input_sys_covers', '_bx_stream_form_entry_input_covers', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
+('bx_stream', 'bx_stream', 'text', '', '', 0, 'textarea', '_bx_stream_form_entry_input_sys_text', '_bx_stream_form_entry_input_text', '', 1, 0, 2, '', '', '', 'Avail', '', '_bx_stream_form_entry_input_text_err', 'XssHtml', '', 1, 0),
+('bx_stream', 'bx_stream', 'title', '', '', 0, 'text', '_bx_stream_form_entry_input_sys_title', '_bx_stream_form_entry_input_title', '', 1, 0, 0, '', '', '', 'Avail', '', '_bx_stream_form_entry_input_title_err', 'Xss', '', 1, 0),
+('bx_stream', 'bx_stream', 'cat', '', '#!bx_stream_cats', 0, 'select', '_bx_stream_form_entry_input_sys_cat', '_bx_stream_form_entry_input_cat', '', 1, 0, 0, '', '', '', 'avail', '', '_bx_stream_form_entry_input_cat_err', 'Xss', '', 1, 0),
+('bx_stream', 'bx_stream', 'multicat', '', '', 0, 'custom', '_bx_stream_form_entry_input_sys_multicat', '_bx_stream_form_entry_input_multicat', '', 1, 0, 0, '', '', '', 'avail', '', '_bx_stream_form_entry_input_multicat_err', 'Xss', '', 1, 0),
+('bx_stream', 'bx_stream', 'added', '', '', 0, 'datetime', '_bx_stream_form_entry_input_sys_date_added', '_bx_stream_form_entry_input_date_added', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
+('bx_stream', 'bx_stream', 'changed', '', '', 0, 'datetime', '_bx_stream_form_entry_input_sys_date_changed', '_bx_stream_form_entry_input_date_changed', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
+('bx_stream', 'bx_stream', 'labels', '', '', 0, 'custom', '_sys_form_input_sys_labels', '_sys_form_input_labels', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
+('bx_stream', 'bx_stream', 'anonymous', '', '', 0, 'switcher', '_sys_form_input_sys_anonymous', '_sys_form_input_anonymous', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
+('bx_stream', 'bx_stream', 'disable_comments', '1', '', 0, 'switcher', '_bx_stream_form_entry_input_sys_disable_comments', '_bx_stream_form_entry_input_disable_comments', '', 0, 0, 0, '', '', '', '', '', '', 'Int', '', 1, 0);
+
+
+
+INSERT INTO `sys_form_display_inputs`(`display_name`, `input_name`, `visible_for_levels`, `active`, `order`) VALUES 
+('bx_stream_entry_add', 'delete_confirm', 2147483647, 0, 1),
+('bx_stream_entry_add', 'title', 2147483647, 1, 2),
+('bx_stream_entry_add', 'cat', 2147483647, 1, 3),
+('bx_stream_entry_add', 'text', 2147483647, 1, 4),
+('bx_stream_entry_add', 'covers', 2147483647, 1, 5),
+('bx_stream_entry_add', 'allow_view_to', 2147483647, 1, 6),
+('bx_stream_entry_add', 'location', 2147483647, 1, 7),
+('bx_stream_entry_add', 'disable_comments', 192, 1, 8),
+('bx_stream_entry_add', 'do_publish', 2147483647, 1, 9),
+
+('bx_stream_entry_delete', 'delete_confirm', 2147483647, 1, 1),
+('bx_stream_entry_delete', 'do_submit', 2147483647, 1, 2),
+
+('bx_stream_entry_edit', 'do_publish', 2147483647, 0, 1),
+('bx_stream_entry_edit', 'delete_confirm', 2147483647, 0, 2),
+('bx_stream_entry_edit', 'title', 2147483647, 1, 3),
+('bx_stream_entry_edit', 'cat', 2147483647, 1, 4),
+('bx_stream_entry_edit', 'text', 2147483647, 1, 5),
+('bx_stream_entry_edit', 'covers', 2147483647, 1, 6),
+('bx_stream_entry_edit', 'allow_view_to', 2147483647, 1, 7),
+('bx_stream_entry_edit', 'location', 2147483647, 1, 8),
+('bx_stream_entry_edit', 'disable_comments', 192, 1, 9),
+('bx_stream_entry_edit', 'do_submit', 2147483647, 1, 10),
+
+('bx_stream_entry_view', 'cat', 2147483647, 1, 1),
+('bx_stream_entry_view', 'added', 2147483647, 1, 2),
+('bx_stream_entry_view', 'changed', 2147483647, 1, 3),
+('bx_stream_entry_view', 'published', 192, 1, 4);
+
+-- PRE-VALUES
+INSERT INTO `sys_form_pre_lists`(`key`, `title`, `module`, `use_for_sets`) VALUES
+('bx_stream_cats', '_bx_stream_pre_lists_cats', 'bx_stream', '0');
+
+INSERT INTO `sys_form_pre_values`(`Key`, `Value`, `Order`, `LKey`, `LKey2`) VALUES
+('bx_stream_cats', '', 0, '_sys_please_select', ''),
+('bx_stream_cats', '1', 1, '_bx_stream_cat_Animals_Pets', ''),
+('bx_stream_cats', '2', 2, '_bx_stream_cat_Architecture', ''),
+('bx_stream_cats', '3', 3, '_bx_stream_cat_Art', ''),
+('bx_stream_cats', '4', 4, '_bx_stream_cat_Cars_Motorcycles', ''),
+('bx_stream_cats', '5', 5, '_bx_stream_cat_Celebrities', ''),
+('bx_stream_cats', '6', 6, '_bx_stream_cat_Design', ''),
+('bx_stream_cats', '7', 7, '_bx_stream_cat_DIY_Crafts', ''),
+('bx_stream_cats', '8', 8, '_bx_stream_cat_Education', ''),
+('bx_stream_cats', '9', 9, '_bx_stream_cat_Film_Music_Books', ''),
+('bx_stream_cats', '10', 10, '_bx_stream_cat_Food_Drink', ''),
+('bx_stream_cats', '11', 11, '_bx_stream_cat_Gardening', ''),
+('bx_stream_cats', '12', 12, '_bx_stream_cat_Geek', ''),
+('bx_stream_cats', '13', 13, '_bx_stream_cat_Hair_Beauty', ''),
+('bx_stream_cats', '14', 14, '_bx_stream_cat_Health_Fitness', ''),
+('bx_stream_cats', '15', 15, '_bx_stream_cat_History', ''),
+('bx_stream_cats', '16', 16, '_bx_stream_cat_Holidays_Events', ''),
+('bx_stream_cats', '17', 17, '_bx_stream_cat_Home_Decor', ''),
+('bx_stream_cats', '18', 18, '_bx_stream_cat_Humor', ''),
+('bx_stream_cats', '19', 19, '_bx_stream_cat_Illustrations_Posters', ''),
+('bx_stream_cats', '20', 20, '_bx_stream_cat_Kids_Parenting', ''),
+('bx_stream_cats', '21', 21, '_bx_stream_cat_Mens_Fashion', ''),
+('bx_stream_cats', '22', 22, '_bx_stream_cat_Outdoors', ''),
+('bx_stream_cats', '23', 23, '_bx_stream_cat_Photography', ''),
+('bx_stream_cats', '24', 24, '_bx_stream_cat_Products', ''),
+('bx_stream_cats', '25', 25, '_bx_stream_cat_Quotes', ''),
+('bx_stream_cats', '26', 26, '_bx_stream_cat_Science_Nature', ''),
+('bx_stream_cats', '27', 27, '_bx_stream_cat_Sports', ''),
+('bx_stream_cats', '28', 28, '_bx_stream_cat_Tattoos', ''),
+('bx_stream_cats', '29', 29, '_bx_stream_cat_Technology', ''),
+('bx_stream_cats', '30', 30, '_bx_stream_cat_Travel', ''),
+('bx_stream_cats', '31', 31, '_bx_stream_cat_Weddings', ''),
+('bx_stream_cats', '32', 32, '_bx_stream_cat_Womens_Fashion', '');
+
+-- COMMENTS
+INSERT INTO `sys_objects_cmts` (`Name`, `Module`, `Table`, `CharsPostMin`, `CharsPostMax`, `CharsDisplayMax`, `Html`, `PerView`, `PerViewReplies`, `BrowseType`, `IsBrowseSwitch`, `PostFormPosition`, `NumberOfLevels`, `IsDisplaySwitch`, `IsRatable`, `ViewingThreshold`, `IsOn`, `RootStylePrefix`, `BaseUrl`, `ObjectVote`, `TriggerTable`, `TriggerFieldId`, `TriggerFieldAuthor`, `TriggerFieldTitle`, `TriggerFieldComments`, `ClassName`, `ClassFile`) VALUES
+('bx_stream', 'bx_stream', 'bx_stream_cmts', 1, 5000, 1000, 3, 5, 3, 'tail', 1, 'bottom', 1, 1, 1, -3, 1, 'cmt', 'page.php?i=view-stream&id={object_id}', '', 'bx_stream_streams', 'id', 'author', 'title', 'comments', '', ''),
+('bx_stream_notes', 'bx_stream', 'bx_stream_cmts_notes', 1, 5000, 1000, 0, 5, 3, 'tail', 1, 'bottom', 1, 1, 1, -3, 1, 'cmt', 'page.php?i=view-stream&id={object_id}', '', 'bx_stream_streams', 'id', 'author', 'title', '', 'BxTemplCmtsNotes', '');
+
+-- VOTES
+INSERT INTO `sys_objects_vote` (`Name`, `TableMain`, `TableTrack`, `PostTimeout`, `MinValue`, `MaxValue`, `IsUndo`, `IsOn`, `TriggerTable`, `TriggerFieldId`, `TriggerFieldAuthor`, `TriggerFieldRate`, `TriggerFieldRateCount`, `ClassName`, `ClassFile`) VALUES 
+('bx_stream', 'bx_stream_votes', 'bx_stream_votes_track', '604800', '1', '1', '0', '1', 'bx_stream_streams', 'id', 'author', 'rate', 'votes', '', ''),
+('bx_stream_reactions', 'bx_stream_reactions', 'bx_stream_reactions_track', '604800', '1', '1', '1', '1', 'bx_stream_streams', 'id', 'author', 'rrate', 'rvotes', 'BxTemplVoteReactions', ''),
+('bx_stream_poll_answers', 'bx_stream_polls_answers_votes', 'bx_stream_polls_answers_votes_track', '604800', '1', '1', '0', '1', 'bx_stream_polls_answers', 'id', 'author_id', 'rate', 'votes', 'BxStrmVotePollAnswers', 'modules/boonex/stream/classes/BxStrmVotePollAnswers.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_stream', 'bx_stream', 'bx_stream_scores', 'bx_stream_scores_track', '604800', '0', 'bx_stream_streams', 'id', 'author', 'score', 'sc_up', 'sc_down', '', '');
+
+-- REPORTS
+INSERT INTO `sys_objects_report` (`name`, `module`, `table_main`, `table_track`, `is_on`, `base_url`, `object_comment`, `trigger_table`, `trigger_field_id`, `trigger_field_author`, `trigger_field_count`, `class_name`, `class_file`) VALUES 
+('bx_stream', 'bx_stream', 'bx_stream_reports', 'bx_stream_reports_track', '1', 'page.php?i=view-stream&id={object_id}', 'bx_stream_notes', 'bx_stream_streams', 'id', 'author', 'reports', '', '');
+
+-- VIEWS
+INSERT INTO `sys_objects_view` (`name`, `table_track`, `period`, `is_on`, `trigger_table`, `trigger_field_id`, `trigger_field_author`, `trigger_field_count`, `class_name`, `class_file`) VALUES 
+('bx_stream', 'bx_stream_views_track', '86400', '1', 'bx_stream_streams', 'id', 'author', 'views', '', '');
+
+-- FEATURED
+INSERT INTO `sys_objects_feature` (`name`, `module`, `is_on`, `is_undo`, `base_url`, `trigger_table`, `trigger_field_id`, `trigger_field_author`, `trigger_field_flag`, `class_name`, `class_file`) VALUES 
+('bx_stream', 'bx_stream', '1', '1', 'page.php?i=view-stream&id={object_id}', 'bx_stream_streams', 'id', 'author', 'featured', '', '');
+
+-- CONTENT INFO
+INSERT INTO `sys_objects_content_info` (`name`, `title`, `alert_unit`, `alert_action_add`, `alert_action_update`, `alert_action_delete`, `class_name`, `class_file`) VALUES
+('bx_stream', '_bx_stream', 'bx_stream', 'added', 'edited', 'deleted', '', ''),
+('bx_stream_cmts', '_bx_stream_cmts', 'bx_stream', 'commentPost', 'commentUpdated', 'commentRemoved', 'BxDolContentInfoCmts', '');
+
+INSERT INTO `sys_content_info_grids` (`object`, `grid_object`, `grid_field_id`, `condition`, `selection`) VALUES
+('bx_stream', 'bx_stream_administration', 'id', '', ''),
+('bx_stream', 'bx_stream_common', 'id', '', '');
+
+-- SEARCH EXTENDED
+INSERT INTO `sys_objects_search_extended` (`object`, `object_content_info`, `module`, `title`, `active`, `class_name`, `class_file`) VALUES
+('bx_stream', 'bx_stream', 'bx_stream', '_bx_stream_search_extended', 1, '', ''),
+('bx_stream_cmts', 'bx_stream_cmts', 'bx_stream', '_bx_stream_search_extended_cmts', 1, 'BxTemplSearchExtendedCmts', '');
+
+-- LOGS
+
+INSERT INTO `sys_objects_logs` (`object`, `module`, `logs_storage`, `title`, `active`, `class_name`, `class_file`) VALUES
+('bx_stream_ome_api', 'bx_stream', 'Auto', '_bx_stream_logs_ome_api', 0, '', '');
+
+-- STUDIO: page & widget
+INSERT INTO `sys_std_pages`(`index`, `name`, `header`, `caption`, `icon`) VALUES
+(3, 'bx_stream', '_bx_stream', '_bx_stream', 'bx_stream@modules/boonex/stream/|std-icon.svg');
+SET @iPageId = LAST_INSERT_ID();
+
+SET @iParentPageId = (SELECT `id` FROM `sys_std_pages` WHERE `name` = 'home');
+SET @iParentPageOrder = (SELECT MAX(`order`) FROM `sys_std_pages_widgets` WHERE `page_id` = @iParentPageId);
+INSERT INTO `sys_std_widgets` (`page_id`, `module`, `type`, `url`, `click`, `icon`, `caption`, `cnt_notices`, `cnt_actions`) VALUES
+(@iPageId, 'bx_stream', 'content', '{url_studio}module.php?name=bx_stream', '', 'bx_stream@modules/boonex/stream/|std-icon.svg', '_bx_stream', '', 'a:4:{s:6:"module";s:6:"system";s:6:"method";s:11:"get_actions";s:6:"params";a:0:{}s:5:"class";s:18:"TemplStudioModules";}');
+INSERT INTO `sys_std_pages_widgets` (`page_id`, `widget_id`, `order`) VALUES
+(@iParentPageId, LAST_INSERT_ID(), IF(ISNULL(@iParentPageOrder), 1, @iParentPageOrder + 1));
+

+ 60 - 0
modules/boonex/stream/install/sql/uninstall.sql

@@ -0,0 +1,60 @@
+
+-- TABLES
+DROP TABLE IF EXISTS `bx_stream_streams`, `bx_stream_covers`, `bx_stream_photos_resized`, `bx_stream_cmts`, `bx_stream_cmts_notes`, `bx_stream_votes`, `bx_stream_votes_track`, `bx_stream_reactions`, `bx_stream_reactions_track`, `bx_stream_views_track`, `bx_stream_meta_keywords`, `bx_stream_meta_locations`, `bx_stream_meta_mentions`, `bx_stream_reports`, `bx_stream_reports_track`, `bx_stream_scores`, `bx_stream_scores_track`, `bx_stream_polls`, `bx_stream_polls_answers`, `bx_stream_polls_answers_votes`, `bx_stream_polls_answers_votes_track`;
+
+-- STORAGES & TRANSCODERS
+DELETE FROM `sys_objects_storage` WHERE `object` LIKE 'bx_stream_%';
+DELETE FROM `sys_storage_tokens` WHERE `object` LIKE 'bx_stream_%';
+
+DELETE FROM `sys_objects_transcoder` WHERE `object` LIKE 'bx_stream_%';
+DELETE FROM `sys_transcoder_filters` WHERE `transcoder_object` LIKE 'bx_stream_%';
+DELETE FROM `sys_transcoder_images_files` WHERE `transcoder_object` LIKE 'bx_stream_%';
+
+-- FORMS
+DELETE FROM `sys_objects_form` WHERE `module` = 'bx_stream';
+DELETE FROM `sys_form_displays` WHERE `module` = 'bx_stream';
+DELETE FROM `sys_form_inputs` WHERE `module` = 'bx_stream';
+DELETE FROM `sys_form_display_inputs` WHERE `display_name` LIKE 'bx_stream_%';
+
+-- PRE-VALUES
+DELETE FROM `sys_form_pre_lists` WHERE `module` = 'bx_stream';
+
+DELETE FROM `sys_form_pre_values` WHERE `Key` IN('bx_stream_cats');
+
+-- CATEGORIES
+DELETE FROM `sys_categories` WHERE `module` = 'bx_stream';
+DELETE FROM `sys_categories2objects` WHERE `module` = 'bx_stream';
+
+-- COMMENTS
+DELETE FROM `sys_objects_cmts` WHERE `Name` LIKE 'bx_stream%';
+
+-- VOTES
+DELETE FROM `sys_objects_vote` WHERE `Name` IN ('bx_stream', 'bx_stream_reactions', 'bx_stream_poll_answers');
+
+-- SCORES
+DELETE FROM `sys_objects_score` WHERE `name` = 'bx_stream';
+
+-- REPORTS
+DELETE FROM `sys_objects_report` WHERE `name` = 'bx_stream';
+
+-- VIEWS
+DELETE FROM `sys_objects_view` WHERE `name` = 'bx_stream';
+
+-- FEATURED
+DELETE FROM `sys_objects_feature` WHERE `name` = 'bx_stream';
+
+-- CONTENT INFO
+DELETE FROM `sys_objects_content_info` WHERE `name` IN ('bx_stream', 'bx_stream_cmts');
+
+DELETE FROM `sys_content_info_grids` WHERE `object` IN ('bx_stream');
+
+-- SEARCH EXTENDED
+DELETE FROM `sys_objects_search_extended` WHERE `module` = 'bx_stream';
+
+-- LOGS
+DELETE FROM `sys_objects_logs` WHERE `module` = 'bx_stream';
+
+-- STUDIO: page & widget
+DELETE FROM `tp`, `tw`, `twb`, `tpw` 
+USING `sys_std_pages` AS `tp` LEFT JOIN `sys_std_widgets` AS `tw` ON `tp`.`id` = `tw`.`page_id` LEFT JOIN `sys_std_widgets_bookmarks` AS `twb` ON `tw`.`id` = `twb`.`widget_id` LEFT JOIN `sys_std_pages_widgets` AS `tpw` ON `tw`.`id` = `tpw`.`widget_id`
+WHERE  `tp`.`name` = 'bx_stream';

+ 56 - 0
modules/boonex/stream/js/manage_tools.js

@@ -0,0 +1,56 @@
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Stream Stream
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+function BxStrmManageTools(oOptions) {
+	this._iSearchTimeoutId = false;
+	this._sActionsUrl = oOptions.sActionUrl;
+	this._sObjNameGrid = oOptions.sObjNameGrid;
+    this._sObjName = oOptions.sObjName == undefined ? 'oBxStrmManageTools' : oOptions.sObjName;
+
+    this._sAnimationEffect = oOptions.sAnimationEffect == undefined ? 'fade' : oOptions.sAnimationEffect;
+    this._iAnimationSpeed = oOptions.iAnimationSpeed == undefined ? 'slow' : oOptions.iAnimationSpeed;
+    this._sParamsDivider = oOptions.sParamsDivider == undefined ? '#-#' : oOptions.sParamsDivider;
+
+    this._aHtmlIds = oOptions.aHtmlIds == undefined ? {} : oOptions.aHtmlIds;
+    this._oRequestParams = oOptions.oRequestParams == undefined ? {} : oOptions.oRequestParams;
+}
+
+BxStrmManageTools.prototype.onChangeFilter = function(oFilter) {
+	var $this = this;
+	var oFilter1 = $('#bx-grid-filter1-' + this._sObjNameGrid);
+	var sValueFilter1 = oFilter1.length > 0 ? oFilter1.val() : '';
+
+	var oSearch = $('#bx-grid-search-' + this._sObjNameGrid);
+	var sValueSearch = oSearch.length > 0 ? oSearch.val() : '';
+	if(sValueSearch == _t('_sys_grid_search'))
+		sValueSearch = '';
+
+	clearTimeout($this._iSearchTimeoutId);
+    $this._iSearchTimeoutId = setTimeout(function () {
+        glGrids[$this._sObjNameGrid].setFilter(sValueFilter1 + $this._sParamsDivider + sValueSearch, true);
+    }, 500);
+};
+
+BxStrmManageTools.prototype.onClickSettings = function(sMenuObject, oButton) {
+	if($(oButton).hasClass('bx-btn-disabled'))
+		return false;
+
+	bx_menu_popup(sMenuObject, oButton, {}, {
+		content_id: $(oButton).attr('bx_grid_action_data')
+	});
+};
+
+BxStrmManageTools.prototype.onClickDelete = function(iContentId) {
+	$('.bx-popup-applied:visible').dolPopupHide();
+
+	glGrids[this._sObjNameGrid].actionWithId(iContentId, 'delete', {}, '', false, 1);
+};
+
+/** @} */

+ 21 - 0
modules/boonex/stream/js/polls.js

@@ -0,0 +1,21 @@
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Stream Stream
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+function BxStrmPolls(oOptions)
+{
+    BxBaseModTextPolls.call(this, oOptions);
+
+    this._sObjName = oOptions.sObjName == undefined ? 'oBxStrmPolls' : oOptions.sObjName;
+}
+
+BxStrmPolls.prototype = Object.create(BxBaseModTextPolls.prototype);
+BxStrmPolls.prototype.constructor = BxStrmPolls;
+
+/** @} */

+ 18 - 0
modules/boonex/stream/request.php

@@ -0,0 +1,18 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Stream Stream
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+require_once(BX_DIRECTORY_PATH_INC . "design.inc.php");
+
+check_logged();
+
+BxBaseModTextRequest::processAsAction($GLOBALS['aModule'], $GLOBALS['aRequest']);
+
+/** @} */

+ 3 - 0
modules/boonex/stream/template/author.html

@@ -0,0 +1,3 @@
+
+<bx_include_base:../modules/base/text/template/author.html />
+

+ 1 - 0
modules/boonex/stream/template/author_link.html

@@ -0,0 +1 @@
+<bx_include_base:../modules/base/text/template/author_link.html />

+ 1 - 0
modules/boonex/stream/template/badges.html

@@ -0,0 +1 @@
+<bx_include_base:../modules/base/profile/template/badges.html />

+ 1 - 0
modules/boonex/stream/template/category_list_inline.html

@@ -0,0 +1 @@
+<bx_include_base:../modules/base/text/template/category_list_inline.html />

+ 1 - 0
modules/boonex/stream/template/context.html

@@ -0,0 +1 @@
+<bx_include_base:../modules/base/text/template/context.html />

+ 1 - 0
modules/boonex/stream/template/css/categories.css

@@ -0,0 +1 @@
+@import url(../../../../base/text/template/css/categories.css);

+ 1 - 0
modules/boonex/stream/template/css/forms.css

@@ -0,0 +1 @@
+@import url(../../../../base/text/template/css/forms.css);

+ 1 - 0
modules/boonex/stream/template/css/manage_tools.css

@@ -0,0 +1 @@
+@import url(../../../../base/general/template/css/manage_tools.css);

+ 3 - 0
modules/boonex/stream/template/entry-all-actions.html

@@ -0,0 +1,3 @@
+
+<bx_include_base:../modules/base/text/template/entry-all-actions.html />
+

+ 3 - 0
modules/boonex/stream/template/entry-location.html

@@ -0,0 +1,3 @@
+
+<bx_include_base:../modules/base/general/template/entry-location.html />
+

+ 1 - 0
modules/boonex/stream/template/entry-share.html

@@ -0,0 +1 @@
+<bx_include_base:../modules/base/text/template/entry-share.html />

+ 1 - 0
modules/boonex/stream/template/entry-text.html

@@ -0,0 +1 @@
+<bx_include_base:../modules/base/text/template/entry-text.html />

+ 1 - 0
modules/boonex/stream/template/form_categories.html

@@ -0,0 +1 @@
+<bx_include_base:../modules/base/text/template/form_categories.html />

+ 16 - 0
modules/boonex/stream/template/form_ghost_template_cover.html

@@ -0,0 +1,16 @@
+<div id="bx-uploader-file-{storage_object}-{file_id}" class="bx-uploader-ghost bx-def-margin-sec-top bx-clearfix">
+    <input type="hidden" name="__name__[]" value="{file_id}" />
+    <input type="hidden" name="__name_thumb__[]" value="{file_id}" onclick="bx_base_general_select_thumb(this)" id="__name_thumb__-{file_id}" />
+    <div class="bx-base-general-icon-wrapper bx-def-margin-sec-right">
+        <img src="{file_icon}" class="bx-def-round-corners bx-base-general-icon bx-base-general-icon-{file_id}" />
+    </div>
+    <span class="bx-base-general-uploader-ghost">
+        <a class="bx-btn bx-btn-small bx-def-margin-sec-right" href="javascript:void(0);" onclick="bx_base_general_delete_ghost('{file_id}', '{file_url}', '{file_icon}', ['__editor_id__'], {js_instance_name});"><bx_text:_sys_txt_form_entry_input_picture_delete /></a>
+    </span>
+</div>
+<script>
+    // disable images drag&drop, because resized images address can be reset after some time
+    $(".bx-base-general-icon-{file_id}").bind('dragstart', function(){
+        return false; 
+    });
+</script>

+ 169 - 0
modules/boonex/stream/template/images/icons/std-icon.svg

@@ -0,0 +1,169 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg
+   xmlns:dc="http://purl.org/dc/elements/1.1/"
+   xmlns:cc="http://creativecommons.org/ns#"
+   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+   xmlns:svg="http://www.w3.org/2000/svg"
+   xmlns="http://www.w3.org/2000/svg"
+   xmlns:xlink="http://www.w3.org/1999/xlink"
+   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+   inkscape:version="1.0 (4035a4f, 2020-05-01)"
+   sodipodi:docname="std-icon.svg"
+   id="svg45"
+   version="1.1"
+   viewBox="0 0 64 64"
+   height="64px"
+   width="64px">
+  <metadata
+     id="metadata49">
+    <rdf:RDF>
+      <cc:Work
+         rdf:about="">
+        <dc:format>image/svg+xml</dc:format>
+        <dc:type
+           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+      </cc:Work>
+    </rdf:RDF>
+  </metadata>
+  <sodipodi:namedview
+     inkscape:current-layer="svg45"
+     inkscape:window-maximized="0"
+     inkscape:window-y="23"
+     inkscape:window-x="0"
+     inkscape:cy="31.617339"
+     inkscape:cx="21.60618"
+     inkscape:zoom="2.2766005"
+     showgrid="false"
+     id="namedview47"
+     inkscape:window-height="855"
+     inkscape:window-width="1397"
+     inkscape:pageshadow="2"
+     inkscape:pageopacity="0"
+     guidetolerance="10"
+     gridtolerance="10"
+     objecttolerance="10"
+     borderopacity="1"
+     bordercolor="#666666"
+     pagecolor="#ffffff" />
+  <!-- Generator: Sketch 54.1 (76490) - https://sketchapp.com -->
+  <title
+     id="title10">posts</title>
+  <desc
+     id="desc12">Created with Sketch.</desc>
+  <defs
+     id="defs28">
+    <path
+       id="path-1"
+       d="M32,64 C46.0222222,64 53.8173667,64 58.9086889,58.9086889 C64,53.8173667 64,46.0222222 64,32 C64,17.9777778 64,10.1826333 58.9086889,5.09131111 C53.8173667,0 46.0222222,0 32,0 C17.9777778,0 10.1826333,0 5.09131111,5.09131111 C0,10.1826333 0,17.9777778 0,32 C0,46.0222222 0,53.8173667 5.09131111,58.9086889 C10.1826333,64 17.9777778,64 32,64 Z" />
+    <linearGradient
+       id="linearGradient-3"
+       y2="100%"
+       x2="50%"
+       y1="0%"
+       x1="50%">
+      <stop
+         id="stop15"
+         offset="0%"
+         stop-color="#FDFEFF" />
+      <stop
+         id="stop17"
+         offset="100%"
+         stop-opacity="0.9"
+         stop-color="#FBFCFD" />
+    </linearGradient>
+    <path
+       id="path-4"
+       d="M17.7777778,10.625 L17.7777778,0 L1.9047619,0 C0.849206349,0 0,0.8359375 0,1.875 L0,38.125 C0,39.1640625 0.849206349,40 1.9047619,40 L28.5714286,40 C29.6269841,40 30.4761905,39.1640625 30.4761905,38.125 L30.4761905,12.5 L19.6825397,12.5 C18.6349206,12.5 17.7777778,11.65625 17.7777778,10.625 Z M22.8571429,29.0625 C22.8571429,29.578125 22.4285714,30 21.9047619,30 L8.57142857,30 C8.04761905,30 7.61904762,29.578125 7.61904762,29.0625 L7.61904762,28.4375 C7.61904762,27.921875 8.04761905,27.5 8.57142857,27.5 L21.9047619,27.5 C22.4285714,27.5 22.8571429,27.921875 22.8571429,28.4375 L22.8571429,29.0625 Z M22.8571429,24.0625 C22.8571429,24.578125 22.4285714,25 21.9047619,25 L8.57142857,25 C8.04761905,25 7.61904762,24.578125 7.61904762,24.0625 L7.61904762,23.4375 C7.61904762,22.921875 8.04761905,22.5 8.57142857,22.5 L21.9047619,22.5 C22.4285714,22.5 22.8571429,22.921875 22.8571429,23.4375 L22.8571429,24.0625 Z M22.8571429,18.4375 L22.8571429,19.0625 C22.8571429,19.578125 22.4285714,20 21.9047619,20 L8.57142857,20 C8.04761905,20 7.61904762,19.578125 7.61904762,19.0625 L7.61904762,18.4375 C7.61904762,17.921875 8.04761905,17.5 8.57142857,17.5 L21.9047619,17.5 C22.4285714,17.5 22.8571429,17.921875 22.8571429,18.4375 Z M30.4761905,9.5234375 L30.4761905,10 L20.3174603,10 L20.3174603,0 L20.8015873,0 C21.3095238,0 21.7936508,0.1953125 22.1507937,0.546875 L29.9206349,8.203125 C30.2777778,8.5546875 30.4761905,9.03125 30.4761905,9.5234375 Z" />
+    <filter
+       id="filter-5"
+       filterUnits="objectBoundingBox"
+       height="110.0%"
+       width="113.1%"
+       y="-2.5%"
+       x="-6.6%">
+      <feOffset
+         id="feOffset21"
+         result="shadowOffsetOuter1"
+         in="SourceAlpha"
+         dy="1"
+         dx="0" />
+      <feGaussianBlur
+         id="feGaussianBlur23"
+         result="shadowBlurOuter1"
+         in="shadowOffsetOuter1"
+         stdDeviation="0.5" />
+      <feColorMatrix
+         id="feColorMatrix25"
+         in="shadowBlurOuter1"
+         type="matrix"
+         values="0 0 0 0 0   0 0 0 0 0   0 0 0 0 0  0 0 0 0.1 0" />
+    </filter>
+    <filter
+       id="filter1083"
+       inkscape:label="Drop Shadow"
+       style="color-interpolation-filters:sRGB;">
+      <feFlood
+         id="feFlood1073"
+         result="flood"
+         flood-color="rgb(255,255,255)"
+         flood-opacity="1" />
+      <feComposite
+         id="feComposite1075"
+         result="composite1"
+         operator="in"
+         in2="flood"
+         in="SourceGraphic" />
+      <feGaussianBlur
+         id="feGaussianBlur1077"
+         result="blur"
+         stdDeviation="3"
+         in="composite1" />
+      <feOffset
+         id="feOffset1079"
+         result="offset"
+         dy="0"
+         dx="0" />
+      <feComposite
+         id="feComposite1081"
+         result="composite2"
+         operator="over"
+         in2="offset"
+         in="SourceGraphic" />
+    </filter>
+  </defs>
+  <g
+     fill-rule="evenodd"
+     fill="none"
+     stroke-width="1"
+     stroke="none"
+     id="Page-1">
+    <g
+       transform="translate(-340.000000, -430.000000)"
+       id="Artboard">
+      <g
+         transform="translate(340.000000, 430.000000)"
+         id="posts">
+        <mask
+           fill="white"
+           id="mask-2">
+          <use
+             id="use30"
+             xlink:href="#path-1" />
+        </mask>
+        <use
+           xlink:href="#path-1"
+           fill="#00B356"
+           id="Path" />
+        <g
+           fill-rule="nonzero"
+           mask="url(#mask-2)"
+           id="file-alt" />
+      </g>
+    </g>
+  </g>
+  <path
+     style="stroke-width:0.0763876;fill:#ffffff;fill-opacity:1;filter:url(#filter1083)"
+     d="M 24.274588,24.125207 23.40606,23.276538 a 1.2558157,1.2558157 0 0 0 -1.833307,0.09931 12.896553,12.896553 0 0 0 0,16.585319 1.2558157,1.2558157 0 0 0 1.833307,0.09931 l 0.868528,-0.848672 a 1.1565114,1.1565114 0 0 0 0.09854,-1.568241 9.374312,9.374312 0 0 1 0,-11.950108 1.1572753,1.1572753 0 0 0 -0.09854,-1.568242 z M 18.198704,18.193694 17.33323,17.348081 a 1.2535238,1.2535238 0 0 0 -1.799697,0.07639 C 11.954764,21.356148 10,26.365662 10,31.668503 c 0,5.302841 1.954764,10.312352 5.533533,14.247853 a 1.2535238,1.2535238 0 0 0 1.799697,0.07639 l 0.865474,-0.845611 c 0.466728,-0.45833 0.462909,-1.175609 0.0275,-1.65838 a 17.590584,17.590584 0 0 1 0,-23.632095 c 0.435411,-0.486593 0.43923,-1.207693 -0.0275,-1.662965 z M 48.465842,17.42065 a 1.2535238,1.2535238 0 0 0 -1.799695,-0.0764 l -0.865475,0.849432 c -0.466729,0.458327 -0.46291,1.175608 -0.0275,1.659144 a 17.590584,17.590584 0 0 1 0,23.632094 c -0.43541,0.482772 -0.439229,1.203107 0.0275,1.65838 l 0.865475,0.845613 a 1.2535238,1.2535238 0 0 0 1.799695,-0.07639 c 3.578771,-3.93167 5.533533,-8.941181 5.533533,-14.244022 0,-5.302841 -1.954762,-10.312355 -5.533533,-14.247853 z m -16.466154,9.970136 a 4.277717,4.277717 0 1 0 4.277716,4.277717 4.277717,4.277717 0 0 0 -4.277716,-4.277717 z m 8.593627,-4.114248 -0.868529,0.848669 a 1.1572753,1.1572753 0 0 0 -0.09854,1.568241 9.374312,9.374312 0 0 1 0,11.950108 1.1572753,1.1572753 0 0 0 0.09854,1.568241 l 0.868529,0.848669 a 1.2558157,1.2558157 0 0 0 1.833308,-0.09931 12.896553,12.896553 0 0 0 0,-16.58532 1.2558157,1.2558157 0 0 0 -1.833308,-0.09931 z"
+     id="path51" />
+</svg>

+ 31 - 0
modules/boonex/stream/template/stream_player.html

@@ -0,0 +1,31 @@
+<script src="https://cdn.jsdelivr.net/npm/ovenplayer/dist/ovenplayer.js"></script>
+<div id="bx-stream-player-__suffix__" class="bx-stream-player">
+</div>
+<script>
+    let oPlayer = null;
+    let fLoadPlayer = function () {
+        if (oPlayer)
+            oPlayer.remove();
+
+    	let aSources = __sources__;
+	    oPlayer = OvenPlayer.create("bx-stream-player-__suffix__",
+	    {
+		    sources: aSources,
+    		autoStart: true
+	    });
+
+        // display some message when waiting for the stream to start
+    	oPlayer.on('ready', function() {
+		    oPlayer.getConfig().systemText.api.error[501].message = _t('_bx_stream_txt_wait_for_stream');
+    	});
+
+        // reload player when error occured, it's needed to start player automatically when stream starts
+        oPlayer.on('error', function() {
+            setTimeout(function () {
+                console.log('Reloading in 5 sec...');
+                fLoadPlayer();
+            }, 5000)
+        });
+    };
+    fLoadPlayer();
+</script>

+ 11 - 0
modules/boonex/stream/template/stream_viewers.html

@@ -0,0 +1,11 @@
+<div id="bx-stream-viewers-__suffix__" class="bx-stream-viewers">__viewers__</div>
+<script>
+    var fFunc = function () {
+        $.getJSON('__url__', function (oData) {
+            if ('undefined' !== typeof(oData.viewers))
+                $('#bx-stream-viewers-__suffix__').html(oData.viewers);
+            setTimeout(fFunc, 10000);
+        });
+    }
+    fFunc();
+</script>

+ 1 - 0
modules/boonex/stream/template/title_link.html

@@ -0,0 +1 @@
+<bx_include_base:../modules/base/text/template/title_link.html />

+ 1 - 0
modules/boonex/stream/template/uploader_button_html5_attach.html

@@ -0,0 +1 @@
+<bx_include_base:../modules/base/text/template/uploader_button_html5_attach.html />

+ 1 - 0
modules/boonex/stream/template/uploader_button_simple_attach.html

@@ -0,0 +1 @@
+<bx_include_base:../modules/base/text/template/uploader_button_simple_attach.html />

Разница между файлами не показана из-за своего большого размера
+ 0 - 0
plugins_public/ovenplayer/dash.all.min.js


Разница между файлами не показана из-за своего большого размера
+ 0 - 0
plugins_public/ovenplayer/hls.min.js


Разница между файлами не показана из-за своего большого размера
+ 0 - 0
plugins_public/ovenplayer/ovenplayer.js


Разница между файлами не показана из-за своего большого размера
+ 0 - 0
plugins_public/ovenplayer/ovenplayer.js.map


Некоторые файлы не были показаны из-за большого количества измененных файлов