Thread Rating:
  • 1 Vote(s) - 4 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Release 1.4.x] Search exclusion
#11
Open plugin file and Find and Replace the following;
	if($mybb->settings['nosearch_enabled'] == 1)
	{
		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";
		}
		elseif($mybb->input['action'] == 'findguest' && $mybb->settings['nosearch_findguest'] != "")
		{
			$where_sql_add = " AND t.fid NOT IN (".$mybb->settings['nosearch_findguest'].")AND replies > 0";
		}
		elseif($mybb->input['action'] == 'finduser' && $mybb->settings['nosearch_finduser'] != "")
		{
			$where_sql_add = " AND t.fid NOT IN (".$mybb->settings['nosearch_finduser'].")AND replies > 0";
		}
		elseif($mybb->input['action'] == 'finduserthreads' && $mybb->settings['nosearch_finduserthreads'] != "")
		{
			$where_sql_add = " AND t.fid NOT IN (".$mybb->settings['nosearch_finduserthreads'].")AND replies > 0";
		}
		
		$searcharray['querycache'] .= $db->escape_string($where_sql_add);
	}

Its checked and confirmed.
Reply
#12
guess it is possible to do.... I was too lazy to look at the old code and I blew it off. Sorry about that.

to be safe, you should use

AND t.replies > 0

so that replies comes from the threads table if any other plugins or core edits change the base query.
Lost interest, sold my sites, will browse here once in a while. It's been fun.
Reply
#13
Thank you guys but :
Same problem : this is affecting all the forums and not just those who I've setup in the search exclusion...so now if a forum dosen't have a reply , it dosen't show in the New-Today Post search query Sad
[Image: 2rB6o.png]
Reply
#14
that is what I thought, its not possible as the exclusion is based on the "t.fid NOT IN" query.

the plugin would need to be modified to check if the forums listed have any replies first in the new/todays posts. that is a lot of overhead so i would not recommend it.
Lost interest, sold my sites, will browse here once in a while. It's been fun.
Reply
#15
Well,

This is fair solution if you have Trading Buy-Sell Category Forum, which is exclude from the crowded search results Smile

Just add what is Yaldaram & Pavemen suggest, but change
OR t.replies < 1

Thats mean,
the exclude forum still displayed, but only one time (or until get one reply), then disappear from search result.

I suggest only applying nosearch_getnew and nosearch_getdaily code which modified, not the others

Nice mod Pavemen Smile
Hello, Welcome to MyBB Indonesia to get local support
My 'Simple' Unique Plugin here Smile
Reply
#16
i tried this but when its activated i just5 get a blank screen for the end user i can still see admincp tho
please someone release a script to downgrade from 1.8 to 1.6 
Reply


Forum Jump:


Users browsing this thread: 6 Guest(s)