• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

does "Recent Activity" has a time set until it disappears in user-profile?

erich37

Well-known member
#1
I am checking a few of my users and I do see their posts at other user-profiel-pages.

But when I go to the user's page, those posts are not visible anymore at their "Recent Activity" tab.

It sems there is a certain time being set, as to when "Recent Activities" are disapperaing at the user-profile?
If so, is there a chance to not have those disappear?

Many thanks!
 

Jake Bunce

XenForo moderator
Staff member
#2
It is hard-coded at 7 days:

library/XenForo/Model/NewsFeed.php

Code:
	public function deleteOldNewsFeedItems($dateCut = null)
	{
		if ($dateCut === null)
		{
			$expiryTime = 7 * 86400; // TODO: hard coded to 7 days
			$dateCut = XenForo_Application::$time - $expiryTime;
		}

		$db = $this->_getDb();
		$db->delete('xf_news_feed', 'event_date < '. $db->quote($dateCut));
	}
This function prunes old feed items and is run every hour as part of this cron:

Admin CP -> Tools -> Cron Entries -> Hourly Clean Up

If you modify this code with a file edit or addon then it will not automatically restore old feed items. But current and future items will last longer up to the new expiry that you specify.
 

MsJacquiiC

Well-known member
#3
It is hard-coded at 7 days:

library/XenForo/Model/NewsFeed.php

Code:
public function deleteOldNewsFeedItems($dateCut = null)
{
if ($dateCut === null)
{
$expiryTime = 7 * 86400; // TODO: hard coded to 7 days
$dateCut = XenForo_Application::$time - $expiryTime;
}
 
$db = $this->_getDb();
$db->delete('xf_news_feed', 'event_date < '. $db->quote($dateCut));
}
Just to clarify. When editing the code in red above...
The following code will make it 14 days then?

Code:
$expiryTime = 14 * 172800; // TODO: hard coded to 14 days
 

Jake Bunce

XenForo moderator
Staff member
#4
Just to clarify. When editing the code in red above...
The following code will make it 14 days then?

Code:
$expiryTime = 14 * 172800; // TODO: hard coded to 14 days
Only change the number of days (7 to 14). You don't need to change the multiplied value (which is the number of seconds in one day).

Code:
$expiryTime = 14 * 86400; // TODO: hard coded to 14 days