farang
Well-known member
Hi there.
Making a standard search, search results a mixed threads and posts. Most searchers maybe haven't even reflected over that. In an advanced search there is an option "Display results as threads" that is not ticked by default.
I have been using some time today to figure out how build a (free) add-on that alters so that a quick search result displays the results as threads.
I believe that the public function actionSearch() in \library\XenForo\ControllerPublic\Search.php is the place to do the modification. If I insert the following code at line 201 I believe it works as desired.
But I can't see how I can do the modification without copying the whole function which wouldn't be a nice thing to do of course. I've been looking into altering the public function searchGeneral in \library\XenForo\Search\Searcher.php instead. It's not many lines of code there and by creating a "typeHandler" I believe I can call the public function searchType instead. I had some problem creating a "typeHandler" though... I'm also not sure if it's a good idea or not.
Please if you have the knowledge how to best implement this, give me a hint.
Making a standard search, search results a mixed threads and posts. Most searchers maybe haven't even reflected over that. In an advanced search there is an option "Display results as threads" that is not ticked by default.
I have been using some time today to figure out how build a (free) add-on that alters so that a quick search result displays the results as threads.
I believe that the public function actionSearch() in \library\XenForo\ControllerPublic\Search.php is the place to do the modification. If I insert the following code at line 201 I believe it works as desired.
Code:
$input['group_discussion'] = 1;
$input['type'] = 'post';
But I can't see how I can do the modification without copying the whole function which wouldn't be a nice thing to do of course. I've been looking into altering the public function searchGeneral in \library\XenForo\Search\Searcher.php instead. It's not many lines of code there and by creating a "typeHandler" I believe I can call the public function searchType instead. I had some problem creating a "typeHandler" though... I'm also not sure if it's a good idea or not.
Please if you have the knowledge how to best implement this, give me a hint.