Willing to Pay for "Show New Replies to My Posts"
#11
Can you try and see if this forfills your needs ?

Open search.php
Find
elseif($mybb->input['action'] == "getnew")
{

Add Above
elseif($mybb->input['action'] == "mynewreplies")
{
	$query = $db->query("SELECT DISTINCT tid FROM `".TABLE_PREFIX."posts` WHERE uid='{$mybb->user['uid']}'");
	while($your_tid = $db->fetch_array($query))
	{
		$your_tids[] = $your_tid['tid'];
	}
	if(!$your_tids)
	{
		error($lang->error_nosearchresults);
	}
	$query = $db->query("SELECT DISTINCT t.tid AS view, t.lastpost, r.tid AS readthread, r.dateline FROM `".TABLE_PREFIX."threads` t LEFT JOIN `".TABLE_PREFIX."threadsread` r ON (t.tid=r.tid) WHERE t.lastpost > {$mybb->user['lastvisit']} AND r.uid='{$mybb->user['uid']}' ");
	while($tid = $db->fetch_array($query))
	{
		if(in_array($tid['view'], $your_tids))
		{
			if($tid['view'] == $tid['readthread'] && $tid['dateline'] > $mybb->user['lastvisit'])
			{	
				continue;
			}
			$search_tids[] = $tid['view'];
		}
	}
	if($search_tids)
	{
		$search_tids = implode(",", $search_tids);
	}
	else
	{
		error($lang->error_nosearchresults);
	}
	$where_sql = "t.tid IN ($search_tids)";

	$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)";
	}

	$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);
}

Then open your header_welcomeblock_member template
and add this link to it;
<a href="{$mybb->settings['bburl']}/search.php?action=mynewreplies">New Replies To My Threads</a> |
Reply


Messages In This Thread
RE: Willing to Pay for "Show New Replies to My Posts" - by LeX- - 2009-04-03, 03:50 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)