소스 검색

#4369 - New PUSH server integration

roman.lesnikov@gmail.com 3 년 전
부모
커밋
fa7ec1e63b
2개의 변경된 파일과 12개의 추가작업 그리고 8개의 파일을 삭제
  1. 7 6
      inc/classes/BxDolSockets.php
  2. 5 2
      template/scripts/BxBaseCmtsServices.php

+ 7 - 6
inc/classes/BxDolSockets.php

@@ -17,12 +17,13 @@ class BxDolSockets extends BxDolFactory implements iBxDolSingleton
     protected function __construct()
     protected function __construct()
     {
     {
         parent::__construct();
         parent::__construct();
-        $a = parse_url(getParam('sys_sockets_url'));
-        $this->_sHost = $a['host'];
-        $this->_sPort = $a['port'];
-        $this->_sScheme = $a['scheme'];
-        if (getParam('sys_sockets_type') != 'sys_sockets_disabled')
-            $this->_sIsEnabled =true;
+        if (getParam('sys_sockets_type') != 'sys_sockets_disabled' && trim(getParam('sys_sockets_url')) != ''){
+            $this->_sIsEnabled = true;
+            $a = parse_url(getParam('sys_sockets_url'));
+            $this->_sHost = $a['host'];
+            $this->_sPort = $a['port'];
+            $this->_sScheme = $a['scheme'];
+        }    
     }
     }
 
 
     static public function getInstance()
     static public function getInstance()

+ 5 - 2
template/scripts/BxBaseCmtsServices.php

@@ -511,11 +511,13 @@ class BxBaseCmtsServices extends BxDol
     
     
     public function serviceGetCommentsApi($oCmts, $aParams)
     public function serviceGetCommentsApi($oCmts, $aParams)
     {
     {
-        
         $mixedResult = $oCmts->isViewAllowed();
         $mixedResult = $oCmts->isViewAllowed();
         if($mixedResult !== CHECK_ACTION_RESULT_ALLOWED)
         if($mixedResult !== CHECK_ACTION_RESULT_ALLOWED)
             return $mixedResult; // TODO: error checking
             return $mixedResult; // TODO: error checking
 
 
+        if (isset($aParams['comment_id']))
+            $aParams['comment_id'] = explode(',', $aParams['comment_id']);
+       
         $aBp = !isset($aParams['aBp']) ? [] : $aParams['aBp'];
         $aBp = !isset($aParams['aBp']) ? [] : $aParams['aBp'];
         $aDp = ['in_designbox' => false, 'show_empty' => false];
         $aDp = ['in_designbox' => false, 'show_empty' => false];
         
         
@@ -533,7 +535,8 @@ class BxBaseCmtsServices extends BxDol
              $aBp['per_view'] = $aParams['per_view'];
              $aBp['per_view'] = $aParams['per_view'];
         }
         }
 
 
-        $aCmts = isset($aParams['comment_id']) ? [['cmt_id' => $aParams['comment_id']]] : $oCmts->getCommentsArray($aBp['vparent_id'], $aBp['filter'], $aBp['order'], $aBp['start'], $aBp[($aBp['init_view'] != -1 ? 'init' : 'per') . '_view']);
+        $aCmts = isset($aParams['comment_id']) ? array_map(function($value) {return ['cmt_id' => $value];}, $aParams['comment_id']) : $oCmts->getCommentsArray($aBp['vparent_id'], $aBp['filter'], $aBp['order'], $aBp['start'], $aBp[($aBp['init_view'] != -1 ? 'init' : 'per') . '_view']);
+
         
         
         $aParams['start_from'] = 0;
         $aParams['start_from'] = 0;
         if (count($aCmts) == $aBp['per_view']){
         if (count($aCmts) == $aBp['per_view']){