Hello. I was wondering, is there a way to have the events that are current show first (default) since events that have passed (xxx days ago) makes little sense to still be viewable?
Hello. I was wondering, is there a way to have the events that are current show first (default) since events that have passed (xxx days ago) makes little sense to still be viewable? |
this is possible. you can do this by changing the SQL query that pulls the event data for the outline or timeline. example: 'order by' added in SQL string for events. on the field you need. in your case it would be the date when the event starts
|
Since multiple modules allow posting to show on the 'outline' in chronological order, I really do not see why you would need to do this.
For example: You create a new event. On the outline, its the first item displayed. But then another member logs in righ tafter you post that and uploads 50 photos, your event is going to move a few pages back anyway. Nothing to see here |
That is true. That is why i have build a outline filter for the modules i have on the outline. |
Thanks guys. The problem I'm having is that there are a bunch of outdated event posts in-between current (happening right now) posts. you would have to surf through no longer active posts to find some that are active because they were posted earlier than the expired posts. |
Try the following modification in modules/boonex/events/classes/BxEventsModule.php file: function serviceGetWallPostOutline($aEvent) { $aParams = array( 'txt_privacy_view_event' => 'view_event', 'obj_privacy' => $this->_oPrivacy, 'templates' => array( 'grouped' => 'wall_outline_grouped' ) ); return parent::_serviceGetWallPostOutline($aEvent, 'calendar', $aParams); } to: function serviceGetWallPostOutline($aEvent) { $aItems = array(); $aObjectIds = strpos($aEvent['object_id'], ',') !== false ? explode(',', $aEvent['object_id']) : array($aEvent['object_id']); foreach ($aObjectIds as $iId) { $aItem = $this->_oDb->getEntryByIdAndOwner($iId, $aEvent['owner_id'], 1); if ($aItem && $aItem['EventEnd'] > time()) $aItems[] = $iId; } if (empty($aItems)) return ''; $aEvent['object_id'] = join(',', $aItems); $aParams = array( 'txt_privacy_view_event' => 'view_event', 'obj_privacy' => $this->_oPrivacy, 'templates' => array( 'grouped' => 'wall_outline_grouped' ) ); return parent::_serviceGetWallPostOutline($aEvent, 'calendar', $aParams); } Please let me know how it goes ? if everything is ok - we will incorporate this modification in next version Rules → http://www.boonex.com/terms |
Thanks Alex. That seems to have done the trick.
If I could make a suggestion for the next version; an admin function to allow archive or delete of old events. I would like the option to delete but others might like to archive. Just my 2 cents. Thanks again. |