MyBB Community Forums

Full Version: [Release 1.4.x] Search exclusion
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
I have a couple forums that are RSS feed based and can be fairly active. I do not want those forums to show in the Get New Posts search and clutter the results. So I built this plugin to enable the admin to specify forum IDs that are excluded for the various search types:

Get New Posts
Get Today's Posts
Find Guest Posts
Find User Posts
Find User Threads

While the likelihood that one would use the last three options is very low, they are included for completeness.

Simply install the attached file into the \inc\plugins, and activate it. What it does is create a new settings group, "No Search Forum Exclusion" that has a master on/off switch and text boxes for CSV list of forum ID to exclude from each search type.

Update 1.0.1
Added fix for portal welcome box count of new posts/threads to exclude listed forums.
I updated the plugin today. I added some code to stop the Portal Welcome box from including the forums specified in the Get New Posts list as well. Basically this will keep XX New Posts and XX New Threads from showing a value and getting no results when you go to Get New Posts and all the new posts are actually in the excluded forum list.

To upgrade, simply upload the new plugin file. No need to deactivate or uninstall.
Well done !
This is useful and I will definitely use it.
Why not just untick the search option under each forum in admincp? That will effect all those situations.
Only because I want to be able to use the regular search on them, just not clutter up the 'new' posts and similar areas.
pavemen first off all : Thank you!! . I'm using your plugin and is working great but I do have a question : How can I make this plugin not show the topic when it's first created BUT once it has a reply to it ....i would like to be able to see it in the "New-Today's Post search" ....
Can this be done?
not possible with the plugin as it is now as the plugin works at the forum level not the thread/post level.
(2011-04-10, 04:10 AM)Jack707 Wrote: [ -> ]pavemen first off all : Thank you!! . I'm using your plugin and is working great but I do have a question : How can I make this plugin not show the topic when it's first created BUT once it has a reply to it ....i would like to be able to see it in the "New-Today's Post search" ....
Can this be done?

A very small core file edit should produce those results. Basically find the query and add a "AND replies > 0"
Ok. I've done this changes :
if($mybb->input['action'] == 'getnew' && $mybb->settings['nosearch_getnew'] != "")
		{
			$where_sql_add = " AND t.fid NOT IN (".$mybb->settings['nosearch_getnew'].") AND replies > 0";
		}
		elseif($mybb->input['action'] == 'getdaily' && $mybb->settings['nosearch_getdaily'] != "")
		{
			$where_sql_add = " AND t.fid NOT IN (".$mybb->settings['nosearch_getdaily'].") AND replies > 0";
		}


And this is affecting all the forums and not just those who I've setup in the search exclusion Toungue ........ Is it me or ?Big Grin
bump..
Pages: 1 2