Vergleich search.php - 1.8.8 - 1.8.15

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 14Zeile 14

$templatelist = "search,forumdisplay_thread_gotounread,search_results_threads_thread,search_results_threads,search_results_posts,search_results_posts_post,search_results_icon,search_forumlist_forum,search_forumlist";
$templatelist .= ",multipage,multipage_breadcrumb,multipage_end,multipage_jump_page,multipage_nextpage,multipage_page,multipage_page_current,multipage_page_link_current,multipage_prevpage,multipage_start";


$templatelist = "search,forumdisplay_thread_gotounread,search_results_threads_thread,search_results_threads,search_results_posts,search_results_posts_post,search_results_icon,search_forumlist_forum,search_forumlist";
$templatelist .= ",multipage,multipage_breadcrumb,multipage_end,multipage_jump_page,multipage_nextpage,multipage_page,multipage_page_current,multipage_page_link_current,multipage_prevpage,multipage_start";

$templatelist .= ",search_results_posts_inlinecheck,search_results_posts_nocheck,search_results_threads_inlinecheck,search_results_threads_nocheck,search_results_inlinemodcol,search_results_posts_inlinemoderation_custom_tool";

$templatelist .= ",search_results_posts_inlinecheck,search_results_posts_nocheck,search_results_threads_inlinecheck,search_results_threads_nocheck,search_results_inlinemodcol,search_results_inlinemodcol_empty,search_results_posts_inlinemoderation_custom_tool";

$templatelist .= ",search_results_posts_inlinemoderation_custom,search_results_posts_inlinemoderation,search_results_threads_inlinemoderation_custom_tool,search_results_threads_inlinemoderation_custom,search_results_threads_inlinemoderation";
$templatelist .= ",forumdisplay_thread_attachment_count,search_threads_inlinemoderation_selectall,search_posts_inlinemoderation_selectall,post_prefixselect_prefix,post_prefixselect_multiple,search_orderarrow";
$templatelist .= ",search_results_posts_forumlink,search_results_threads_forumlink,forumdisplay_thread_multipage_more,forumdisplay_thread_multipage_page,forumdisplay_thread_multipage,search_moderator_options";

$templatelist .= ",search_results_posts_inlinemoderation_custom,search_results_posts_inlinemoderation,search_results_threads_inlinemoderation_custom_tool,search_results_threads_inlinemoderation_custom,search_results_threads_inlinemoderation";
$templatelist .= ",forumdisplay_thread_attachment_count,search_threads_inlinemoderation_selectall,search_posts_inlinemoderation_selectall,post_prefixselect_prefix,post_prefixselect_multiple,search_orderarrow";
$templatelist .= ",search_results_posts_forumlink,search_results_threads_forumlink,forumdisplay_thread_multipage_more,forumdisplay_thread_multipage_page,forumdisplay_thread_multipage,search_moderator_options";

Zeile 217Zeile 217

// Inline Mod Column for moderators
$inlinemodcol = $inlinecookie = '';


// Inline Mod Column for moderators
$inlinemodcol = $inlinecookie = '';

	$is_mod = $is_supermod = false;

	$is_mod = $is_supermod = $show_inline_moderation = false;

	if($mybb->usergroup['issupermod'])
{
$is_supermod = true;
}
if($is_supermod || is_moderator())
{

	if($mybb->usergroup['issupermod'])
{
$is_supermod = true;
}
if($is_supermod || is_moderator())
{

		eval("\$inlinemodcol = \"".$templates->get("search_results_inlinemodcol")."\";");

 
		$inlinecookie = "inlinemod_search".$sid;
$inlinecount = 0;
$is_mod = true;

		$inlinecookie = "inlinemod_search".$sid;
$inlinecount = 0;
$is_mod = true;

Zeile 539Zeile 538
			$threadpages = '';
$morelink = '';
$thread['posts'] = $thread['replies'] + 1;

			$threadpages = '';
$morelink = '';
$thread['posts'] = $thread['replies'] + 1;

			if(is_moderator($thread['fid'], "canviewunapprove"))

			if(is_moderator($thread['fid'], "canviewdeleted") == true || is_moderator($thread['fid'], "canviewunapprove") == true)

			{

			{

				$thread['posts'] += $thread['unapprovedposts'];








				if(is_moderator($thread['fid'], "canviewdeleted") == true)
{
$thread['posts'] += $thread['deletedposts'];
}
if(is_moderator($thread['fid'], "canviewunapprove") == true)
{
$thread['posts'] += $thread['unapprovedposts'];
}

			}

			}

			if(is_moderator($thread['fid'], "canviewdeleted"))

			elseif($group_permissions[$thread['fid']]['canviewdeletionnotice'] != 0)

			{
$thread['posts'] += $thread['deletedposts'];
}

			{
$thread['posts'] += $thread['deletedposts'];
}

Zeile 568Zeile 574
					eval("\$threadpages .= \"".$templates->get("forumdisplay_thread_multipage_page")."\";");
}
eval("\$thread['multipage'] = \"".$templates->get("forumdisplay_thread_multipage")."\";");

					eval("\$threadpages .= \"".$templates->get("forumdisplay_thread_multipage_page")."\";");
}
eval("\$thread['multipage'] = \"".$templates->get("forumdisplay_thread_multipage")."\";");

			}
else
{

			}
else
{

				$threadpages = '';
$morelink = '';
$thread['multipage'] = '';

				$threadpages = '';
$morelink = '';
$thread['multipage'] = '';

			}

			}

			$lastpostdate = my_date('relative', $thread['lastpost']);

			$lastpostdate = my_date('relative', $thread['lastpost']);

			$lastposter = htmlspecialchars_uni($thread['lastposter']);

 
			$thread['lastpostlink'] = get_thread_link($thread['tid'], 0, "lastpost");
$lastposteruid = $thread['lastposteruid'];

			$thread['lastpostlink'] = get_thread_link($thread['tid'], 0, "lastpost");
$lastposteruid = $thread['lastposteruid'];

 
			if(!$lastposteruid && !$thread['lastposter'])
{
$lastposter = htmlspecialchars_uni($lang->guest);
}
else
{
$lastposter = htmlspecialchars_uni($thread['lastposter']);
}

			$thread_link = get_thread_link($thread['tid']);

// Don't link to guest's profiles (they have no profile).
if($lastposteruid == 0)
{
$lastposterlink = $lastposter;

			$thread_link = get_thread_link($thread['tid']);

// Don't link to guest's profiles (they have no profile).
if($lastposteruid == 0)
{
$lastposterlink = $lastposter;

			}

			}

			else
{
$lastposterlink = build_profile_link($lastposter, $lastposteruid);

			else
{
$lastposterlink = build_profile_link($lastposter, $lastposteruid);

Zeile 627Zeile 640
				eval("\$attachment_count = \"".$templates->get("forumdisplay_thread_attachment_count")."\";");
}
else

				eval("\$attachment_count = \"".$templates->get("forumdisplay_thread_attachment_count")."\";");
}
else

			{

			{

				$attachment_count = '';
}


				$attachment_count = '';
}


Zeile 637Zeile 650
			$inline_mod_checkbox = '';
if($is_supermod || is_moderator($thread['fid']))
{

			$inline_mod_checkbox = '';
if($is_supermod || is_moderator($thread['fid']))
{

				if(isset($mybb->cookies[$inlinecookie]) && my_strpos($mybb->cookies[$inlinecookie], "|{$thread['tid']}|"))

				if(isset($mybb->cookies[$inlinecookie]) && my_strpos($mybb->cookies[$inlinecookie], "|{$thread['tid']}|") !== false)

				{
$inlinecheck = "checked=\"checked\"";
++$inlinecount;

				{
$inlinecheck = "checked=\"checked\"";
++$inlinecount;

Zeile 646Zeile 659
				{
$inlinecheck = '';
}

				{
$inlinecheck = '';
}

 

// If this user is allowed to use the inline moderation tools for at least one thread, include the necessary scripts
$show_inline_moderation = true;


				eval("\$inline_mod_checkbox = \"".$templates->get("search_results_threads_inlinecheck")."\";");

				eval("\$inline_mod_checkbox = \"".$templates->get("search_results_threads_inlinecheck")."\";");

			}

			}

			elseif($is_mod)
{
eval("\$inline_mod_checkbox = \"".$templates->get("search_results_threads_nocheck")."\";");

			elseif($is_mod)
{
eval("\$inline_mod_checkbox = \"".$templates->get("search_results_threads_nocheck")."\";");

Zeile 655Zeile 672

$plugins->run_hooks("search_results_thread");
eval("\$results .= \"".$templates->get("search_results_threads_thread")."\";");


$plugins->run_hooks("search_results_thread");
eval("\$results .= \"".$templates->get("search_results_threads_thread")."\";");

		}

		}

		if(!$results)
{
error($lang->error_nosearchresults);

		if(!$results)
{
error($lang->error_nosearchresults);

Zeile 664Zeile 681
		if($upper > $threadcount)
{
$upper = $threadcount;

		if($upper > $threadcount)
{
$upper = $threadcount;

		}


		}


		// Inline Thread Moderation Options

		// Inline Thread Moderation Options

		if($is_mod)

		if($show_inline_moderation)

		{

		{

 
			eval("\$inlinemodcol = \"".$templates->get("search_results_inlinemodcol")."\";");


			// If user has moderation tools available, prepare the Select All feature
$lang->page_selected = $lang->sprintf($lang->page_selected, count($thread_cache));
$lang->all_selected = $lang->sprintf($lang->all_selected, (int)$threadcount);

			// If user has moderation tools available, prepare the Select All feature
$lang->page_selected = $lang->sprintf($lang->page_selected, count($thread_cache));
$lang->all_selected = $lang->sprintf($lang->all_selected, (int)$threadcount);

Zeile 688Zeile 707

while($tool = $db->fetch_array($query))
{


while($tool = $db->fetch_array($query))
{

 
				$tool['name'] = htmlspecialchars_uni($tool['name']);

				eval("\$customthreadtools .= \"".$templates->get("search_results_threads_inlinemoderation_custom_tool")."\";");
}
// Build inline moderation dropdown

				eval("\$customthreadtools .= \"".$templates->get("search_results_threads_inlinemoderation_custom_tool")."\";");
}
// Build inline moderation dropdown

Zeile 696Zeile 716
				eval("\$customthreadtools = \"".$templates->get("search_results_threads_inlinemoderation_custom")."\";");
}
eval("\$inlinemod = \"".$templates->get("search_results_threads_inlinemoderation")."\";");

				eval("\$customthreadtools = \"".$templates->get("search_results_threads_inlinemoderation_custom")."\";");
}
eval("\$inlinemod = \"".$templates->get("search_results_threads_inlinemoderation")."\";");

 
		}
elseif($is_mod)
{
eval("\$inlinemodcol = \"".$templates->get("search_results_inlinemodcol_empty")."\";");

		}

$plugins->run_hooks("search_results_end");

		}

$plugins->run_hooks("search_results_end");

Zeile 877Zeile 901
				$bgcolor = 'trow_shaded';
}
elseif($post['visible'] == -1)

				$bgcolor = 'trow_shaded';
}
elseif($post['visible'] == -1)

			{

			{

				$bgcolor = 'trow_shaded trow_deleted';
}
if($post['userusername'])

				$bgcolor = 'trow_shaded trow_deleted';
}
if($post['userusername'])

Zeile 1047Zeile 1071
			$inline_mod_checkbox = '';
if($is_supermod || is_moderator($post['fid']))
{

			$inline_mod_checkbox = '';
if($is_supermod || is_moderator($post['fid']))
{

				if(isset($mybb->cookies[$inlinecookie]) && my_strpos($mybb->cookies[$inlinecookie], "|{$post['pid']}|"))

				if(isset($mybb->cookies[$inlinecookie]) && my_strpos($mybb->cookies[$inlinecookie], "|{$post['pid']}|") !== false)

				{
$inlinecheck = "checked=\"checked\"";
++$inlinecount;

				{
$inlinecheck = "checked=\"checked\"";
++$inlinecount;

Zeile 1056Zeile 1080
				{
$inlinecheck = '';
}

				{
$inlinecheck = '';
}

 

$show_inline_moderation = true;


				eval("\$inline_mod_checkbox = \"".$templates->get("search_results_posts_inlinecheck")."\";");
}
elseif($is_mod)

				eval("\$inline_mod_checkbox = \"".$templates->get("search_results_posts_inlinecheck")."\";");
}
elseif($is_mod)

Zeile 1069Zeile 1096
		if(!$results)
{
error($lang->error_nosearchresults);

		if(!$results)
{
error($lang->error_nosearchresults);

		}

		}

		$multipage = multipage($postcount, $perpage, $page, "search.php?action=results&sid=".htmlspecialchars_uni($mybb->get_input('sid'))."&sortby=$sortby&order=$order&uid=".$mybb->get_input('uid', MyBB::INPUT_INT));
if($upper > $postcount)

		$multipage = multipage($postcount, $perpage, $page, "search.php?action=results&sid=".htmlspecialchars_uni($mybb->get_input('sid'))."&sortby=$sortby&order=$order&uid=".$mybb->get_input('uid', MyBB::INPUT_INT));
if($upper > $postcount)

		{

		{

			$upper = $postcount;
}

			$upper = $postcount;
}





		// Inline Post Moderation Options

		// Inline Post Moderation Options

		if($is_mod)

		if($show_inline_moderation)

		{

		{

 
			eval("\$inlinemodcol = \"".$templates->get("search_results_inlinemodcol")."\";");


			// If user has moderation tools available, prepare the Select All feature
$num_results = $db->num_rows($query);
$lang->page_selected = $lang->sprintf($lang->page_selected, (int)$num_results);

			// If user has moderation tools available, prepare the Select All feature
$num_results = $db->num_rows($query);
$lang->page_selected = $lang->sprintf($lang->page_selected, (int)$num_results);

Zeile 1107Zeile 1136
				eval("\$customposttools = \"".$templates->get("search_results_posts_inlinemoderation_custom")."\";");
}
eval("\$inlinemod = \"".$templates->get("search_results_posts_inlinemoderation")."\";");

				eval("\$customposttools = \"".$templates->get("search_results_posts_inlinemoderation_custom")."\";");
}
eval("\$inlinemod = \"".$templates->get("search_results_posts_inlinemoderation")."\";");

 
		}
elseif($is_mod)
{
eval("\$inlinemodcol = \"".$templates->get("search_results_inlinemodcol_empty")."\";");

		}

$plugins->run_hooks("search_results_end");

		}

$plugins->run_hooks("search_results_end");





		eval("\$searchresults = \"".$templates->get("search_results_posts")."\";");
output_page($searchresults);
}
}

		eval("\$searchresults = \"".$templates->get("search_results_posts")."\";");
output_page($searchresults);
}
}

elseif($mybb->input['action'] == "findguest")














































































elseif($mybb->input['action'] == "findguest")
{
$where_sql = "uid='0'";

$unsearchforums = get_unsearchable_forums();
if($unsearchforums)
{
$where_sql .= " AND fid NOT IN ($unsearchforums)";
}
$inactiveforums = get_inactive_forums();
if($inactiveforums)
{
$where_sql .= " AND 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(isset($forum_permissions['canonlyviewownthreads']) && $forum_permissions['canonlyviewownthreads'] == 1)
{
$onlyusfids[] = $fid;
}
}
if(!empty($onlyusfids))
{
$where_sql .= " AND fid NOT IN(".implode(',', $onlyusfids).")";
}

$options = array(
'order_by' => 'dateline',
'order_dir' => 'desc'
);

// Do we have a hard search limit?
if($mybb->settings['searchhardlimit'] > 0)
{
$options['limit'] = (int)$mybb->settings['searchhardlimit'];
}

$pids = '';
$comma = '';
$query = $db->simple_select("posts", "pid", "{$where_sql}", $options);
while($pid = $db->fetch_field($query, "pid"))
{
$pids .= $comma.$pid;
$comma = ',';
}

$tids = '';
$comma = '';
$query = $db->simple_select("threads", "tid", $where_sql);
while($tid = $db->fetch_field($query, "tid"))
{
$tids .= $comma.$tid;
$comma = ',';
}

$sid = md5(uniqid(microtime(), true));
$searcharray = array(
"sid" => $db->escape_string($sid),
"uid" => $mybb->user['uid'],
"dateline" => TIME_NOW,
"ipaddress" => $db->escape_binary($session->packedip),
"threads" => $db->escape_string($tids),
"posts" => $db->escape_string($pids),
"resulttype" => "posts",
"querycache" => '',
"keywords" => ''
);
$plugins->run_hooks("search_do_search_process");
$db->insert_query("searchlog", $searcharray);
redirect("search.php?action=results&sid=".$sid, $lang->redirect_searchresults);
}
elseif($mybb->input['action'] == "finduser")

{

{

	$where_sql = "uid='0'";

	$where_sql = "uid='".$mybb->get_input('uid', MyBB::INPUT_INT)."'";


$unsearchforums = get_unsearchable_forums();
if($unsearchforums)


$unsearchforums = get_unsearchable_forums();
if($unsearchforums)

Zeile 1143Zeile 1253
		}
}
if(!empty($onlyusfids))

		}
}
if(!empty($onlyusfids))

	{
$where_sql .= " AND fid NOT IN(".implode(',', $onlyusfids).")";
}


	{
$where_sql .= "AND ((fid IN(".implode(',', $onlyusfids).") AND uid='{$mybb->user['uid']}') OR fid NOT IN(".implode(',', $onlyusfids)."))";
}


	$options = array(
'order_by' => 'dateline',
'order_dir' => 'desc'
);

	$options = array(
'order_by' => 'dateline',
'order_dir' => 'desc'
);





	// Do we have a hard search limit?
if($mybb->settings['searchhardlimit'] > 0)
{

	// Do we have a hard search limit?
if($mybb->settings['searchhardlimit'] > 0)
{

Zeile 1159Zeile 1269
	}

$pids = '';

	}

$pids = '';

	$comma = '';

	$comma = '';

	$query = $db->simple_select("posts", "pid", "{$where_sql}", $options);
while($pid = $db->fetch_field($query, "pid"))
{

	$query = $db->simple_select("posts", "pid", "{$where_sql}", $options);
while($pid = $db->fetch_field($query, "pid"))
{

Zeile 1186Zeile 1296
		"posts" => $db->escape_string($pids),
"resulttype" => "posts",
"querycache" => '',

		"posts" => $db->escape_string($pids),
"resulttype" => "posts",
"querycache" => '',

		"keywords" => ''
);
$plugins->run_hooks("search_do_search_process");
$db->insert_query("searchlog", $searcharray);
redirect("search.php?action=results&sid=".$sid, $lang->redirect_searchresults);
}
elseif($mybb->input['action'] == "finduser")
{
$where_sql = "uid='".$mybb->get_input('uid', MyBB::INPUT_INT)."'";

$unsearchforums = get_unsearchable_forums();
if($unsearchforums)
{
$where_sql .= " AND fid NOT IN ($unsearchforums)";
}
$inactiveforums = get_inactive_forums();
if($inactiveforums)
{
$where_sql .= " AND 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(isset($forum_permissions['canonlyviewownthreads']) && $forum_permissions['canonlyviewownthreads'] == 1)
{
$onlyusfids[] = $fid;
}
}
if(!empty($onlyusfids))
{
$where_sql .= "AND ((fid IN(".implode(',', $onlyusfids).") AND uid='{$mybb->user['uid']}') OR fid NOT IN(".implode(',', $onlyusfids)."))";
}

$options = array(
'order_by' => 'dateline',
'order_dir' => 'desc'
);

// Do we have a hard search limit?
if($mybb->settings['searchhardlimit'] > 0)
{
$options['limit'] = (int)$mybb->settings['searchhardlimit'];
}

$pids = '';
$comma = '';
$query = $db->simple_select("posts", "pid", "{$where_sql}", $options);
while($pid = $db->fetch_field($query, "pid"))
{
$pids .= $comma.$pid;
$comma = ',';
}

$tids = '';
$comma = '';
$query = $db->simple_select("threads", "tid", $where_sql);
while($tid = $db->fetch_field($query, "tid"))
{
$tids .= $comma.$tid;
$comma = ',';
}

$sid = md5(uniqid(microtime(), true));
$searcharray = array(
"sid" => $db->escape_string($sid),
"uid" => $mybb->user['uid'],
"dateline" => TIME_NOW,
"ipaddress" => $db->escape_binary($session->packedip),
"threads" => $db->escape_string($tids),
"posts" => $db->escape_string($pids),
"resulttype" => "posts",
"querycache" => '',
"keywords" => ''
);
$plugins->run_hooks("search_do_search_process");
$db->insert_query("searchlog", $searcharray);
redirect("search.php?action=results&sid=".$sid, $lang->redirect_searchresults);

		"keywords" => ''
);
$plugins->run_hooks("search_do_search_process");
$db->insert_query("searchlog", $searcharray);
redirect("search.php?action=results&sid=".$sid, $lang->redirect_searchresults);














































































}
elseif($mybb->input['action'] == "finduserthreads")
{

}
elseif($mybb->input['action'] == "finduserthreads")
{

	$where_sql = "t.uid='".$mybb->get_input('uid', MyBB::INPUT_INT)."'";













































































	$where_sql = "uid='".$mybb->get_input('uid', MyBB::INPUT_INT)."'";

$unsearchforums = get_unsearchable_forums();
if($unsearchforums)
{
$where_sql .= " AND fid NOT IN ($unsearchforums)";
}
$inactiveforums = get_inactive_forums();
if($inactiveforums)
{
$where_sql .= " AND 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(isset($forum_permissions['canonlyviewownthreads']) && $forum_permissions['canonlyviewownthreads'] == 1)
{
$onlyusfids[] = $fid;
}
}
if(!empty($onlyusfids))
{
$where_sql .= "AND ((fid IN(".implode(',', $onlyusfids).") AND uid='{$mybb->user['uid']}') OR fid NOT IN(".implode(',', $onlyusfids)."))";
}

$tids = '';
$comma = '';
$query = $db->simple_select("threads", "tid", $where_sql);
while($tid = $db->fetch_field($query, "tid"))
{
$tids .= $comma.$tid;
$comma = ',';
}

$sid = md5(uniqid(microtime(), true));
$searcharray = array(
"sid" => $db->escape_string($sid),
"uid" => $mybb->user['uid'],
"dateline" => TIME_NOW,
"ipaddress" => $db->escape_binary($session->packedip),
"threads" => $db->escape_string($tids),
"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);
}
elseif($mybb->input['action'] == "getnew")
{

$where_sql = "lastpost >= '".(int)$mybb->user['lastvisit']."'";

if($mybb->get_input('fid', MyBB::INPUT_INT))
{
$where_sql .= " AND fid='".$mybb->get_input('fid', MyBB::INPUT_INT)."'";
}
else if($mybb->get_input('fids'))
{
$fids = explode(',', $mybb->get_input('fids'));
foreach($fids as $key => $fid)
{
$fids[$key] = (int)$fid;
}

if(!empty($fids))
{
$where_sql .= " AND fid IN (".implode(',', $fids).")";
}
}


$unsearchforums = get_unsearchable_forums();
if($unsearchforums)


$unsearchforums = get_unsearchable_forums();
if($unsearchforums)

	{
$where_sql .= " AND t.fid NOT IN ($unsearchforums)";

	{
$where_sql .= " AND fid NOT IN ($unsearchforums)";

	}
$inactiveforums = get_inactive_forums();
if($inactiveforums)
{

	}
$inactiveforums = get_inactive_forums();
if($inactiveforums)
{

		$where_sql .= " AND t.fid NOT IN ($inactiveforums)";

		$where_sql .= " AND fid NOT IN ($inactiveforums)";

	}

$permsql = "";

	}

$permsql = "";

Zeile 1298Zeile 1407
	}
if(!empty($onlyusfids))
{

	}
if(!empty($onlyusfids))
{

		$where_sql .= "AND ((t.fid IN(".implode(',', $onlyusfids).") AND t.uid='{$mybb->user['uid']}') OR t.fid NOT IN(".implode(',', $onlyusfids)."))";










		$where_sql .= "AND ((fid IN(".implode(',', $onlyusfids).") AND uid='{$mybb->user['uid']}') OR fid NOT IN(".implode(',', $onlyusfids)."))";
}

$tids = '';
$comma = '';
$query = $db->simple_select("threads", "tid", $where_sql);
while($tid = $db->fetch_field($query, "tid"))
{
$tids .= $comma.$tid;
$comma = ',';

	}

$sid = md5(uniqid(microtime(), true));

	}

$sid = md5(uniqid(microtime(), true));

Zeile 1307Zeile 1425
		"uid" => $mybb->user['uid'],
"dateline" => TIME_NOW,
"ipaddress" => $db->escape_binary($session->packedip),

		"uid" => $mybb->user['uid'],
"dateline" => TIME_NOW,
"ipaddress" => $db->escape_binary($session->packedip),

		"threads" => '',

		"threads" => $db->escape_string($tids),

		"posts" => '',
"resulttype" => "threads",
"querycache" => $db->escape_string($where_sql),
"keywords" => ''
);

		"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);
}
elseif($mybb->input['action'] == "getnew")
{

$where_sql = "t.lastpost >= '".(int)$mybb->user['lastvisit']."'";

if($mybb->get_input('fid', MyBB::INPUT_INT))
{
$where_sql .= " AND t.fid='".$mybb->get_input('fid', MyBB::INPUT_INT)."'";
}
else if($mybb->get_input('fids'))
{
$fids = explode(',', $mybb->get_input('fids'));
foreach($fids as $key => $fid)
{
$fids[$key] = (int)$fid;
}

if(!empty($fids))
{
$where_sql .= " AND t.fid IN (".implode(',', $fids).")";
}
}

$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(isset($forum_permissions['canonlyviewownthreads']) && $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(), true));
$searcharray = array(
"sid" => $db->escape_string($sid),
"uid" => $mybb->user['uid'],
"dateline" => TIME_NOW,
"ipaddress" => $db->escape_binary($session->packedip),
"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);

	$plugins->run_hooks("search_do_search_process");
$db->insert_query("searchlog", $searcharray);
redirect("search.php?action=results&sid=".$sid, $lang->redirect_searchresults);

Zeile 1397Zeile 1448
	}
$datecut = TIME_NOW-(86400*$days);


	}
$datecut = TIME_NOW-(86400*$days);


	$where_sql = "t.lastpost >='".$datecut."'";

	$where_sql = "lastpost >='".$datecut."'";


if($mybb->get_input('fid', MyBB::INPUT_INT))
{


if($mybb->get_input('fid', MyBB::INPUT_INT))
{

		$where_sql .= " AND t.fid='".$mybb->get_input('fid', MyBB::INPUT_INT)."'";

		$where_sql .= " AND fid='".$mybb->get_input('fid', MyBB::INPUT_INT)."'";

	}
else if($mybb->get_input('fids'))

	}
else if($mybb->get_input('fids'))

	{

	{

		$fids = explode(',', $mybb->get_input('fids'));
foreach($fids as $key => $fid)

		$fids = explode(',', $mybb->get_input('fids'));
foreach($fids as $key => $fid)

		{

		{

			$fids[$key] = (int)$fid;

			$fids[$key] = (int)$fid;

		}

		}


if(!empty($fids))


if(!empty($fids))

		{
$where_sql .= " AND t.fid IN (".implode(',', $fids).")";
}

		{
$where_sql .= " AND fid IN (".implode(',', $fids).")";
}

	}

$unsearchforums = get_unsearchable_forums();
if($unsearchforums)
{

	}

$unsearchforums = get_unsearchable_forums();
if($unsearchforums)
{

		$where_sql .= " AND t.fid NOT IN ($unsearchforums)";

		$where_sql .= " AND fid NOT IN ($unsearchforums)";

	}
$inactiveforums = get_inactive_forums();
if($inactiveforums)
{

	}
$inactiveforums = get_inactive_forums();
if($inactiveforums)
{

		$where_sql .= " AND t.fid NOT IN ($inactiveforums)";

		$where_sql .= " AND fid NOT IN ($inactiveforums)";

	}

$permsql = "";

	}

$permsql = "";

Zeile 1442Zeile 1493
	}
if(!empty($onlyusfids))
{

	}
if(!empty($onlyusfids))
{

		$where_sql .= "AND ((t.fid IN(".implode(',', $onlyusfids).") AND t.uid='{$mybb->user['uid']}') OR t.fid NOT IN(".implode(',', $onlyusfids)."))";

		$where_sql .= "AND ((fid IN(".implode(',', $onlyusfids).") AND uid='{$mybb->user['uid']}') OR fid NOT IN(".implode(',', $onlyusfids)."))";

	}


	}


 
	$tids = '';
$comma = '';
$query = $db->simple_select("threads", "tid", $where_sql);
while($tid = $db->fetch_field($query, "tid"))
{
$tids .= $comma.$tid;
$comma = ',';
}


	$sid = md5(uniqid(microtime(), true));
$searcharray = array(
"sid" => $db->escape_string($sid),
"uid" => $mybb->user['uid'],
"dateline" => TIME_NOW,
"ipaddress" => $db->escape_binary($session->packedip),

	$sid = md5(uniqid(microtime(), true));
$searcharray = array(
"sid" => $db->escape_string($sid),
"uid" => $mybb->user['uid'],
"dateline" => TIME_NOW,
"ipaddress" => $db->escape_binary($session->packedip),

		"threads" => '',

		"threads" => $db->escape_string($tids),

		"posts" => '',
"resulttype" => "threads",
"querycache" => $db->escape_string($where_sql),

		"posts" => '',
"resulttype" => "threads",
"querycache" => $db->escape_string($where_sql),