2013-06-02, 11:16 AM
2013-06-02, 02:52 PM
... and where you want the result to be shown?
2013-06-02, 03:41 PM
It can be as search results.
2013-06-02, 06:31 PM
In that case you don't need a plugin for this. Just open your search.php in a text editor and find the following code line near about line no. 1217
Add the following code chunk just BEFORE that line:
Now, create a link in your template wherever you want like the following:
It will show you the threads without any reply as a search result.
elseif($mybb->input['action'] == "getnew")
Add the following code chunk just BEFORE that line:
elseif($mybb->input['action'] == "noreply")
{
$where_sql = "t.replies <= 0";
$unsearchforums = get_unsearchable_forums();
if($unsearchforums)
{
$where_sql .= " AND t.fid NOT IN ($unsearchforums)";
}
$inactiveforums = get_inactive_forums();
if($inactiveforums)
{
$where_sql .= " AND t.fid NOT IN ($inactiveforums)";
}
$permsql = "";
$onlyusfids = array();
// Check group permissions if we can't view threads not started by us
$group_permissions = forum_permissions();
foreach($group_permissions as $fid => $forum_permissions)
{
if($forum_permissions['canonlyviewownthreads'] == 1)
{
$onlyusfids[] = $fid;
}
}
if(!empty($onlyusfids))
{
$where_sql .= "AND ((t.fid IN(".implode(',', $onlyusfids).") AND t.uid='{$mybb->user['uid']}') OR t.fid NOT IN(".implode(',', $onlyusfids)."))";
}
$sid = md5(uniqid(microtime(), 1));
$searcharray = array(
"sid" => $db->escape_string($sid),
"uid" => $mybb->user['uid'],
"dateline" => TIME_NOW,
"ipaddress" => $db->escape_string($session->ipaddress),
"threads" => '',
"posts" => '',
"resulttype" => "threads",
"querycache" => $db->escape_string($where_sql),
"keywords" => ''
);
$plugins->run_hooks("search_do_search_process");
$db->insert_query("searchlog", $searcharray);
redirect("search.php?action=results&sid=".$sid, $lang->redirect_searchresults);
}
Now, create a link in your template wherever you want like the following:
<a href="search.php?action=noreply">Threads Not Replied</a>
It will show you the threads without any reply as a search result.