瀏覽代碼

Merge branch 'master' of https://github.com/unaio/una

AntonLV 4 年之前
父節點
當前提交
453646ee54
共有 2 個文件被更改,包括 31 次插入 和 1 次删除
  1. 1 1
      inc/classes/BxDolCmtsQuery.php
  2. 30 0
      modules/boonex/timeline/classes/BxTimelineModule.php

+ 1 - 1
inc/classes/BxDolCmtsQuery.php

@@ -357,7 +357,7 @@ class BxDolCmtsQuery extends BxDolDb
             LEFT JOIN `{$this->_sTableIds}` ON (`{$this->_sTable}`.`cmt_id` = `{$this->_sTableIds}`.`cmt_id` AND `{$this->_sTableIds}`.`system_id` = :system_id) 
             INNER JOIN `sys_profiles` AS `p` ON (`p`.`id` = `{$this->_sTable}`.`cmt_author_id` AND (`p`.`status` = 'active' OR `{$this->_sTable}`.`cmt_replies` != 0))";
            
-        bx_alert('comment', 'get_comments', 0, bx_get_logged_profile_id(), array('system' => $this->_oMain->getSystemInfo(), 'select_clause' => &$sQuery, 'join_clause' => &$sJoin, 'where_clause' => &$sWhereClause, 'order_clause' => &$sOrder, 'limit_clause' => &$sLimit)); 
+        bx_alert('comment', 'get_comments', 0, bx_get_logged_profile_id(), array('system' => $this->_oMain->getSystemInfo(), 'select_clause' => &$sQuery, 'join_clause' => &$sJoin, 'where_clause' => &$sWhereClause, 'order_clause' => &$sOrder, 'limit_clause' => &$sLimit, 'params' => &$aBindings)); 
         $sQuery = $sQuery . $sJoin . " WHERE `{$this->_sTable}`.`cmt_object_id` = :cmt_object_id" . $sWhereClause . $sOrder . $sLimit;
         
         return $this->getAll($sQuery, $aBindings);

+ 30 - 0
modules/boonex/timeline/classes/BxTimelineModule.php

@@ -1374,6 +1374,36 @@ class BxTimelineModule extends BxBaseModNotificationsModule implements iBxDolCon
             'form_display' => $this->_oConfig->getPostFormDisplay($sType)
         ));
     }
+    
+    /**
+     * @page service Service Calls
+     * @section bx_timeline Timeline
+     * @subsection bx_timeline-page_blocks Page Blocks
+     * @subsubsection bx_timeline-get_block_post_custom get_block_post_custom
+     * 
+     * @code bx_srv('bx_timeline', 'get_block_post_custom', [...]); @endcode
+     * 
+     * Get Post block for the Custom timeline.
+     *
+     * @return an array describing a block to display on the site. All necessary CSS and JS files are automatically added to the HEAD section of the site HTML.
+     * 
+     * @see BxTimelineModule::serviceGetBlockPostCustom
+     */
+    /** 
+     * @ref bx_timeline-get_block_post_custom "get_block_post_custom"
+     */
+    public function serviceGetBlockPostCustom($aParams)
+    {
+        if(!isLogged())
+            return '';
+
+        $iProfileId = $this->getProfileId();
+
+        if (!isset($aParams['form_display']))
+            $aParams['form_display'] = $this->_oConfig->getPostFormDisplay($aParams['type']);
+        
+        return $this->_getBlockPost($iProfileId, $aParams);
+    }
 
     /**
      * @page service Service Calls