2018-01-18, 05:10 AM
It would be nice if mybb had an egosearch. This is a list of threads that you posted to, whether you started the thread or not. Its a good way to keep track of your activity on a forum quickly from the front page. Especially if you do not want to be annoyed via email/PM with subscriptions. On forums i dont want to be bothered with PMs or emails. I want to manually scan the list of threads i participated in, and read them in the order i wish at that time. This egosearch is default in PhpBB alongside todays posts and new posts. And i think it should be in MyBB core as well. Its also a very small change that adds it.
I hacked a method in the core but it would be nice if it was default.
in search.php about line 1492
and then a custom link in header_welcomeblock_member for access
I hacked a method in the core but it would be nice if it was default.
in search.php about line 1492
elseif($mybb->input['action'] == "do_search" || ($mybb->input['action'] == "finduserthreads2") || ($mybb->input['action'] == "findthreads1"))
{
$plugins->run_hooks("search_do_search_start");
// Check if search flood checking is enabled and user is not admin
if($mybb->settings['searchfloodtime'] > 0 && $mybb->usergroup['cancp'] != 1)
{
// Fetch the time this user last searched
if($mybb->user['uid'])
{
$conditions = "uid='{$mybb->user['uid']}'";
}
else
{
$conditions = "uid='0' AND ipaddress=".$db->escape_binary($session->packedip);
}
$timecut = TIME_NOW-$mybb->settings['searchfloodtime'];
$query = $db->simple_select("searchlog", "*", "$conditions AND dateline > '$timecut'", array('order_by' => "dateline", 'order_dir' => "DESC"));
$last_search = $db->fetch_array($query);
// Users last search was within the flood time, show the error
if($last_search['sid'])
{
$remaining_time = $mybb->settings['searchfloodtime']-(TIME_NOW-$last_search['dateline']);
if($remaining_time == 1)
{
$lang->error_searchflooding = $lang->sprintf($lang->error_searchflooding_1, $mybb- >settings['searchfloodtime']);
}
else
{
$lang->error_searchflooding = $lang->sprintf($lang->error_searchflooding, $mybb- >settings['searchfloodtime'], $remaining_time);
}
error($lang->error_searchflooding);
}
}
if(($mybb->get_input('showresults') == "threads") || ($mybb->input['action'] == "finduserthreads2") || ($mybb->input['action'] == "findthreads1"))
{
$resulttype = "threads";
}
else
{
$resulttype = "posts";
}
if($mybb->input['action'] == "finduserthreads2")
{
$search_data = array(
"keywords" => '',
"author" => $mybb->user['username'],
"postthread" => '1',
"matchusername" => $mybb->user['username'],
"postdate" => '',
"pddir" => '',
"forums" => '',
"findthreadst" => '',
"numreplies" => '',
"threadprefix" => ''
);
}
elseif($mybb->input['action'] == "findthreads1")
{
$searcharray = array(
"sid" => $db->escape_string($sid),
"uid" => $mybb->user['uid'],
"dateline" => $now,
"ipaddress" => $db->escape_binary($session->packedip),
"threads" => $search_results['threads'],
"posts" => $search_results['posts'],
"resulttype" => $resulttype,
"querycache" => $search_results['querycache'],
"keywords" => $db->escape_string($mybb->input['keywords']),
);
and then a custom link in header_welcomeblock_member for access
<li><a href="{$mybb->settings['bburl']}/search.php?action=finduserthreads2&uid={$mybb->user['uid']}">{$lang->welcome_mydiscussions}</a></li>