Pārlūkot izejas kodu

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

AntonLV 4 gadi atpakaļ
vecāks
revīzija
3485d0e2db

+ 3 - 1
modules/base/groups/classes/BxBaseModGroupsSearchResult.php

@@ -78,6 +78,8 @@ class BxBaseModGroupsSearchResult extends BxBaseModProfileSearchResult
         $CNF = &$this->oModule->_oConfig->CNF;
 
         $oProfileAuthor = BxDolProfile::getInstance((int)$aParams['user']);
+		$iListId = (int)$aParams['list_id'];
+		
         if (!$oProfileAuthor) 
             return false;
 
@@ -86,7 +88,7 @@ class BxBaseModGroupsSearchResult extends BxBaseModProfileSearchResult
         if(!$oFavorite || (!$oFavorite->isPublic() && $iProfileAuthor != bx_get_logged_profile_id())) 
             return false;
 
-        $aConditions = $oFavorite->getConditionsTrack($CNF['TABLE_ENTRIES'], 'id', $iProfileAuthor);
+        $aConditions = $oFavorite->getConditionsTrack($CNF['TABLE_ENTRIES'], 'id', $iProfileAuthor, $iListId);
         if(!empty($aConditions) && is_array($aConditions)) {
             if(empty($this->aCurrent['restriction']) || !is_array($this->aCurrent['restriction']))
                 $this->aCurrent['restriction'] = array();

+ 3 - 1
modules/base/profile/classes/BxBaseModProfileSearchResult.php

@@ -204,6 +204,8 @@ class BxBaseModProfileSearchResult extends BxBaseModGeneralSearchResult
         $CNF = &$this->oModule->_oConfig->CNF;
 
         $oProfileAuthor = BxDolProfile::getInstance((int)$aParams['user']);
+		$iListId = (int)$aParams['list_id'];
+		
         if(!$oProfileAuthor) 
             return false;
 
@@ -212,7 +214,7 @@ class BxBaseModProfileSearchResult extends BxBaseModGeneralSearchResult
         if(!$oFavorite->isPublic() && $iProfileAuthor != bx_get_logged_profile_id()) 
             return false;
 
-        $aConditions = $oFavorite->getConditionsTrack($CNF['TABLE_ENTRIES'], 'id', $iProfileAuthor);
+        $aConditions = $oFavorite->getConditionsTrack($CNF['TABLE_ENTRIES'], 'id', $iProfileAuthor, $iListId);
         if(!empty($aConditions) && is_array($aConditions)) {
             if(empty($this->aCurrent['restriction']) || !is_array($this->aCurrent['restriction']))
                 $this->aCurrent['restriction'] = array();

+ 12 - 6
modules/boonex/events/classes/BxEventsModule.php

@@ -338,24 +338,30 @@ class BxEventsModule extends BxBaseModGroupsModule implements iBxDolCalendarServ
         $CNF = $this->_oConfig->CNF;
 
         $oDateStart = date_create('@' . $aContentInfo['date_start']);
-        $oDateStart->setTimezone(new DateTimeZone($aContentInfo['timezone'] ? $aContentInfo['timezone'] : 'UTC'));
+        if ($oDateStart)
+            $oDateStart->setTimezone(new DateTimeZone($aContentInfo['timezone'] ? $aContentInfo['timezone'] : 'UTC'));
         $oDateEnd = date_create('@' . ($aContentInfo['date_start'] > $aContentInfo['repeat_stop'] ? $aContentInfo['date_start'] : $aContentInfo['repeat_stop']));
-        $oDateEnd->setTimezone(new DateTimeZone($aContentInfo['timezone'] ? $aContentInfo['timezone'] : 'UTC'));
+        if ($oDateEnd)
+            $oDateEnd->setTimezone(new DateTimeZone($aContentInfo['timezone'] ? $aContentInfo['timezone'] : 'UTC'));
 
         $oMetatags = BxDolMetatags::getObjectInstance($CNF['OBJECT_METATAGS']);
         $sLocationString = $oMetatags ? $oMetatags->locationsString($aContentInfo[$CNF['FIELD_ID']], false) : false;
 
-        $a['content']['raw'] = $this->_oTemplate->parseHtmlByName('timeline_post.html', array(
+        $a['content']['raw'] = $this->_oTemplate->parseHtmlByName('timeline_post.html', [
             'title' => $a['content']['title'],
             'title_attr' => bx_html_attribute($a['content']['title']),
             'url' => $a['content']['url'],
-            'date' => strftime(getParam('bx_events_short_date_format'), $oDateStart->getTimestamp()) . ($oDateStart->format('ymd') == $oDateEnd->format('ymd') ? '' : ' - ' . strftime(getParam('bx_events_short_date_format'), $oDateEnd->getTimestamp())),
-            'date_c' => $oDateStart->format('c'),
+            'bx_if:date' => [
+                'condition' => $oDateStart && $oDateEnd,
+                'content' => [
+                    'date' => $oDateStart && $oDateEnd ? (strftime(getParam('bx_events_short_date_format'), $oDateStart->getTimestamp()) . ($oDateStart->format('ymd') == $oDateEnd->format('ymd') ? '' : ' - ' . strftime(getParam('bx_events_short_date_format'), $oDateEnd->getTimestamp()))) : '',
+                    'date_c' => $oDateStart->format('c'),
+            ]],
             'bx_if:location' => array(
                 'condition' => !!$sLocationString,
                 'content' => array('location' => $sLocationString),
             ),
-        ));
+        ]);
 
         $a['content']['title'] = '';
         $a['content']['text'] = '';

+ 2 - 0
modules/boonex/events/template/timeline_post.html

@@ -2,9 +2,11 @@
     <div class="bx-tl-title bx-def-margin-sec-bottom bx-def-font-h3">
         <a href="__url__" title="__title_attr__" class="summary url bx-tl-title">__title__</a>
     </div>
+    <bx_if:date>
     <div class="bx-tl-info bx-def-margin-sec-bottom bx-def-font-h3">
         <i class="sys-icon calendar-alt bx-def-margin-thd-right"></i> <span class="dtstart" title="__date_c__">__date__</span>
     </div>
+    </bx_if:date>
     <bx_if:location>
     <div class="bx-tl-info bx-def-margin-sec-bottom bx-def-font-h3">
         <i class="sys-icon map-marker-alt bx-def-margin-thd-right"></i> <span class="location">__location__</span>