</header>
<div class="container marginTop">
- <ul id="recentActivities" class="containerList recentActivityList" data-last-event-time="{@$lastEventTime}">
+ {assign var='__events' value=$eventList->getObjects()}
+ {assign var='__lastEvent' value=$__events|end}
+ <ul id="recentActivities" class="containerList recentActivityList" data-last-event-time="{@$lastEventTime}" data-last-event-id="{@$__lastEvent->eventID}">
{include file='recentActivityListItem'}
</ul>
</div>
new WCF.User.RecentActivityLoader(null, {if $filteredByFollowedUsers}true{else}false{/if});
});
//]]>
-</script>
\ No newline at end of file
+</script>
this._loadButton.enable();
var $parameters = {
+ lastEventID: this._container.data('lastEventID'),
lastEventTime: this._container.data('lastEventTime')
};
if (this._userID) {
$(data.returnValues.template).insertBefore(this._loadButton.parent());
this._container.data('lastEventTime', data.returnValues.lastEventTime);
+ this._container.data('lastEventID', data.returnValues.lastEventID);
this._loadButton.enable();
}
else {
public function validateLoad() {
$this->readBoolean('filteredByFollowedUsers', true);
$this->readInteger('lastEventTime');
+ $this->readInteger('lastEventID', true);
$this->readInteger('userID', true);
}
*/
public function load() {
$eventList = new ViewableUserActivityEventList();
- $eventList->getConditionBuilder()->add("user_activity_event.time < ?", array($this->parameters['lastEventTime']));
+ if ($this->parameters['lastEventID']) {
+ $eventList->getConditionBuilder()->add("user_activity_event.time <= ?", array($this->parameters['lastEventTime']));
+ $eventList->getConditionBuilder()->add("user_activity_event.eventID < ?", array($this->parameters['lastEventID']));
+ }
+ else {
+ $eventList->getConditionBuilder()->add("user_activity_event.time < ?", array($this->parameters['lastEventTime']));
+ }
// profile view
if ($this->parameters['userID']) {
'eventList' => $eventList
));
+ $events = $eventList->getObjects();
return array(
+ 'lastEventID' => end($events)->eventID,
'lastEventTime' => $lastEventTime,
'template' => WCF::getTPL()->fetch('recentActivityListItem')
);