2021-03-23, 05:10 AM
This will add a new specialized Search preset link "View Unanswered Threads" to header.
Open template
Now open your search.php file in an editor. Go to line no. around 1252, find this line:
and change it to:
Just after that, find this line:
and change it to:
Now save the modified search.php and reupload to your forum root, replacing the existing one.
Result:
![[Image: 112095966-71db1980-8bc3-11eb-936d-2c72f7197633.gif]](https://camo.mybb.com/ab3c72cb82a55feb50e3616daf10a80630753771/68747470733a2f2f757365722d696d616765732e67697468756275736572636f6e74656e742e636f6d2f32313236353539312f3131323039353936362d37316462313938302d386263332d313165622d393336642d3263373266373139373633332e676966)
Open template
header_welcomeblock_member_search
and add at the bottom:<li><a href="{$mybb->settings['bburl']}/search.php?action=findunansweredthreads">View Unanswered Threads</a></li>
Now open your search.php file in an editor. Go to line no. around 1252, find this line:
elseif($mybb->input['action'] == "finduserthreads")
and change it to:
elseif($mybb->input['action'] == "finduserthreads" || $mybb->input['action'] == "findunansweredthreads")
Just after that, find this line:
$where_sql = "uid='".$mybb->get_input('uid', MyBB::INPUT_INT)."'";
and change it to:
if($mybb->input['action'] == "finduserthreads")
{
$where_sql = "uid='".$mybb->get_input('uid', MyBB::INPUT_INT)."'";
}
else
{
$where_sql = "replies='0'";
}
Now save the modified search.php and reupload to your forum root, replacing the existing one.
Result: