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

Pull Latest Threads

Discussion in 'XenForo Pre-Sales Questions' started by eagle eyes, Apr 3, 2012.

  1. eagle eyes

    eagle eyes Active Member

    I want to pull latest threads based on forum ids.


    The above URL only works to find latest threads in all sections, but what about pulling it from certain sections only (in order to avoid the others)?
  2. eagle eyes

    eagle eyes Active Member

    Any ideas if this is possible with Xenforo?
  3. eagle eyes

    eagle eyes Active Member

  4. mrGTB

    mrGTB Well-Known Member

  5. eagle eyes

    eagle eyes Active Member

    Its not what i am looking for, please read again.
  6. Shelley

    Shelley Well-Known Member

    I'm almost sure the what's new? doesn't allow for new threads from specific forum ids to be pulled as default. I searched the Resource Manager and didn't find anything.
  7. craigiri

    craigiri Well-Known Member

  8. taylor_smith

    taylor_smith Well-Known Member

  9. craigiri

    craigiri Well-Known Member

    It's all definitely possible - in fact, relatively easy, except no one has submitted the mod yet. I don't think you can do it with URL forms as mentioned because that would (in theory) open up the system for a lot of hacking.

    But easytarget has a widget that does this for wordpress..

    You can include and exclude forums.

    He may be able to provide a mod to make it work in XF or in any php page. I want something like this myself to run in a php page outside of XF, but have been unable to find it. Still, I know it can be done since one member quoted me a price on a custom mod for it.
  10. ArnyVee

    ArnyVee Well-Known Member

    Maybe you and the OP can split the cost :)
  11. craigiri

    craigiri Well-Known Member

    I might consider that - but it seems like so "stock" of a function that I am hesitant to pay for it. Heck, my 2003 vintage forum sw did it with a simple call of a template using php include.

    I don't mind paying for things - but this one sure seems like either a core feature or "donate ware".
  12. taylor_smith

    taylor_smith Well-Known Member

    I'd also chip in, but I agree that it does seem best suited to "core features."
  13. eagle eyes

    eagle eyes Active Member

    Indeed, it should be a core feature. Somebody is doing this for 250$ for me, lets split?
  14. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    I like that feature in vB.

    The search system has parameters for all of this. For example:


    The problem is you have to specify a keyword or member name to search by. You can remove this requirement by editing this file:


    Add the red code:

    	public function actionSearch()
    		// note: intentionally not post-only
    		if (!XenForo_Visitor::getInstance()->canSearch())
    			throw $this->getNoPermissionResponseException();
    		$input = $this->_input->filter(array(
    			'keywords' => XenForo_Input::STRING,
    			'title_only' => XenForo_Input::UINT,
    			'date' => XenForo_Input::DATE_TIME,
    			'users' => XenForo_Input::STRING,
    			'nodes' => array(XenForo_Input::UINT, 'array' => true),
    			'child_nodes' => XenForo_Input::UINT,
    			'user_content' => XenForo_Input::STRING,
    			'order' => XenForo_Input::STRING,
    			'group_discussion' => XenForo_Input::UINT
    		$input['type'] = $this->_handleInputType($input);
    		if (!$input['order'])
    			$input['order'] = 'date';
    		$origKeywords = $input['keywords'];
    		$input['keywords'] = XenForo_Helper_String::censorString($input['keywords'], null, ''); // don't allow searching of censored stuff
    		$visitorUserId = XenForo_Visitor::getUserId();
    		$searchModel = $this->_getSearchModel();
    		$constraints = $searchModel->getGeneralConstraintsFromInput($input, $errors);
    		if ($errors)
    			return $this->responseError($errors);
    		if (!$input['type'] && $input['keywords'] === ''
    			&& count($constraints) == 1
    			&& !empty($constraints['user']) && count($constraints['user']) == 1
    			// we're searching for messages by a single user
    			$this->_request->setParam('user_id', reset($constraints['user']));
    			return $this->responseReroute(__CLASS__, 'member');
    		if ($input['keywords'] === '' && empty($constraints['user']))
    			// must have keyword or user constraint
    			return $this->responseError(new XenForo_Phrase('please_specify_search_query_or_name_of_member'));
    		$typeHandler = null;
    		if ($input['type'])
    			if (is_array($input['type']))
    				$typeInfo = $input['type'];
    				list($input['type'], $contentInfo) = each($input['type']);
    				list($contentType, $contentId) = each($contentInfo);
    			$typeHandler = $searchModel->getSearchDataHandler($input['type']);
    			if ($typeHandler)
    				$constraints = array_merge($constraints,
    		$search = $searchModel->getExistingSearch(
    			$input['type'], $input['keywords'], $constraints, $input['order'], $input['group_discussion'], $visitorUserId
    		if (!$search)
    			$searcher = new XenForo_Search_Searcher($searchModel);
    			if ($typeHandler)
    				$results = $searcher->searchType(
    					$typeHandler, $input['keywords'], $constraints, $input['order'], $input['group_discussion']
    				$userResults = array();
    				$results = $searcher->searchGeneral($input['keywords'], $constraints, $input['order']);
    				$userResults = $this->_getUserSearch($input['keywords']);
    			if (!$results && !$userResults)
    				return $this->getNoSearchResultsResponse($searcher);
    			$warnings = $searcher->getErrors() + $searcher->getWarnings();
    			$search = $searchModel->insertSearch(
    				$results, $input['type'], $origKeywords, $constraints, $input['order'], $input['group_discussion'], $userResults,
    				$warnings, $visitorUserId
    		return $this->responseRedirect(
    			XenForo_Link::buildPublicLink('search', $search),
    Now the above link will work.

    The presentation is different (shown as search results) because it's using the search system instead of what's new. But it's an easy hack since the search system already has the needed criteria.
    CurveGotti likes this.
  15. taylor_smith

    taylor_smith Well-Known Member

    $250 seems like a lot to pay for this. I've had half a dozen plugins made, none for more than $50. :/
  16. Chris D

    Chris D XenForo Developer Staff Member

    $250? Jesus...

    Jake's solution is free.

    I know what I'd choose.
  17. craigiri

    craigiri Well-Known Member

  18. eagle eyes

    eagle eyes Active Member

    How do i pull latest threads from one section or two sections? As search results? I dont know how the URLs work.
  19. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

  20. HenrikHansen

    HenrikHansen Well-Known Member

Share This Page