Vergleich search.php - 1.6.6 - 1.6.7

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 6Zeile 6
 * Website: http://mybb.com
* License: http://mybb.com/about/license
*

 * Website: http://mybb.com
* License: http://mybb.com/about/license
*

 * $Id: search.php 5442 2011-04-16 09:09:38Z jammerx2 $

 * $Id: search.php 5765 2012-03-27 09:52:45Z Tomm $

 */



 */



Zeile 184Zeile 184
			ORDER BY pid, disporder
");


			ORDER BY pid, disporder
");


		$forumsread = unserialize($mybb->cookies['mybb']['forumread']);

		$forumsread = my_unserialize($mybb->cookies['mybb']['forumread']);

	}
else
{

	}
else
{

Zeile 197Zeile 197
			ORDER BY pid, disporder
");
}

			ORDER BY pid, disporder
");
}

 


	while($forum = $db->fetch_array($query))
{
if($mybb->user['uid'] == 0)

	while($forum = $db->fetch_array($query))
{
if($mybb->user['uid'] == 0)

Zeile 204Zeile 205
			if($forumsread[$forum['fid']])
{
$forum['lastread'] = $forumsread[$forum['fid']];

			if($forumsread[$forum['fid']])
{
$forum['lastread'] = $forumsread[$forum['fid']];

			}
}

			}
}

		$readforums[$forum['fid']] = $forum['lastread'];
}
$fpermissions = forum_permissions();

		$readforums[$forum['fid']] = $forum['lastread'];
}
$fpermissions = forum_permissions();

Zeile 214Zeile 215
	$inlinemodcol = $inlinecookie = '';
$is_mod = $is_supermod = false;
if($mybb->usergroup['issupermod'])

	$inlinemodcol = $inlinecookie = '';
$is_mod = $is_supermod = false;
if($mybb->usergroup['issupermod'])

	{

	{

		$is_supermod = true;
}
if($is_supermod || is_moderator())

		$is_supermod = true;
}
if($is_supermod || is_moderator())

Zeile 260Zeile 261
			$where_conditions = $search['querycache'];
$query = $db->simple_select("threads t", "t.tid", $where_conditions. " AND {$unapproved_where} AND t.closed NOT LIKE 'moved|%' {$limitsql}");
while($thread = $db->fetch_array($query))

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

			{

			{

				$threads[$thread['tid']] = $thread['tid'];
$threadcount++;

				$threads[$thread['tid']] = $thread['tid'];
$threadcount++;

			}

			}

			// Build our list of threads.
if($threadcount > 0)

			// Build our list of threads.
if($threadcount > 0)

			{

			{

				$search['threads'] = implode(",", $threads);

				$search['threads'] = implode(",", $threads);

			}

			}

			// No results.

			// No results.

			else
{
error($lang->error_nosearchresults);
}
$where_conditions = "t.tid IN (".$search['threads'].")";

			else
{
error($lang->error_nosearchresults);
}
$where_conditions = "t.tid IN (".$search['threads'].")";

		}
// This search doesn't use a query cache, results stored in search table.
else

		}
// This search doesn't use a query cache, results stored in search table.
else

Zeile 284Zeile 285
			$count = $db->fetch_array($query);

if(!$count['resultcount'])

			$count = $db->fetch_array($query);

if(!$count['resultcount'])

			{

			{

				error($lang->error_nosearchresults);
}
$threadcount = $count['resultcount'];

				error($lang->error_nosearchresults);
}
$threadcount = $count['resultcount'];

Zeile 303Zeile 304
			}
}
if(!empty($onlyusfids))

			}
}
if(!empty($onlyusfids))

		{

		{

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


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


Zeile 342Zeile 343
		$thread_ids = implode(",", array_keys($thread_cache));

if(empty($thread_ids))

		$thread_ids = implode(",", array_keys($thread_cache));

if(empty($thread_ids))

		{

		{

			error($lang->error_nosearchresults);
}


			error($lang->error_nosearchresults);
}


Zeile 350Zeile 351
		if($mybb->settings['dotfolders'] != 0 && $mybb->user['uid'] && $thread_cache)
{
$query = $db->simple_select("posts", "DISTINCT tid,uid", "uid='".$mybb->user['uid']."' AND tid IN(".$thread_ids.")");

		if($mybb->settings['dotfolders'] != 0 && $mybb->user['uid'] && $thread_cache)
{
$query = $db->simple_select("posts", "DISTINCT tid,uid", "uid='".$mybb->user['uid']."' AND tid IN(".$thread_ids.")");

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

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

				$thread_cache[$thread['tid']]['dot_icon'] = 1;
}
}

				$thread_cache[$thread['tid']]['dot_icon'] = 1;
}
}

Zeile 376Zeile 377
			if(!$thread['visible'])
{
$bgcolor = 'trow_shaded';

			if(!$thread['visible'])
{
$bgcolor = 'trow_shaded';

			}


			}


			if($thread['userusername'])
{
$thread['username'] = $thread['userusername'];

			if($thread['userusername'])
{
$thread['username'] = $thread['userusername'];

Zeile 386Zeile 387
			
// If this thread has a prefix, insert a space between prefix and subject
if($thread['prefix'] != 0)

			
// If this thread has a prefix, insert a space between prefix and subject
if($thread['prefix'] != 0)

			{

			{

				$thread['threadprefix'] .= ' ';
}


				$thread['threadprefix'] .= ' ';
}


Zeile 423Zeile 424
			if($mybb->settings['threadreadcut'] > 0 && $mybb->user['uid'])
{
$forum_read = $readforums[$thread['fid']];

			if($mybb->settings['threadreadcut'] > 0 && $mybb->user['uid'])
{
$forum_read = $readforums[$thread['fid']];

			
$read_cutoff = TIME_NOW-$mybb->settings['threadreadcut']*60*60*24;
if($forum_read == 0 || $forum_read < $read_cutoff)
{
$forum_read = $read_cutoff;
}
}

			
$read_cutoff = TIME_NOW-$mybb->settings['threadreadcut']*60*60*24;
if($forum_read == 0 || $forum_read < $read_cutoff)
{
$forum_read = $read_cutoff;
}
}

			else
{
$forum_read = $forumsread[$thread['fid']];

			else
{
$forum_read = $forumsread[$thread['fid']];

Zeile 449Zeile 450
			else
{
$last_read = my_get_array_cookie("threadread", $thread['tid']);

			else
{
$last_read = my_get_array_cookie("threadread", $thread['tid']);

			}

			}

	
if($forum_read > $last_read)
{

	
if($forum_read > $last_read)
{

Zeile 506Zeile 507
					$pagesstop = 4;
$page_link = get_thread_link($thread['tid'], $thread['pages']).$highlight;
eval("\$morelink = \"".$templates->get("forumdisplay_thread_multipage_more")."\";");

					$pagesstop = 4;
$page_link = get_thread_link($thread['tid'], $thread['pages']).$highlight;
eval("\$morelink = \"".$templates->get("forumdisplay_thread_multipage_more")."\";");

				}

				}

				else
{
$pagesstop = $thread['pages'];

				else
{
$pagesstop = $thread['pages'];

Zeile 656Zeile 657
	else // Displaying results as posts
{
if(!$search['posts'])

	else // Displaying results as posts
{
if(!$search['posts'])

		{
error($lang->error_nosearchresults);
}

$postcount = 0;


		{
error($lang->error_nosearchresults);
}

$postcount = 0;


		// Moderators can view unapproved threads
$query = $db->simple_select("moderators", "fid", "(id='{$mybb->user['uid']}' AND isgroup='0') OR (id='{$mybb->user['usergroup']}' AND isgroup='1')");
if($mybb->usergroup['issupermod'] == 1)

		// Moderators can view unapproved threads
$query = $db->simple_select("moderators", "fid", "(id='{$mybb->user['uid']}' AND isgroup='0') OR (id='{$mybb->user['usergroup']}' AND isgroup='1')");
if($mybb->usergroup['issupermod'] == 1)

Zeile 671Zeile 672
			$t_unapproved_where = "visible < 0";
}
elseif($db->num_rows($query))

			$t_unapproved_where = "visible < 0";
}
elseif($db->num_rows($query))

		{

		{

			// Normal moderators
$moderated_forums = '0';
while($forum = $db->fetch_array($query))

			// Normal moderators
$moderated_forums = '0';
while($forum = $db->fetch_array($query))

Zeile 681Zeile 682
			}
$p_unapproved_where = "visible >= 0";
$t_unapproved_where = "visible < 0 AND fid NOT IN ({$moderated_forums})";

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

		}

		}

		else
{
// Normal users

		else
{
// Normal users

Zeile 699Zeile 700
		{
$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 709Zeile 710
		{
$pids[$post['pid']] = $post['tid'];
$tids[$post['tid']][$post['pid']] = $post['pid'];

		{
$pids[$post['pid']] = $post['tid'];
$tids[$post['tid']][$post['pid']] = $post['pid'];

		}


		}


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

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

Zeile 738Zeile 739
		if(!$postcount)
{
error($lang->error_nosearchresults);

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

		}

		}

		
// And now we have our sanatized post list
$search['posts'] = implode(',', array_keys($pids));

		
// And now we have our sanatized post list
$search['posts'] = implode(',', array_keys($pids));

Zeile 794Zeile 795
			{
$posticon = $icon_cache[$post['icon']];
$icon = "<img src=\"".$posticon['path']."\" alt=\"".$posticon['name']."\" />";

			{
$posticon = $icon_cache[$post['icon']];
$icon = "<img src=\"".$posticon['path']."\" alt=\"".$posticon['name']."\" />";

			}
else
{

			}
else
{

				$icon = "&nbsp;";
}


				$icon = "&nbsp;";
}


Zeile 816Zeile 817
			$donenew = 0;
$last_read = 0;
$post['thread_lastread'] = $readthreads[$post['tid']];

			$donenew = 0;
$last_read = 0;
$post['thread_lastread'] = $readthreads[$post['tid']];

			if($mybb->settings['threadreadcut'] > 0 && $mybb->user['uid'] && $post['thread_lastpost'] > $forumread)


















if($mybb->settings['threadreadcut'] > 0 && $mybb->user['uid'])
{
$forum_read = $readforums[$post['fid']];

$read_cutoff = TIME_NOW-$mybb->settings['threadreadcut']*60*60*24;
if($forum_read == 0 || $forum_read < $read_cutoff)
{
$forum_read = $read_cutoff;
}
}
else
{
$forum_read = $forumsread[$post['fid']];
}

if($mybb->settings['threadreadcut'] > 0 && $mybb->user['uid'] && $post['thread_lastpost'] > $forum_read)

			{
$cutoff = TIME_NOW-$mybb->settings['threadreadcut']*60*60*24;
if($post['thread_lastpost'] > $cutoff)

			{
$cutoff = TIME_NOW-$mybb->settings['threadreadcut']*60*60*24;
if($post['thread_lastpost'] > $cutoff)

Zeile 841Zeile 858
			if(!$last_read)
{
$readcookie = $threadread = my_get_array_cookie("threadread", $post['tid']);

			if(!$last_read)
{
$readcookie = $threadread = my_get_array_cookie("threadread", $post['tid']);

				if($readcookie > $forumread)

				if($readcookie > $forum_read)

				{
$last_read = $readcookie;
}

				{
$last_read = $readcookie;
}

				elseif($forumread > $mybb->user['lastvisit'])

				elseif($forum_read > $mybb->user['lastvisit'])

				{

				{

					$last_read = $forumread;

					$last_read = $forum_read;

				}
else
{

				}
else
{