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

Is it possible to limit to the new threads the global RSS feed?

giorgino

Well-known member
#1
I use the feed for Google, Twitter, Facebook and Google+ pages, but the global feed include all the "discussed" threads and not the new threads only.

Is it possible to limit to the new threads the global RSS feed?
 

Jake Bunce

XenForo moderator
Staff member
#2
I think you want this:

library/XenForo/ControllerPublic/Forum.php

Remove the red code:

Code:
	public function getGlobalForumRss()
	{
		$threadModel = $this->_getThreadModel();
		$visitor = XenForo_Visitor::getInstance();

		$threadsPerPage = max(1, XenForo_Application::get('options')->discussionsPerPage);
		$autoReadDate = XenForo_Application::$time - (XenForo_Application::get('options')->readMarkingDataLifetime * 86400);

		$threads = $threadModel->getThreads(
			array('find_new' => true, 'last_post_date' => array('>', $autoReadDate)),
			array(
				'limit' => $threadsPerPage * 3, // to filter
				'order' => 'last_post_date',
				'join' =>
					XenForo_Model_Thread::FETCH_FORUM | XenForo_Model_Thread::FETCH_FORUM_OPTIONS |
					XenForo_Model_Thread::FETCH_USER,
				'permissionCombinationId' => $visitor['permission_combination_id']
			)
		);
		foreach ($threads AS $key => $thread)
		{
			$thread['permissions'] = XenForo_Permission::unserializePermissions($thread['node_permission_cache']);

			if (!$threadModel->canViewThreadAndContainer($thread, $thread, $null, $thread['permissions']))
			{
				unset($threads[$key]);
			}
		}
		$threads = array_slice($threads, 0, $threadsPerPage, true);

		$viewParams = array(
			'threads' => $threads
		);
		return $this->responseView('XenForo_ViewPublic_Forum_GlobalRss', '', $viewParams);
	}
Now the global feed will order threads by thread start date, not last post date.
 
#7
@giorgino did you figure this out? I have made the edit above, but it did not make a difference. This post was from 2012 so things might have changed as well. Any idea @Jake Bunce ?

[edit My mistake... forgot I had cache on my server . After refresh works!]
 

tr1age

Active member
#9
Weird question with Xenforo 1.5 is there a way to get it so it DOES what it used to do with the posts in global RSS reposting every time there is a new reply?