Bladeren bron

Ticket #1430 - Mature-audience content filter (PG, PG13, R): Comments.

AntonLV 4 jaren geleden
bovenliggende
commit
e338b35f34
36 gewijzigde bestanden met toevoegingen van 175 en 87 verwijderingen
  1. 4 2
      inc/classes/BxDolCmts.php
  2. 39 27
      inc/classes/BxDolCmtsQuery.php
  3. 18 3
      inc/classes/BxDolContentFilter.php
  4. 14 7
      install/sql/system.sql
  5. 2 0
      modules/boonex/ads/install/sql/install.sql
  6. 2 0
      modules/boonex/albums/install/sql/install.sql
  7. 1 0
      modules/boonex/channels/install/sql/install.sql
  8. 1 0
      modules/boonex/classes/install/sql/install.sql
  9. 1 0
      modules/boonex/convos/install/sql/install.sql
  10. 1 0
      modules/boonex/courses/install/sql/install.sql
  11. 38 37
      modules/boonex/english/data/langs/system/en.xml
  12. 1 0
      modules/boonex/events/install/sql/install.sql
  13. 1 0
      modules/boonex/files/install/sql/install.sql
  14. 1 1
      modules/boonex/files/install/sql/uninstall.sql
  15. 1 0
      modules/boonex/forum/install/sql/install.sql
  16. 1 0
      modules/boonex/glossary/install/sql/install.sql
  17. 1 0
      modules/boonex/groups/install/sql/install.sql
  18. 1 0
      modules/boonex/market/install/sql/install.sql
  19. 1 0
      modules/boonex/organizations/install/sql/install.sql
  20. 1 0
      modules/boonex/persons/install/sql/install.sql
  21. 1 0
      modules/boonex/photos/install/sql/install.sql
  22. 1 0
      modules/boonex/polls/install/sql/install.sql
  23. 1 0
      modules/boonex/posts/install/sql/install.sql
  24. 1 0
      modules/boonex/reviews/install/sql/install.sql
  25. 1 0
      modules/boonex/russian/data/langs/system/ru.xml
  26. 1 0
      modules/boonex/shopify/install/sql/install.sql
  27. 1 0
      modules/boonex/snipcart/install/sql/install.sql
  28. 1 0
      modules/boonex/spaces/install/sql/install.sql
  29. 1 0
      modules/boonex/stream/install/sql/install.sql
  30. 1 0
      modules/boonex/tasks/install/sql/install.sql
  31. 1 0
      modules/boonex/timeline/install/sql/install.sql
  32. 1 0
      modules/boonex/videos/install/sql/install.sql
  33. 1 1
      template/scripts/BxBaseCmts.php
  34. 11 0
      template/scripts/BxBaseCmtsForm.php
  35. 10 0
      template/scripts/BxBaseCmtsNotes.php
  36. 11 9
      template/scripts/BxBaseFormView.php

+ 4 - 2
inc/classes/BxDolCmts.php

@@ -712,9 +712,9 @@ class BxDolCmts extends BxDolFactory implements iBxDolReplaceable, iBxDolContent
         return BX_DOL_PG_ALL;
     }
 
-    public function getCommentsCountAll ($iObjectId = 0)
+    public function getCommentsCountAll ($iObjectId = 0, $bForceCalculate = false)
     {
-        return $this->_oQuery->getCommentsCountAll ($iObjectId ? $iObjectId : $this->getId());
+        return $this->_oQuery->getCommentsCountAll ($iObjectId ? $iObjectId : $this->getId(), $bForceCalculate);
     }
 
     public function getCommentsCount ($iObjectId = 0, $iCmtVParentId = -1, $sFilter = '')
@@ -1701,6 +1701,7 @@ class BxDolCmts extends BxDolFactory implements iBxDolReplaceable, iBxDolContent
 
         $iCmtId = (int)$aCmt['cmt_id'];
         $iCmtUniqId = $this->getCommentUniqId($iCmtId);
+        $iCmtCf = isset($aCmt['cmt_cf']) ? (int)$aCmt['cmt_cf'] : BxDolContentFilter::getInstance()->getDefaultValue();
 
         return array(
             'object_system' => $this->_sSystem, 
@@ -1713,6 +1714,7 @@ class BxDolCmts extends BxDolFactory implements iBxDolReplaceable, iBxDolContent
             'comment_text' => $aCmt['cmt_text'],
 
             'privacy_view' => $iObjAthrPrivacyView,
+            'cf' => $iCmtCf
         );
     }
 

+ 39 - 27
inc/classes/BxDolCmtsQuery.php

@@ -189,52 +189,55 @@ class BxDolCmtsQuery extends BxDolDb
     	$this->_sTableFiles2Entries = $sTable;
     }
 
-    function getCommentsCountAll ($iId)
+    function getCommentsCountAll ($iId, $bForceCalculate = false)
     {
         $iCount = false;
-		bx_alert('comment', 'get_comments_count', 0, bx_get_logged_profile_id(), array('system' => $this->_oMain->getSystemInfo(), 'object_id' => $iId, 'result' => &$iCount));
-		if ($iCount !== false)
-			return $iCount;
-        
-        if ($this->_sTriggerFieldComments) {
-            $sQuery = $this->prepare("SELECT `{$this->_sTriggerFieldComments}` FROM `{$this->_sTriggerTable}` WHERE `{$this->_sTriggerFieldId}` = ?", $iId);
-            return (int)$this->getOne($sQuery);
-        }
-        else {
+        bx_alert('comment', 'get_comments_count', 0, bx_get_logged_profile_id(), array('system' => $this->_oMain->getSystemInfo(), 'object_id' => $iId, 'result' => &$iCount));
+        if ($iCount !== false)
+            return $iCount;
+
+        if ($this->_sTriggerFieldComments && !$bForceCalculate)
+            return (int)$this->getOne("SELECT `{$this->_sTriggerFieldComments}` FROM `{$this->_sTriggerTable}` WHERE `{$this->_sTriggerFieldId}` = :id", [
+                'id' => $iId
+            ]);
+        else
             return $this->getCommentsCount($iId);
-        }
     }
 
     function getCommentsCount ($iId, $iCmtVParentId = -1, $iAuthorId = 0, $sFilter = '')
     {
     	$aBindings = array(
-    		'cmt_object_id' => $iId
+            'cmt_object_id' => $iId
     	);
 
         $sWhereClause = '';
         if((int)$iCmtVParentId >= 0) {
-        	$aBindings['cmt_vparent_id'] = $iCmtVParentId;
+            $aBindings['cmt_vparent_id'] = $iCmtVParentId;
 
             $sWhereClause .= " AND `{$this->_sTable}`.`cmt_vparent_id` = :cmt_vparent_id";
         }
 
         $sJoinClause = '';
         switch($sFilter) {
-        	case BX_CMT_FILTER_FRIENDS:
-        	case BX_CMT_FILTER_SUBSCRIPTIONS:
-	            $oConnection = BxDolConnection::getObjectInstance($this->_oMain->getConnectionObject($sFilter));
-	
-	            $aQueryParts = $oConnection->getConnectedContentAsSQLParts($this->_sTable, 'cmt_author_id', $iAuthorId);
-	            $sJoinClause .= ' ' . $aQueryParts['join'];
-	            break;
-
-        	case BX_CMT_FILTER_OTHERS:
-        		$aBindings['cmt_author_id'] = $iAuthorId;
-
-        		$sWhereClause .= " AND `{$this->_sTable}`.`cmt_author_id` <> :cmt_author_id";
-        		break;
+            case BX_CMT_FILTER_FRIENDS:
+            case BX_CMT_FILTER_SUBSCRIPTIONS:
+                $oConnection = BxDolConnection::getObjectInstance($this->_oMain->getConnectionObject($sFilter));
+
+                $aQueryParts = $oConnection->getConnectedContentAsSQLParts($this->_sTable, 'cmt_author_id', $iAuthorId);
+                $sJoinClause .= ' ' . $aQueryParts['join'];
+                break;
+
+            case BX_CMT_FILTER_OTHERS:
+                $aBindings['cmt_author_id'] = $iAuthorId;
+
+                $sWhereClause .= " AND `{$this->_sTable}`.`cmt_author_id` <> :cmt_author_id";
+                break;
         }
 
+        $oCf = BxDolContentFilter::getInstance();
+        if($oCf->isEnabledForComments())
+            $sWhereClause .= $oCf->getSQLParts($this->_sTable, 'cmt_cf');
+
         $sQuery = "SELECT COUNT(*) FROM `{$this->_sTable}` $sJoinClause WHERE `{$this->_sTable}`.`cmt_object_id` = :cmt_object_id" . $sWhereClause;
         return (int)$this->getOne($sQuery, $aBindings);
     }
@@ -320,6 +323,11 @@ class BxDolCmtsQuery extends BxDolDb
                 break;
         }
 
+        $sWhereCf = '';
+        $oCf = BxDolContentFilter::getInstance();
+        if($oCf->isEnabledForComments())
+            $sWhereCf = $oCf->getSQLParts($this->_sTable, 'cmt_cf');
+
         $sOrder = " ORDER BY `{$this->_sTable}`.`cmt_pinned` DESC, `{$this->_sTable}`.`cmt_time` ASC";
         if(isset($aOrder['by']) && isset($aOrder['way'])) {
             $aOrder['way'] = strtoupper(in_array($aOrder['way'], array(BX_CMT_ORDER_WAY_ASC, BX_CMT_ORDER_WAY_DESC)) ? $aOrder['way'] : BX_CMT_ORDER_WAY_ASC);
@@ -347,7 +355,7 @@ class BxDolCmtsQuery extends BxDolDb
         
        	$sLimit = $iCount != -1 ? $this->prepareAsString(" LIMIT ?, ?", (int)$iStart, (int)$iCount) : '';
 
-        $sWhereClause = $sWhereParent . $sWhereFilter;
+        $sWhereClause = $sWhereParent . $sWhereFilter . $sWhereCf;
            
         $sQuery = "SELECT
                 `{$this->_sTable}`.*,
@@ -475,6 +483,10 @@ class BxDolCmtsQuery extends BxDolDb
                     $sWhereConditions .= " AND `{$this->_sTable}`.`" . $sSearchParam . "`" . $sSearchValue;
                 }
 
+                $oCf = BxDolContentFilter::getInstance();
+                if($oCf->isEnabledForComments())
+                    $sWhereConditions .= $oCf->getSQLParts($this->_sTable, 'cmt_cf');
+
                 $sWhereClause .= " AND (" . $sWhereConditions . ")"; 
 
                 $sOrderClause .=  "`{$this->_sTable}`.`cmt_time` ASC";

+ 18 - 3
inc/classes/BxDolContentFilter.php

@@ -46,7 +46,12 @@ class BxDolContentFilter extends BxDolFactory implements iBxDolSingleton
     {
         return getParam('sys_cf_enable') == 'on';
     }
-    
+
+    public function isEnabledForComments()
+    {
+        return getParam('sys_cf_enable_comments') == 'on';
+    }
+
     public function getProhibited()
     {
         $sValues = getParam('sys_cf_prohibited');
@@ -65,9 +70,19 @@ class BxDolContentFilter extends BxDolFactory implements iBxDolSingleton
         return $this->_iDefaultValue;
     }
             
-    public function getInputByProfileId($aInput, $iProfileId = 0)
+    public function getInput($aInput, $iProfileId = 0)
+    {
+        return $this->_getInput('content', $aInput, $iProfileId);
+    }
+
+    public function getInputForComments($aInput, $iProfileId = 0)
+    {
+        return $this->_getInput('comments', $aInput, $iProfileId);
+    }
+
+    protected function _getInput($sType, $aInput, $iProfileId = 0)
     {
-        if(!$this->isEnabled())
+        if(!$this->{'isEnabled' . ($sType == 'comments' ? 'ForComments' : '')}())
             return array_merge($aInput, [
                 'type' => 'hidden',
                 'value' => 1

+ 14 - 7
install/sql/system.sql

@@ -476,7 +476,8 @@ INSERT INTO `sys_options`(`category_id`, `name`, `caption`, `value`, `type`, `ex
 (@iCategoryId, 'sys_security_block_content_after_n_reports', '_adm_stg_cpt_option_sys_security_block_content_after_n_reports', '0', 'digit', '', '', '', 35),
 
 (@iCategoryId, 'sys_cf_enable', '_adm_stg_cpt_option_sys_cf_enable', 'on', 'checkbox', '', '', '', 40),
-(@iCategoryId, 'sys_cf_prohibited', '_adm_stg_cpt_option_sys_cf_prohibited', '', 'list', 'a:4:{s:6:"module";s:6:"system";s:6:"method";s:25:"get_options_cf_prohibited";s:6:"params";a:0:{}s:5:"class";s:13:"TemplServices";}', '', '', 41);
+(@iCategoryId, 'sys_cf_enable_comments', '_adm_stg_cpt_option_sys_cf_enable_comments', 'on', 'checkbox', '', '', '', 41),
+(@iCategoryId, 'sys_cf_prohibited', '_adm_stg_cpt_option_sys_cf_prohibited', '', 'list', 'a:4:{s:6:"module";s:6:"system";s:6:"method";s:25:"get_options_cf_prohibited";s:6:"params";a:0:{}s:5:"class";s:13:"TemplServices";}', '', '', 42);
 
 --
 -- CATEGORY: Site Settings
@@ -3481,6 +3482,7 @@ INSERT INTO `sys_form_inputs` (`object`, `module`, `name`, `value`, `values`, `c
 ('sys_comment', 'system', 'cmt_text', '', '', 0, 'textarea', '_sys_form_comment_input_caption_system_cmt_text', '', '', 0, 0, 3, 'a:1:{s:12:"autocomplete";s:3:"off";}', '', '', '', '', '', 'XssHtml', '', 1, 0),
 ('sys_comment', 'system', 'cmt_anonymous', '', '', 0, 'switcher', '_sys_form_input_sys_anonymous', '_sys_form_input_anonymous', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
 ('sys_comment', 'system', 'cmt_image', 'a:1:{i:0;s:14:"sys_cmts_html5";}', 'a:1:{s:14:"sys_cmts_html5";s:25:"_sys_uploader_html5_title";}', 0, 'files', '_sys_form_comment_input_caption_system_cmt_image', '', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
+('sys_comment', 'system', 'cmt_cf', '', '#!sys_content_filter', 0, 'select', '_sys_form_entry_input_sys_cf', '_sys_form_entry_input_cf', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
 ('sys_comment', 'system', 'cmt_controls', '', 'cmt_submit,cmt_cancel', 0, 'input_set', '', '', '', 0, 0, 0, '', '', '', '', '', '', '', '', 0, 0),
 ('sys_comment', 'system', 'cmt_cancel', '_sys_form_comment_input_cancel', '', 0, 'button', '_sys_form_comment_input_caption_system_cmt_cancel', '', '', 0, 0, 0, 'a:1:{s:5:"class";s:22:"bx-def-margin-sec-left";}', '', '', '', '', '', '', '', 0, 0),
 ('sys_comment', 'system', 'cmt_submit', '_sys_form_comment_input_submit', '', 0, 'submit', '_sys_form_comment_input_caption_system_cmt_submit', '', '', 0, 0, 0, '', '', '', '', '', '', '', '', 0, 0),
@@ -3494,6 +3496,7 @@ INSERT INTO `sys_form_inputs` (`object`, `module`, `name`, `value`, `values`, `c
 ('sys_review', 'system', 'cmt_mood', '', '', 0, 'custom', '_sys_form_review_input_caption_system_cmt_mood', '', '', 0, 0, 0, '', '', '', '', '', '', 'Int', '', 1, 0),
 ('sys_review', 'system', 'cmt_anonymous', '', '', 0, 'switcher', '_sys_form_input_sys_anonymous', '_sys_form_input_anonymous', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
 ('sys_review', 'system', 'cmt_image', 'a:1:{i:0;s:14:"sys_cmts_html5";}', 'a:1:{s:14:"sys_cmts_html5";s:25:"_sys_uploader_html5_title";}', 0, 'files', '_sys_form_review_input_caption_system_cmt_image', '', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
+('sys_review', 'system', 'cmt_cf', '', '#!sys_content_filter', 0, 'select', '_sys_form_entry_input_sys_cf', '_sys_form_entry_input_cf', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
 ('sys_review', 'system', 'cmt_submit', '_sys_form_review_input_submit', '', 0, 'submit', '_sys_form_review_input_caption_system_cmt_submit', '', '', 0, 0, 0, '', '', '', '', '', '', '', '', 0, 0),
 
 ('sys_report', 'system', 'sys', '', '', 0, 'hidden', '_sys_form_report_input_caption_system_sys', '', '', 0, 0, 0, '', '', '', '', '', '', '', '', 0, 0),
@@ -3673,7 +3676,8 @@ INSERT INTO `sys_form_display_inputs` (`display_name`, `input_name`, `visible_fo
 ('sys_comment_post', 'cmt_parent_id', 2147483647, 1, 5),
 ('sys_comment_post', 'cmt_text', 2147483647, 1, 6),
 ('sys_comment_post', 'cmt_image', 2147483647, 1, 7),
-('sys_comment_post', 'cmt_submit', 2147483647, 1, 8),
+('sys_comment_post', 'cmt_cf', 2147483647, 1, 8),
+('sys_comment_post', 'cmt_submit', 2147483647, 1, 9),
 
 ('sys_comment_edit', 'sys', 2147483647, 1, 1),
 ('sys_comment_edit', 'id', 2147483647, 1, 2),
@@ -3682,9 +3686,10 @@ INSERT INTO `sys_form_display_inputs` (`display_name`, `input_name`, `visible_fo
 ('sys_comment_edit', 'cmt_parent_id', 2147483647, 1, 5),
 ('sys_comment_edit', 'cmt_text', 2147483647, 1, 6),
 ('sys_comment_edit', 'cmt_image', 2147483647, 1, 7),
-('sys_comment_edit', 'cmt_controls', 2147483647, 1, 8),
-('sys_comment_edit', 'cmt_submit', 2147483647, 1, 9),
-('sys_comment_edit', 'cmt_cancel', 2147483647, 1, 10),
+('sys_comment_edit', 'cmt_cf', 2147483647, 1, 8),
+('sys_comment_edit', 'cmt_controls', 2147483647, 1, 9),
+('sys_comment_edit', 'cmt_submit', 2147483647, 1, 10),
+('sys_comment_edit', 'cmt_cancel', 2147483647, 1, 11),
 
 ('sys_review_post', 'sys', 2147483647, 1, 1),
 ('sys_review_post', 'id', 2147483647, 1, 2),
@@ -3694,7 +3699,8 @@ INSERT INTO `sys_form_display_inputs` (`display_name`, `input_name`, `visible_fo
 ('sys_review_post', 'cmt_text', 2147483647, 1, 6),
 ('sys_review_post', 'cmt_mood', 2147483647, 1, 7),
 ('sys_review_post', 'cmt_image', 2147483647, 1, 8),
-('sys_review_post', 'cmt_submit', 2147483647, 1, 9),
+('sys_review_post', 'cmt_cf', 2147483647, 1, 9),
+('sys_review_post', 'cmt_submit', 2147483647, 1, 10),
 
 ('sys_review_edit', 'sys', 2147483647, 1, 1),
 ('sys_review_edit', 'id', 2147483647, 1, 2),
@@ -3704,7 +3710,8 @@ INSERT INTO `sys_form_display_inputs` (`display_name`, `input_name`, `visible_fo
 ('sys_review_edit', 'cmt_text', 2147483647, 1, 6),
 ('sys_review_edit', 'cmt_mood', 2147483647, 1, 7),
 ('sys_review_edit', 'cmt_image', 2147483647, 1, 8),
-('sys_review_edit', 'cmt_submit', 2147483647, 1, 9),
+('sys_review_edit', 'cmt_cf', 2147483647, 1, 9),
+('sys_review_edit', 'cmt_submit', 2147483647, 1, 10),
 
 ('sys_report_post', 'sys', 2147483647, 1, 1),
 ('sys_report_post', 'object_id', 2147483647, 1, 2),

+ 2 - 0
modules/boonex/ads/install/sql/install.sql

@@ -306,6 +306,7 @@ CREATE TABLE IF NOT EXISTS `bx_ads_cmts` (
   `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',
+  `cmt_cf` int(11) NOT NULL default '1',
   PRIMARY KEY (`cmt_id`),
   KEY `cmt_object_id` (`cmt_object_id`,`cmt_parent_id`),
   FULLTEXT KEY `search_fields` (`cmt_text`)
@@ -345,6 +346,7 @@ CREATE TABLE IF NOT EXISTS `bx_ads_reviews` (
   `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',
+  `cmt_cf` int(11) NOT NULL default '1',
   PRIMARY KEY (`cmt_id`),
   KEY `cmt_object_id` (`cmt_object_id`,`cmt_parent_id`),
   FULLTEXT KEY `search_fields` (`cmt_text`)

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

@@ -104,6 +104,7 @@ CREATE TABLE IF NOT EXISTS `bx_albums_cmts` (
   `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',
+  `cmt_cf` int(11) NOT NULL default '1',
   PRIMARY KEY (`cmt_id`),
   KEY `cmt_object_id` (`cmt_object_id`,`cmt_parent_id`),
   FULLTEXT KEY `search_fields` (`cmt_text`)
@@ -142,6 +143,7 @@ CREATE TABLE IF NOT EXISTS `bx_albums_cmts_media` (
   `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',
+  `cmt_cf` int(11) NOT NULL default '1',
   PRIMARY KEY (`cmt_id`),
   KEY `cmt_object_id` (`cmt_object_id`,`cmt_parent_id`),
   FULLTEXT KEY `search_fields` (`cmt_text`)

+ 1 - 0
modules/boonex/channels/install/sql/install.sql

@@ -85,6 +85,7 @@ CREATE TABLE IF NOT EXISTS `bx_cnl_cmts` (
   `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',
+  `cmt_cf` int(11) NOT NULL default '1',
   PRIMARY KEY (`cmt_id`),
   KEY `cmt_object_id` (`cmt_object_id`,`cmt_parent_id`),
   FULLTEXT KEY `search_fields` (`cmt_text`)

+ 1 - 0
modules/boonex/classes/install/sql/install.sql

@@ -206,6 +206,7 @@ CREATE TABLE IF NOT EXISTS `bx_classes_cmts` (
   `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',
+  `cmt_cf` int(11) NOT NULL default '1',
   PRIMARY KEY (`cmt_id`),
   KEY `cmt_object_id` (`cmt_object_id`,`cmt_parent_id`),
   FULLTEXT KEY `search_fields` (`cmt_text`)

+ 1 - 0
modules/boonex/convos/install/sql/install.sql

@@ -94,6 +94,7 @@ CREATE TABLE IF NOT EXISTS `bx_convos_cmts` (
   `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',
+  `cmt_cf` int(11) NOT NULL default '1',
   PRIMARY KEY (`cmt_id`),
   KEY `cmt_object_id` (`cmt_object_id`,`cmt_parent_id`),
   FULLTEXT KEY `search_fields` (`cmt_text`)

+ 1 - 0
modules/boonex/courses/install/sql/install.sql

@@ -80,6 +80,7 @@ CREATE TABLE IF NOT EXISTS `bx_courses_cmts` (
   `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',
+  `cmt_cf` int(11) NOT NULL default '1',
   PRIMARY KEY (`cmt_id`),
   KEY `cmt_object_id` (`cmt_object_id`,`cmt_parent_id`),
   FULLTEXT KEY `search_fields` (`cmt_text`)

+ 38 - 37
modules/boonex/english/data/langs/system/en.xml

@@ -1486,30 +1486,30 @@
 	<string name="_adm_stg_cpt_option_lang_subst_from_en"><![CDATA[Substitute (during compilation) missing translations with english ones]]></string>	
 	<string name="_adm_stg_cpt_option_permalinks_modules"><![CDATA[Enable friendly permalinks for Modules]]></string>
     <string name="_adm_stg_cpt_option_permalinks_pages"><![CDATA[Enable friendly permalinks for Pages]]></string>
-	<string name="_adm_stg_cpt_option_permalinks_storage"><![CDATA[Enable friendly permalinks for local Storage]]></string>
+    <string name="_adm_stg_cpt_option_permalinks_storage"><![CDATA[Enable friendly permalinks for local Storage]]></string>
     <string name="_adm_stg_cpt_option_permalinks_seo_links"><![CDATA[Enable SEO links]]></string>
     <string name="_adm_stg_cpt_option_permalinks_seo_links_redirects"><![CDATA[Enable redirect from regular to SEO links]]></string>
-	<string name="_adm_stg_cpt_option_site_email"><![CDATA[Email to receive critical site notifications]]></string>
-	<string name="_adm_stg_cpt_option_site_email_notify"><![CDATA[Email to send site messages from]]></string>
-	<string name="_adm_stg_cpt_option_site_email_html_template_header"><![CDATA[Email template header]]></string>
-	<string name="_adm_stg_cpt_option_site_email_html_template_footer"><![CDATA[Email template footer]]></string>
-	<string name="_adm_stg_cpt_option_site_login_social_compact"><![CDATA[Enable compact view for social login]]></string>
-	<string name="_adm_stg_cpt_option_site_title"><![CDATA[Site title]]></string>
-	<string name="_adm_stg_cpt_option_site_tour_home"><![CDATA[Site home page tour]]></string>
+    <string name="_adm_stg_cpt_option_site_email"><![CDATA[Email to receive critical site notifications]]></string>
+    <string name="_adm_stg_cpt_option_site_email_notify"><![CDATA[Email to send site messages from]]></string>
+    <string name="_adm_stg_cpt_option_site_email_html_template_header"><![CDATA[Email template header]]></string>
+    <string name="_adm_stg_cpt_option_site_email_html_template_footer"><![CDATA[Email template footer]]></string>
+    <string name="_adm_stg_cpt_option_site_login_social_compact"><![CDATA[Enable compact view for social login]]></string>
+    <string name="_adm_stg_cpt_option_site_title"><![CDATA[Site title]]></string>
+    <string name="_adm_stg_cpt_option_site_tour_home"><![CDATA[Site home page tour]]></string>
     <string name="_adm_stg_cpt_option_site_tour_studio"><![CDATA[Studio home page tour]]></string>
     <string name="_adm_stg_cpt_option_smart_app_banner"><![CDATA[Smart App Banner]]></string>
     <string name="_adm_stg_cpt_option_smart_app_banner_ios_app_id"><![CDATA[iOS app ID for Smart App Banner]]></string>
-	<string name="_adm_stg_cpt_option_sys_account_activation_letter"><![CDATA[Enable account activation letter]]></string>
-	<string name="_adm_stg_cpt_option_sys_account_confirmation_type"><![CDATA[Account is confirmed when]]></string>
-	<string name="_adm_stg_cpt_option_sys_account_hide_unconfirmed_accounts"><![CDATA[Hide profiles which have unconfirmed account]]></string>
-	<string name="_adm_stg_cpt_option_sys_account_2fa_enable"><![CDATA[Enable 2 Factor Authentication]]></string>
-  <string name="_adm_stg_cpt_option_sys_account_2fa_lifetime"><![CDATA[2FA code lifetime, in seconds (0 - send code upon each login)]]></string>
-	<string name="_adm_stg_cpt_option_sys_account_autoapproval"><![CDATA[Automatic account activation after creation]]></string>
-	<string name="_adm_stg_cpt_option_sys_account_auto_profile_creation"><![CDATA[Automatic profile creation from account name]]></string>
-	<string name="_adm_stg_cpt_option_sys_account_online_time"><![CDATA[Online status timeframe (minutes)]]></string>
+    <string name="_adm_stg_cpt_option_sys_account_activation_letter"><![CDATA[Enable account activation letter]]></string>
+    <string name="_adm_stg_cpt_option_sys_account_confirmation_type"><![CDATA[Account is confirmed when]]></string>
+    <string name="_adm_stg_cpt_option_sys_account_hide_unconfirmed_accounts"><![CDATA[Hide profiles which have unconfirmed account]]></string>
+    <string name="_adm_stg_cpt_option_sys_account_2fa_enable"><![CDATA[Enable 2 Factor Authentication]]></string>
+    <string name="_adm_stg_cpt_option_sys_account_2fa_lifetime"><![CDATA[2FA code lifetime, in seconds (0 - send code upon each login)]]></string>
+    <string name="_adm_stg_cpt_option_sys_account_autoapproval"><![CDATA[Automatic account activation after creation]]></string>
+    <string name="_adm_stg_cpt_option_sys_account_auto_profile_creation"><![CDATA[Automatic profile creation from account name]]></string>
+    <string name="_adm_stg_cpt_option_sys_account_online_time"><![CDATA[Online status timeframe (minutes)]]></string>
     <string name="_adm_stg_err_option_sys_account_online_time"><![CDATA[You need to enter a value greater than zero.]]></string>
     <string name="_adm_stg_cpt_option_sys_account_default_profile_type"><![CDATA[Default profile type]]></string>
-	<string name="_adm_stg_cpt_option_sys_account_limit_profiles_number"><![CDATA[Limit number of profiles (0 - no limit)]]></string>
+    <string name="_adm_stg_cpt_option_sys_account_limit_profiles_number"><![CDATA[Limit number of profiles (0 - no limit)]]></string>
     <string name="_adm_stg_cpt_option_sys_account_limit_incorrect_login_attempts"><![CDATA[Max number of logins attempts (0 - no limit)]]></string>
     <string name="_adm_stg_cpt_option_sys_account_reset_password_key_lifetime"><![CDATA[Reset password key lifetime (in seconds)]]></string>
     <string name="_adm_stg_cpt_option_sys_account_reset_password_redirect"><![CDATA[Redirect after reset password to]]></string>
@@ -1521,9 +1521,9 @@
     <string name="_adm_stg_cpt_option_value_sys_account_reset_password_redirect_profile_edit"><![CDATA[Edit profile page]]></string>
     <string name="_adm_stg_cpt_option_value_sys_account_reset_password_redirect_custom"><![CDATA[Custom page]]></string>
     <string name="_adm_stg_cpt_option_sys_account_reset_password_redirect_custom"><![CDATA[URL for 'Custom Page' redirect]]></string>
-	<string name="_adm_stg_cpt_option_sys_acl_expire_notification_days"><![CDATA[Number of days before membership expiration to notify members (-1 = after expiration)]]></string>
-	<string name="_adm_stg_cpt_option_sys_acl_expire_notify_once"><![CDATA[Notify members about membership expiration only once (every day otherwise)]]></string>
-	<string name="_adm_stg_cpt_option_sys_add_nofollow"><![CDATA[Add "nofollow" attribute for external links]]></string>
+    <string name="_adm_stg_cpt_option_sys_acl_expire_notification_days"><![CDATA[Number of days before membership expiration to notify members (-1 = after expiration)]]></string>
+    <string name="_adm_stg_cpt_option_sys_acl_expire_notify_once"><![CDATA[Notify members about membership expiration only once (every day otherwise)]]></string>
+    <string name="_adm_stg_cpt_option_sys_add_nofollow"><![CDATA[Add "nofollow" attribute for external links]]></string>
     <string name="_adm_stg_cpt_option_sys_audit_enable"><![CDATA[Enable]]></string>
     <string name="_adm_stg_cpt_option_sys_audit_max_records"><![CDATA[Number of log records]]></string>
     <string name="_adm_stg_cpt_option_sys_audit_days_before_expire"><![CDATA[Delete logs older than (days)]]></string>
@@ -1534,6 +1534,7 @@
     <string name="_adm_stg_cpt_option_sys_cache_memcache_port"><![CDATA[Memcached server port]]></string>
     <string name="_adm_stg_cpt_option_sys_captcha_default"><![CDATA[Default Сaptcha]]></string>
     <string name="_adm_stg_cpt_option_sys_cf_enable"><![CDATA[Enable content filters]]></string>
+    <string name="_adm_stg_cpt_option_sys_cf_enable_comments"><![CDATA[Enable content filters for comments]]></string>
     <string name="_adm_stg_cpt_option_sys_cf_prohibited"><![CDATA[Prohibited content]]></string>
     <string name="_adm_stg_cpt_option_sys_email_attachable_email_templates"><![CDATA[Attachable email templates list]]></string>
     <string name="_adm_stg_cpt_option_sys_db_cache_enable"><![CDATA[Enable DB cache]]></string>
@@ -1559,23 +1560,23 @@
     <string name="_adm_stg_cpt_option_sys_location_map_default"><![CDATA[Location map provider]]></string>
     <string name="_adm_stg_cpt_option_sys_location_map_zoom_default"><![CDATA[Location map zoom]]></string>
     <string name="_adm_stg_cpt_option_sys_location_leaflet_provider"><![CDATA[Leaflet tile layers provider]]></string>
-	<string name="_adm_stg_cpt_option_sys_maps_api_key"><![CDATA[Google Maps API key]]></string>
-	<string name="_adm_stg_cpt_option_sys_embed_default"><![CDATA[Embeds provider]]></string>
-	<string name="_adm_stg_cpt_option_sys_embedly_api_key"><![CDATA[Embed.ly API key (fill in to use instead of Iframely)]]></string>
-	<string name="_adm_stg_cpt_option_sys_embedly_api_pattern"><![CDATA[Embed.ly API pattern (fill in to use instead of Iframely)]]></string>
-	<string name="_adm_stg_cpt_option_sys_iframely_api_key"><![CDATA[Iframely API key]]></string>
-        <string name="_adm_stg_cpt_option_sys_eq_time"><![CDATA[Email queue execution flag]]></string>
-	<string name="_adm_stg_cpt_option_sys_eq_send_per_start"><![CDATA[Number of messages to send from mail queue per run]]></string>
-        <string name="_adm_stg_cpt_option_sys_eq_send_per_start_to_recipient"><![CDATA[Number of messages to send from mail queue per run to the same recipient]]></string>
-	<string name="_adm_stg_cpt_option_sys_oauth_key"><![CDATA[UNA account key]]></string>
-	<string name="_adm_stg_cpt_option_sys_oauth_secret"><![CDATA[UNA account secret]]></string>
-	<string name="_adm_stg_cpt_option_sys_page_cache_enable"><![CDATA[Enable Page cache]]></string>
-	<string name="_adm_stg_cpt_option_sys_page_cache_engine"><![CDATA[Page cache engine (other than File option may require custom server setup)]]></string>
-	<string name="_adm_stg_cpt_option_sys_pb_cache_enable"><![CDATA[Enable page blocks cache]]></string>
-	<string name="_adm_stg_cpt_option_sys_pb_cache_engine"><![CDATA[Page blocks cache engine (other than File option may require custom server setup)]]></string>
-	<string name="_adm_stg_cpt_option_sys_per_page_search_keyword_single"><![CDATA[Number of items in Keyword Search results]]></string>
-	<string name="_adm_stg_cpt_option_sys_per_page_search_keyword_plural"><![CDATA[Number of items in Site Search results]]></string>
-	<string name="_adm_stg_cpt_option_sys_push_app_id"><![CDATA[OneSignal App ID]]></string>
+    <string name="_adm_stg_cpt_option_sys_maps_api_key"><![CDATA[Google Maps API key]]></string>
+    <string name="_adm_stg_cpt_option_sys_embed_default"><![CDATA[Embeds provider]]></string>
+    <string name="_adm_stg_cpt_option_sys_embedly_api_key"><![CDATA[Embed.ly API key (fill in to use instead of Iframely)]]></string>
+    <string name="_adm_stg_cpt_option_sys_embedly_api_pattern"><![CDATA[Embed.ly API pattern (fill in to use instead of Iframely)]]></string>
+    <string name="_adm_stg_cpt_option_sys_iframely_api_key"><![CDATA[Iframely API key]]></string>
+    <string name="_adm_stg_cpt_option_sys_eq_time"><![CDATA[Email queue execution flag]]></string>
+    <string name="_adm_stg_cpt_option_sys_eq_send_per_start"><![CDATA[Number of messages to send from mail queue per run]]></string>
+    <string name="_adm_stg_cpt_option_sys_eq_send_per_start_to_recipient"><![CDATA[Number of messages to send from mail queue per run to the same recipient]]></string>
+    <string name="_adm_stg_cpt_option_sys_oauth_key"><![CDATA[UNA account key]]></string>
+    <string name="_adm_stg_cpt_option_sys_oauth_secret"><![CDATA[UNA account secret]]></string>
+    <string name="_adm_stg_cpt_option_sys_page_cache_enable"><![CDATA[Enable Page cache]]></string>
+    <string name="_adm_stg_cpt_option_sys_page_cache_engine"><![CDATA[Page cache engine (other than File option may require custom server setup)]]></string>
+    <string name="_adm_stg_cpt_option_sys_pb_cache_enable"><![CDATA[Enable page blocks cache]]></string>
+    <string name="_adm_stg_cpt_option_sys_pb_cache_engine"><![CDATA[Page blocks cache engine (other than File option may require custom server setup)]]></string>
+    <string name="_adm_stg_cpt_option_sys_per_page_search_keyword_single"><![CDATA[Number of items in Keyword Search results]]></string>
+    <string name="_adm_stg_cpt_option_sys_per_page_search_keyword_plural"><![CDATA[Number of items in Site Search results]]></string>
+    <string name="_adm_stg_cpt_option_sys_push_app_id"><![CDATA[OneSignal App ID]]></string>
     <string name="_adm_stg_cpt_option_sys_push_rest_api"><![CDATA[REST API Key]]></string>
     <string name="_adm_stg_cpt_option_sys_push_short_name"><![CDATA[Short name (required only for http sites. It must match the Subdomain you entered on the Web Push settings on the OneSignal dashboard)]]></string>
     <string name="_adm_stg_cpt_option_sys_push_safari_id"><![CDATA[Apple Safari Web ID on the Web Push settings]]></string>

+ 1 - 0
modules/boonex/events/install/sql/install.sql

@@ -100,6 +100,7 @@ CREATE TABLE IF NOT EXISTS `bx_events_cmts` (
   `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',
+  `cmt_cf` int(11) NOT NULL default '1',
   PRIMARY KEY (`cmt_id`),
   KEY `cmt_object_id` (`cmt_object_id`,`cmt_parent_id`),
   FULLTEXT KEY `search_fields` (`cmt_text`)

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

@@ -86,6 +86,7 @@ CREATE TABLE IF NOT EXISTS `bx_files_cmts` (
   `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',
+  `cmt_cf` int(11) NOT NULL default '1',
   PRIMARY KEY (`cmt_id`),
   KEY `cmt_object_id` (`cmt_object_id`,`cmt_parent_id`),
   FULLTEXT KEY `search_fields` (`cmt_text`)

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

@@ -22,7 +22,7 @@ DELETE FROM `sys_form_pre_lists` WHERE `module` = 'bx_files';
 DELETE FROM `sys_form_pre_values` WHERE `Key` IN('bx_files_cats');
 
 -- COMMENTS
-DELETE FROM `sys_objects_cmts` WHERE `Name` = 'bx_files';
+DELETE FROM `sys_objects_cmts` WHERE `Name` LIKE 'bx_files%';
 
 -- VOTES
 DELETE FROM `sys_objects_vote` WHERE `Name` IN ('bx_files', 'bx_files_reactions');

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

@@ -172,6 +172,7 @@ CREATE TABLE IF NOT EXISTS `bx_forum_cmts` (
   `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',
+  `cmt_cf` int(11) NOT NULL default '1',
   PRIMARY KEY (`cmt_id`),
   KEY `cmt_object_id` (`cmt_object_id`,`cmt_parent_id`),
   FULLTEXT KEY `search_fields` (`cmt_text`)

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

@@ -80,6 +80,7 @@ CREATE TABLE IF NOT EXISTS `bx_glossary_cmts` (
   `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',
+  `cmt_cf` int(11) NOT NULL default '1',
   PRIMARY KEY (`cmt_id`),
   KEY `cmt_object_id` (`cmt_object_id`,`cmt_parent_id`),
   FULLTEXT KEY `search_fields` (`cmt_text`)

+ 1 - 0
modules/boonex/groups/install/sql/install.sql

@@ -80,6 +80,7 @@ CREATE TABLE IF NOT EXISTS `bx_groups_cmts` (
   `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',
+  `cmt_cf` int(11) NOT NULL default '1',
   PRIMARY KEY (`cmt_id`),
   KEY `cmt_object_id` (`cmt_object_id`,`cmt_parent_id`),
   FULLTEXT KEY `search_fields` (`cmt_text`)

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

@@ -192,6 +192,7 @@ CREATE TABLE IF NOT EXISTS `bx_market_cmts` (
   `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',
+  `cmt_cf` int(11) NOT NULL default '1',
   PRIMARY KEY (`cmt_id`),
   KEY `cmt_object_id` (`cmt_object_id`,`cmt_parent_id`),
   FULLTEXT KEY `search_fields` (`cmt_text`)

+ 1 - 0
modules/boonex/organizations/install/sql/install.sql

@@ -82,6 +82,7 @@ CREATE TABLE IF NOT EXISTS `bx_organizations_cmts` (
   `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',
+  `cmt_cf` int(11) NOT NULL default '1',
   PRIMARY KEY (`cmt_id`),
   KEY `cmt_object_id` (`cmt_object_id`,`cmt_parent_id`),
   FULLTEXT KEY `search_fields` (`cmt_text`)

+ 1 - 0
modules/boonex/persons/install/sql/install.sql

@@ -81,6 +81,7 @@ CREATE TABLE IF NOT EXISTS `bx_persons_cmts` (
   `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',
+  `cmt_cf` int(11) NOT NULL default '1',
   PRIMARY KEY (`cmt_id`),
   KEY `cmt_object_id` (`cmt_object_id`,`cmt_parent_id`),
   FULLTEXT KEY `search_fields` (`cmt_text`)

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

@@ -81,6 +81,7 @@ CREATE TABLE IF NOT EXISTS `bx_photos_cmts` (
   `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',
+  `cmt_cf` int(11) NOT NULL default '1',
   PRIMARY KEY (`cmt_id`),
   KEY `cmt_object_id` (`cmt_object_id`,`cmt_parent_id`),
   FULLTEXT KEY `search_fields` (`cmt_text`)

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

@@ -90,6 +90,7 @@ CREATE TABLE IF NOT EXISTS `bx_polls_cmts` (
   `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',
+  `cmt_cf` int(11) NOT NULL default '1',
   PRIMARY KEY (`cmt_id`),
   KEY `cmt_object_id` (`cmt_object_id`,`cmt_parent_id`),
   FULLTEXT KEY `search_fields` (`cmt_text`)

+ 1 - 0
modules/boonex/posts/install/sql/install.sql

@@ -178,6 +178,7 @@ CREATE TABLE IF NOT EXISTS `bx_posts_cmts` (
   `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',
+  `cmt_cf` int(11) NOT NULL default '1',
   PRIMARY KEY (`cmt_id`),
   KEY `cmt_object_id` (`cmt_object_id`,`cmt_parent_id`),
   FULLTEXT KEY `search_fields` (`cmt_text`)

+ 1 - 0
modules/boonex/reviews/install/sql/install.sql

@@ -151,6 +151,7 @@ CREATE TABLE IF NOT EXISTS `bx_reviews_cmts` (
   `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',
+  `cmt_cf` int(11) NOT NULL default '1',
   PRIMARY KEY (`cmt_id`),
   KEY `cmt_object_id` (`cmt_object_id`,`cmt_parent_id`),
   FULLTEXT KEY `search_fields` (`cmt_text`)

+ 1 - 0
modules/boonex/russian/data/langs/system/ru.xml

@@ -1519,6 +1519,7 @@
     <string name="_adm_stg_cpt_option_sys_cache_memcache_port"><![CDATA[Memcached - порт сервера]]></string>
     <string name="_adm_stg_cpt_option_sys_captcha_default"><![CDATA[CAPTCHA по умолчанию]]></string>
     <string name="_adm_stg_cpt_option_sys_cf_enable"><![CDATA[Включить контентные фильтры]]></string>
+    <string name="_adm_stg_cpt_option_sys_cf_enable_comments"><![CDATA[Включить контентные фильтры для комментариев]]></string>
     <string name="_adm_stg_cpt_option_sys_cf_prohibited"><![CDATA[Запрещенный контент]]></string>
     <string name="_adm_stg_cpt_option_sys_email_attachable_email_templates"><![CDATA[Список присоединяемых email темплейтов]]></string>
     <string name="_adm_stg_cpt_option_sys_db_cache_enable"><![CDATA[Задействовать кэш БД]]></string>

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

@@ -56,6 +56,7 @@ CREATE TABLE IF NOT EXISTS `bx_shopify_cmts` (
   `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',
+  `cmt_cf` int(11) NOT NULL default '1',
   PRIMARY KEY (`cmt_id`),
   KEY `cmt_object_id` (`cmt_object_id`,`cmt_parent_id`),
   FULLTEXT KEY `search_fields` (`cmt_text`)

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

@@ -91,6 +91,7 @@ CREATE TABLE IF NOT EXISTS `bx_snipcart_cmts` (
   `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',
+  `cmt_cf` int(11) NOT NULL default '1',
   PRIMARY KEY (`cmt_id`),
   KEY `cmt_object_id` (`cmt_object_id`,`cmt_parent_id`),
   FULLTEXT KEY `search_fields` (`cmt_text`)

+ 1 - 0
modules/boonex/spaces/install/sql/install.sql

@@ -82,6 +82,7 @@ CREATE TABLE IF NOT EXISTS `bx_spaces_cmts` (
   `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',
+  `cmt_cf` int(11) NOT NULL default '1',
   PRIMARY KEY (`cmt_id`),
   KEY `cmt_object_id` (`cmt_object_id`,`cmt_parent_id`),
   FULLTEXT KEY `search_fields` (`cmt_text`)

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

@@ -105,6 +105,7 @@ CREATE TABLE IF NOT EXISTS `bx_stream_cmts` (
   `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',
+  `cmt_cf` int(11) NOT NULL default '1',
   PRIMARY KEY (`cmt_id`),
   KEY `cmt_object_id` (`cmt_object_id`,`cmt_parent_id`),
   FULLTEXT KEY `search_fields` (`cmt_text`)

+ 1 - 0
modules/boonex/tasks/install/sql/install.sql

@@ -168,6 +168,7 @@ CREATE TABLE IF NOT EXISTS `bx_tasks_cmts` (
   `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',
+  `cmt_cf` int(11) NOT NULL default '1',
   PRIMARY KEY (`cmt_id`),
   KEY `cmt_object_id` (`cmt_object_id`,`cmt_parent_id`),
   FULLTEXT KEY `search_fields` (`cmt_text`)

+ 1 - 0
modules/boonex/timeline/install/sql/install.sql

@@ -224,6 +224,7 @@ CREATE TABLE IF NOT EXISTS `bx_timeline_comments` (
   `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',
+  `cmt_cf` int(11) NOT NULL default '1',
   PRIMARY KEY (`cmt_id`),
   KEY `cmt_object_id` (`cmt_object_id`,`cmt_parent_id`),
   FULLTEXT KEY `search_fields` (`cmt_text`)

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

@@ -104,6 +104,7 @@ CREATE TABLE IF NOT EXISTS `bx_videos_cmts` (
   `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',
+  `cmt_cf` int(11) NOT NULL default '1',
   PRIMARY KEY (`cmt_id`),
   KEY `cmt_object_id` (`cmt_object_id`,`cmt_parent_id`),
   FULLTEXT KEY `search_fields` (`cmt_text`)

+ 1 - 1
template/scripts/BxBaseCmts.php

@@ -158,7 +158,7 @@ class BxBaseCmts extends BxDolCmts
         $sPostFormBottom = $this->getFormBoxPost($aBp, array_merge($aDp, array('type' => $this->_sDisplayType, 'position' => BX_CMT_PFP_BOTTOM)));
         $sJsContent = $this->getJsScript($aBp, $aDp);
 
-        $sBlockTitle = _t($this->_aT['block_comments_title'], $this->getCommentsCountAll());
+        $sBlockTitle = _t($this->_aT['block_comments_title'], $this->getCommentsCountAll(0, true));
         $sBlockMenu = $this->_getControlsBox();
 
         bx_alert('system', 'view_comments', 0, 0, array(

+ 11 - 0
template/scripts/BxBaseCmtsForm.php

@@ -135,6 +135,17 @@ class BxBaseCmtsForm extends BxTemplFormView
         return true;
     }
 
+    protected function genCustomRowCmtCf(&$aInput)
+    {
+        $aInput = BxDolContentFilter::getInstance()->getInputForComments($aInput);
+        if($aInput['type'] == 'hidden') {
+            $this->_sCodeAdd .= $this->genInput($aInput);
+            return '';
+        }
+
+        return $this->genRowStandard($aInput);
+    }
+
     protected function _getObject($sSystem, $iId)
     {
         if(empty($this->_oObject))

+ 10 - 0
template/scripts/BxBaseCmtsNotes.php

@@ -16,6 +16,16 @@ class BxBaseCmtsNotes extends BxDolCmtsNotes
     {
         parent::__construct($sSystem, $iId, $iInit, $oTemplate);
     }
+
+    protected function _getForm($sAction, $iId)
+    {
+        $oForm = parent::_getForm($sAction, $iId);
+
+        if(isset($oForm->aInputs['cmt_cf']))
+            unset($oForm->aInputs['cmt_cf']);
+
+        return $oForm;
+    }
 }
 
 /** @} */

+ 11 - 9
template/scripts/BxBaseFormView.php

@@ -787,6 +787,17 @@ BLAH;
         return $this->genViewRowWrapped($aInput);
     }
 
+    protected function genCustomRowCf(&$aInput)
+    {
+        $aInput = BxDolContentFilter::getInstance()->getInput($aInput);
+        if($aInput['type'] == 'hidden') {
+            $this->_sCodeAdd .= $this->genInput($aInput);
+            return '';
+        }
+
+        return $this->genRowStandard($aInput);
+    }
+
     protected function genCustomViewRowValueBirthday(&$aInput)
     {
         if(!isset($aInput['value']) || !$aInput['value'] || in_array($aInput['value'], array('0000-00-00', '0000-00-00 00:00:00')))
@@ -1636,15 +1647,6 @@ BLAH;
         ));
     }
 
-    protected function genCustomInputCf (&$aInput)
-    {
-        $aInput = BxDolContentFilter::getInstance()->getInputByProfileId($aInput);
-        if($aInput['type'] == 'hidden')
-            return $this->genInputStandard($aInput);
-
-        return $this->genInputSelect($aInput);
-    }
-
     /**
      * Generate Select Element	
      *