MyBB Hacks

Full Version: [Request] Show Unanswered Threads
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I believe Zaher had a mod for this at one time.

If possible (well, I know it is!) could someone make a mod that would search (something like the View New Posts link in the welcome block) that would say Show Unanswered threads? It would search and find the threads with 0 replies.

Thanks, if anyone can do it. Smile
You can use this trick:
In inc/functions_search.php
Find and delete:

PHP Code:
	if(!$keywords && !$search['author'])
	{
		error($lang->error_nosearchterms);
	}


This will allow you to perform searches without specifying any keywords or authors.
So now you can just specify a search, saying to return threads/posts with at most, 0 replies.

Neat! But can I put a link in the welcome block called View Unanswered Threads using this?
ZiNgA BuRgA Wrote:You can use this trick:
In inc/functions_search.php
Find and delete:

PHP Code:
	if(!$keywords && !$search['author'])
	{
		error($lang->error_nosearchterms);
	}


This will allow you to perform searches without specifying any keywords or authors.
So now you can just specify a search, saying to return threads/posts with at most, 0 replies.

I think a better solution will be to add another condition to the if statement so the if will check that at least one of the three fields (keywords, author, replies) filled.
if you just delete that section I think it'll be problematic, no?
RR2 Wrote:Neat! But can I put a link in the welcome block called View Unanswered Threads using this?
yes you just need to pass the variables
dvb Wrote:I think a better solution will be to add another condition to the if statement so the if will check that at least one of the three fields (keywords, author, replies) filled.
if you just delete that section I think it'll be problematic, no?
Nope, if you don't supply anything, it'll just return all threads.
I personally think that requiring the user to enter a search term or username there is a little unnecessary...

RR2 Wrote:Neat! But can I put a link in the welcome block called View Unanswered Threads using this?
In search.php find:

PHP Code:
elseif($mybb->input['action'] == "do_search" && $mybb->request_method == "post")

Replace with:

PHP Code:
elseif($mybb->input['action'] == "do_search")


Then you can basically use a link like:

Code:
http://example.com/search.php?action=do_search&findthreadst=2&numreplies=0

Reference URL's