Vergleich search.php - 1.6.10 - 1.6.18

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 51Zeile 51
$limitsql = "";
if(intval($mybb->settings['searchhardlimit']) > 0)
{

$limitsql = "";
if(intval($mybb->settings['searchhardlimit']) > 0)
{

	$limitsql = "ORDER BY t.lastpost DESC LIMIT ".intval($mybb->settings['searchhardlimit']);

	$limitsql = "LIMIT ".intval($mybb->settings['searchhardlimit']);

}

if($mybb->input['action'] == "results")

}

if($mybb->input['action'] == "results")

Zeile 129Zeile 129
		$oppsort = $lang->desc;		
}


		$oppsort = $lang->desc;		
}


	if(!$mybb->settings['threadsperpage'])

	if(!$mybb->settings['threadsperpage'] || (int)$mybb->settings['threadsperpage'] < 1)

	{
$mybb->settings['threadsperpage'] = 20;
}

	{
$mybb->settings['threadsperpage'] = 20;
}

Zeile 261Zeile 261
		if($search['querycache'] != "")
{
$where_conditions = $search['querycache'];

		if($search['querycache'] != "")
{
$where_conditions = $search['querycache'];

			$query = $db->simple_select("threads t", "t.tid", $where_conditions. " AND {$unapproved_where} AND t.closed NOT LIKE 'moved|%' {$limitsql}");

			$query = $db->simple_select("threads t", "t.tid", $where_conditions. " AND {$unapproved_where} AND t.closed NOT LIKE 'moved|%' ORDER BY t.lastpost DESC {$limitsql}");

			while($thread = $db->fetch_array($query))
{
$threads[$thread['tid']] = $thread['tid'];

			while($thread = $db->fetch_array($query))
{
$threads[$thread['tid']] = $thread['tid'];

Zeile 404Zeile 404
			if($icon_cache[$thread['icon']])
{
$posticon = $icon_cache[$thread['icon']];

			if($icon_cache[$thread['icon']])
{
$posticon = $icon_cache[$thread['icon']];

 
				$posticon['path'] = htmlspecialchars_uni($posticon['path']);
$posticon['name'] = htmlspecialchars_uni($posticon['name']);

				$icon = "<img src=\"".$posticon['path']."\" alt=\"".$posticon['name']."\" />";
}
else

				$icon = "<img src=\"".$posticon['path']."\" alt=\"".$posticon['name']."\" />";
}
else

Zeile 491Zeile 493
			}
$folder .= "folder";


			}
$folder .= "folder";


			if(!$mybb->settings['postsperpage'])

			if(!$mybb->settings['postsperpage'] || (int)$mybb->settings['postsperpage'] < 1)

			{

			{

				$mybb->settings['postperpage'] = 20;

				$mybb->settings['postsperpage'] = 20;

			}

$thread['pages'] = 0;

			}

$thread['pages'] = 0;

Zeile 687Zeile 689
				$moderated_forums .= ','.$forum['fid'];
$test_moderated_forums[$forum['fid']] = $forum['fid'];
}

				$moderated_forums .= ','.$forum['fid'];
$test_moderated_forums[$forum['fid']] = $forum['fid'];
}

			$p_unapproved_where = "visible >= 0";

			$p_unapproved_where = "(visible > 0 OR (visible=0 AND fid IN ({$moderated_forums})))";

			$t_unapproved_where = "visible < 0 AND fid NOT IN ({$moderated_forums})";
}
else

			$t_unapproved_where = "visible < 0 AND fid NOT IN ({$moderated_forums})";
}
else

		{

		{

			// Normal users
$p_unapproved_where = 'visible=1';
$t_unapproved_where = 'visible < 1';

			// Normal users
$p_unapproved_where = 'visible=1';
$t_unapproved_where = 'visible < 1';

Zeile 704Zeile 706
		}

if(strpos($sortfield, 'p.') !== false)

		}

if(strpos($sortfield, 'p.') !== false)

		{

		{

			$post_cache_options['order_by'] = str_replace('p.', '', $sortfield);
$post_cache_options['order_dir'] = $order;

			$post_cache_options['order_by'] = str_replace('p.', '', $sortfield);
$post_cache_options['order_dir'] = $order;

		}


		}


		$tids = array();
$pids = array();
// Make sure the posts we're viewing we have permission to view.

		$tids = array();
$pids = array();
// Make sure the posts we're viewing we have permission to view.

Zeile 722Zeile 724
		if(!empty($pids))
{
$temp_pids = array();

		if(!empty($pids))
{
$temp_pids = array();

 

$group_permissions = forum_permissions();
$permsql = '';
$onlyusfids = array();

foreach($group_permissions as $fid => $forum_permissions)
{
if(!empty($forum_permissions['canonlyviewownthreads']))
{
$onlyusfids[] = $fid;
}
}

if($onlyusfids)
{
$permsql .= " OR (fid IN(".implode(',', $onlyusfids).") AND uid!={$mybb->user['uid']})";
}
$unsearchforums = get_unsearchable_forums();
if($unsearchforums)
{
$permsql .= " OR fid IN ($unsearchforums)";
}
$inactiveforums = get_inactive_forums();
if($inactiveforums)
{
$permsql .= " OR fid IN ($inactiveforums)";
}


// Check the thread records as well. If we don't have permissions, remove them from the listing.


// Check the thread records as well. If we don't have permissions, remove them from the listing.

			$query = $db->simple_select("threads", "tid", "tid IN(".$db->escape_string(implode(',', $pids)).") AND ({$t_unapproved_where} OR closed LIKE 'moved|%')");

			$query = $db->simple_select("threads", "tid", "tid IN(".$db->escape_string(implode(',', $pids)).") AND ({$t_unapproved_where}{$permsql} OR closed LIKE 'moved|%')");

			while($thread = $db->fetch_array($query))
{
if(array_key_exists($thread['tid'], $tids) != false)

			while($thread = $db->fetch_array($query))
{
if(array_key_exists($thread['tid'], $tids) != false)

Zeile 801Zeile 830
			if($icon_cache[$post['icon']])
{
$posticon = $icon_cache[$post['icon']];

			if($icon_cache[$post['icon']])
{
$posticon = $icon_cache[$post['icon']];

 
				$posticon['path'] = htmlspecialchars_uni($posticon['path']);
$posticon['name'] = htmlspecialchars_uni($posticon['name']);

				$icon = "<img src=\"".$posticon['path']."\" alt=\"".$posticon['name']."\" />";
}
else

				$icon = "<img src=\"".$posticon['path']."\" alt=\"".$posticon['name']."\" />";
}
else

Zeile 1217Zeile 1248
elseif($mybb->input['action'] == "getnew")
{


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


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

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


if($mybb->input['fid'])
{


if($mybb->input['fid'])
{

Zeile 1492Zeile 1523
	{
error($lang->error_closedinvalidforum);
}

	{
error($lang->error_closedinvalidforum);
}

	if($forum_permissions['canview'] == 0 || $forum_permissions['canviewthreads'] != 1)

	if($forum_permissions['canview'] == 0 || $forum_permissions['canviewthreads'] != 1 || (isset($forum_permissions['canonlyviewownthreads']) && $forum_permissions['canonlyviewownthreads'] != 0 && $thread['uid'] != $mybb->user['uid']))

	{
error_no_permission();
}

	{
error_no_permission();
}