1
0
AntonLV 7 жил өмнө
parent
commit
3f1774dfbe

+ 4 - 0
inc/classes/BxDolMetatags.php

@@ -323,6 +323,10 @@ class BxDolMetatags extends BxDolFactory implements iBxDolFactoryObject
     public function keywordsAddOne($iId, $s, $bDeletePreviousKeywords = true)
     {
         if ($iRet = $this->_oQuery->keywordsAdd($iId, array($s), $bDeletePreviousKeywords)) {
+            /*
+             * TODO: Module name should be passed in Extras, because for now 'object' is used as module name.
+             * So, module field should be added in sys_objects_metatags table.
+             */
             bx_alert($this->_sObject, 'keyword_added', $iId, bx_get_logged_profile_id(), array('meta' => $s, 'content_id' => $iId));
             bx_alert('meta_keyword', 'added', $iId, bx_get_logged_profile_id(), array('meta' => $s, 'content_id' => $iId, 'object' => $this->_sObject));
         }

+ 2 - 1
modules/base/general/classes/BxBaseModGeneralModule.php

@@ -1003,7 +1003,8 @@ class BxBaseModGeneralModule extends BxDolModule
             $sTitle = $aContentInfo[$CNF['FIELD_TEXT']];
 
         return array(
-            'owner_id' => $iAuthorId,
+            'owner_id' => $aEvent['owner_id'],
+            'object_owner_id' => $iAuthorId,
             'icon' => !empty($CNF['ICON']) ? $CNF['ICON'] : '',
             'sample' => isset($CNF['T']['txt_sample_single_with_article']) ? $CNF['T']['txt_sample_single_with_article'] : $CNF['T']['txt_sample_single'],
             'sample_wo_article' => $CNF['T']['txt_sample_single'],

+ 2 - 1
modules/base/profile/classes/BxBaseModProfileModule.php

@@ -1371,7 +1371,8 @@ class BxBaseModProfileModule extends BxBaseModGeneralModule implements iBxDolCon
         $sDescription = _t($CNF['T'][$aBuildParams['txt_sau']], $sUserName, _t($sSample));
 
         return array(
-            'owner_id' => $aContentInfo['profile_id'],
+            'owner_id' => $aEvent['owner_id'],
+            'object_owner_id' => $aContentInfo['profile_id'],
             'icon' => !empty($CNF['ICON']) ? $CNF['ICON'] : '',
             'sample' => $sSample,
             'sample_wo_article' => $CNF['T'][$aBuildParams['txt_ss']],

+ 2 - 1
modules/boonex/albums/classes/BxAlbumsModule.php

@@ -414,7 +414,8 @@ class BxAlbumsModule extends BxBaseModTextModule
         $sTitle = isset($CNF['FIELD_TITLE']) && isset($aContentInfo[$CNF['FIELD_TITLE']]) ? $aContentInfo[$CNF['FIELD_TITLE']] : (isset($CNF['FIELD_TEXT']) && isset($aContentInfo[$CNF['FIELD_TEXT']]) ? strmaxtextlen($aContentInfo[$CNF['FIELD_TEXT']], 20, '...') : '');
 
         return array(
-            'owner_id' => $aContentInfo['author'],
+            'owner_id' => $aEvent['owner_id'],
+            'object_owner_id' => $aContentInfo['author'],
             'icon' => !empty($CNF['ICON']) ? $CNF['ICON'] : '',
             'sample' => isset($CNF['T']['txt_sample_single_with_article']) ? $CNF['T']['txt_sample_single_with_article'] : $CNF['T']['txt_sample_single'],
             'sample_wo_article' => $CNF['T']['txt_sample_single'],

+ 4 - 0
modules/boonex/channels/classes/BxCnlAlertsResponse.php

@@ -28,6 +28,10 @@ class BxCnlAlertsResponse extends BxBaseModGroupsAlertsResponse
 
         if ($oAlert->sUnit == 'meta_keyword' && $oAlert->sAction == 'added'){
             if (isset($oAlert->aExtras['meta']) && isset($oAlert->aExtras['object']) && isset($oAlert->iObject) && isset($oAlert->iSender)){
+                /*
+                 * TODO: $oAlert->aExtras['object'] - contains Metatags object name but further it's used as Module name.
+                 * It's working correctly while Metatags object name is equal to Module name.
+                 */
                 $this->_oModule->processHashtag($oAlert->aExtras['meta'], $oAlert->aExtras['object'], $oAlert->iObject, $oAlert->iSender);
             }
         }

+ 1 - 3
modules/boonex/channels/classes/BxCnlModule.php

@@ -154,9 +154,7 @@ class BxCnlModule extends BxBaseModGroupsModule
         if(!BxDolRequest::serviceExists($aEventContent['module_name'], 'get_timeline_post'))
             return false;      
 
-        $iEventOwnerId = (int)(is_array($aEvent['owner_id']) ? array_shift($aEvent['owner_id']) : $aEvent['owner_id']);
-
-        return BxDolService::call($aEventContent['module_name'], 'get_timeline_post', array(array('owner_id' => $iEventOwnerId, 'object_id' => $aEventContent['content_id'])));
+        return BxDolService::call($aEventContent['module_name'], 'get_timeline_post', array(array('owner_id' => $aEventContent['author_id'], 'object_id' => $aEventContent['content_id'])));
     }
     
     /**

+ 18 - 16
modules/boonex/timeline/classes/BxTimelineTemplate.php

@@ -255,7 +255,7 @@ class BxTimelineTemplate extends BxBaseModNotificationsTemplate
         if($aResult === false)
             return '';
 
-        list($sAuthorName, $sAuthorUrl, $sAuthorIcon, $sAuthorUnit) = $this->getModule()->getUserInfo($aResult['owner_id']);
+        list($sAuthorName, $sAuthorUrl, $sAuthorIcon, $sAuthorUnit) = $this->getModule()->getUserInfo($aResult['object_owner_id']);
 
         return $this->parseHtmlByName('block_item_info.html', array(
             'style_prefix' => $this->_oConfig->getPrefix('style'),
@@ -300,7 +300,8 @@ class BxTimelineTemplate extends BxBaseModNotificationsTemplate
         if($aResult === false)
             return '';
 
-        $aEvent['object_owner_id'] = $aResult['owner_id'];
+        $aEvent['owner_id'] = $aResult['owner_id'];
+        $aEvent['object_owner_id'] = $aResult['object_owner_id'];
         $aEvent['icon'] = !empty($aResult['icon']) ? $aResult['icon'] : '';
         $aEvent['sample'] = !empty($aResult['sample']) ? $aResult['sample'] : '_bx_timeline_txt_sample';
         $aEvent['sample_action'] = !empty($aResult['sample_action']) ? $aResult['sample_action'] : '_bx_timeline_txt_added_sample';
@@ -880,10 +881,10 @@ class BxTimelineTemplate extends BxBaseModNotificationsTemplate
     public function getData(&$aEvent, $aBrowseParams = array())
     {
         $aResult = $this->_oConfig->isSystem($aEvent['type'], $aEvent['action']) ? $this->_getSystemData($aEvent, $aBrowseParams) : $this->_getCommonData($aEvent, $aBrowseParams);
-        if(empty($aResult) || empty($aResult['owner_id']) || empty($aResult['content']))
+        if(empty($aResult) || empty($aResult['object_owner_id']) || empty($aResult['content']))
             return false;
 
-        list($sUserName) = $this->getModule()->getUserInfo($aResult['owner_id']);
+        list($sUserName) = $this->getModule()->getUserInfo($aResult['object_owner_id']);
 
         $sSample = !empty($aResult['sample']) ? $aResult['sample'] : '_bx_timeline_txt_sample';
         if(empty($aEvent['title']) || empty($aEvent['description'])) {
@@ -1770,7 +1771,8 @@ class BxTimelineTemplate extends BxBaseModNotificationsTemplate
         $oOwner = BxDolProfile::getInstanceMagic($aEvent['object_id']);
 
         $aResult = array(
-            'owner_id' => $aEvent['object_id'],
+            'owner_id' => $aEvent['owner_id'],
+            'object_owner_id' => $aEvent['object_id'],
             'icon' => $CNF['ICON'],
             'sample' => '_bx_timeline_txt_sample_with_article',
             'sample_wo_article' => '_bx_timeline_txt_sample',
@@ -1800,15 +1802,15 @@ class BxTimelineTemplate extends BxBaseModNotificationsTemplate
 
                 $aLinks = $this->_oDb->getLinks($aEvent['id']);
                 if(!empty($aLinks) && is_array($aLinks))
-                	$oTranscoder = BxDolTranscoderImage::getObjectInstance($this->_oConfig->getObject('transcoder_photos_preview'));
-
-                    foreach($aLinks as $aLink)
-                        $aResult['content']['links'][] = array(
-                            'url' => $aLink['url'],
-                            'title' => $aLink['title'],
-                            'text' => $aLink['text'],
-                        	'thumbnail' => (int)$aLink['media_id'] != 0 ? $oTranscoder->getFileUrl($aLink['media_id']) : ''
-                        );
+                    $oTranscoder = BxDolTranscoderImage::getObjectInstance($this->_oConfig->getObject('transcoder_photos_preview'));
+
+                foreach($aLinks as $aLink)
+                    $aResult['content']['links'][] = array(
+                        'url' => $aLink['url'],
+                        'title' => $aLink['title'],
+                        'text' => $aLink['text'],
+                        'thumbnail' => (int)$aLink['media_id'] != 0 ? $oTranscoder->getFileUrl($aLink['media_id']) : ''
+                    );
 
                 $aPhotos = $this->_oDb->getMedia(BX_TIMELINE_MEDIA_PHOTO, $aEvent['id']);
                 if(!empty($aPhotos) && is_array($aPhotos)) {
@@ -1870,8 +1872,8 @@ class BxTimelineTemplate extends BxBaseModNotificationsTemplate
 
                 $aResult['content'] = array_merge($aContent, $aReposted['content']);
                 $aResult['content']['parse_type'] = !empty($aReposted['content_type']) ? $aReposted['content_type'] : BX_TIMELINE_PARSE_TYPE_DEFAULT;
-                $aResult['content']['owner_id'] = $aReposted['owner_id'];
-                list($aResult['content']['owner_name'], $aResult['content']['owner_url']) = $oModule->getUserInfo($aReposted['owner_id']);
+                $aResult['content']['owner_id'] = $aReposted['object_owner_id'];
+                list($aResult['content']['owner_name'], $aResult['content']['owner_url']) = $oModule->getUserInfo($aReposted['object_owner_id']);
 
                 if(!empty($aReposted['sample']))
                     $aResult['content']['sample'] = $aReposted['sample'];