Vergleich showthread.php - 1.6.13 - 1.6.15

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 44Zeile 44
		);
$query = $db->simple_select("posts", "tid", "pid=".$mybb->input['pid'], $options);
$post = $db->fetch_array($query);

		);
$query = $db->simple_select("posts", "tid", "pid=".$mybb->input['pid'], $options);
$post = $db->fetch_array($query);

 
		
if(empty($post))
{
// post does not exist --> show error message
error($lang->error_invalidpost);
}


		$mybb->input['tid'] = $post['tid'];
}
}

		$mybb->input['tid'] = $post['tid'];
}
}

Zeile 276Zeile 283
	if(!$nextthread['tid'])
{
error($lang->error_nonextnewest);

	if(!$nextthread['tid'])
{
error($lang->error_nonextnewest);

	}
$options = array(
"limit_start" => 0,
"limit" => 1,
"order_by" => "dateline",
"order_dir" => "desc"
);

	}
$options = array(
"limit_start" => 0,
"limit" => 1,
"order_by" => "dateline",
"order_dir" => "desc"
);

	$query = $db->simple_select('posts', 'pid', "tid='{$nextthread['tid']}'", $options);

// Redirect to the proper page.

	$query = $db->simple_select('posts', 'pid', "tid='{$nextthread['tid']}'", $options);

// Redirect to the proper page.

Zeile 334Zeile 341
if($mybb->settings['showforumpagesbreadcrumb'])
{
// How many pages are there?

if($mybb->settings['showforumpagesbreadcrumb'])
{
// How many pages are there?

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

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

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

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

Zeile 641Zeile 648
	if($mybb->settings['delayedthreadviews'] == 1)
{
$db->shutdown_query("INSERT INTO ".TABLE_PREFIX."threadviews (tid) VALUES('{$tid}')");

	if($mybb->settings['delayedthreadviews'] == 1)
{
$db->shutdown_query("INSERT INTO ".TABLE_PREFIX."threadviews (tid) VALUES('{$tid}')");

	}

	}

	else

	else

	{

	{

		$db->shutdown_query("UPDATE ".TABLE_PREFIX."threads SET views=views+1 WHERE tid='{$tid}'");
}
++$thread['views'];

		$db->shutdown_query("UPDATE ".TABLE_PREFIX."threads SET views=views+1 WHERE tid='{$tid}'");
}
++$thread['views'];

Zeile 655Zeile 662
		$rated = 0;
$lang->load("ratethread");
if($thread['numratings'] <= 0)

		$rated = 0;
$lang->load("ratethread");
if($thread['numratings'] <= 0)

		{

		{

			$thread['width'] = 0;
$thread['averagerating'] = 0;
$thread['numratings'] = 0;

			$thread['width'] = 0;
$thread['averagerating'] = 0;
$thread['numratings'] = 0;

Zeile 698Zeile 705
	if($forumpermissions['cansearch'] != 0)
{
eval("\$search_thread = \"".$templates->get("showthread_search")."\";");

	if($forumpermissions['cansearch'] != 0)
{
eval("\$search_thread = \"".$templates->get("showthread_search")."\";");

	}


	}


	// Fetch the ignore list for the current user if they have one
$ignored_users = array();
if($mybb->user['uid'] > 0 && $mybb->user['ignorelist'] != "")

	// Fetch the ignore list for the current user if they have one
$ignored_users = array();
if($mybb->user['uid'] > 0 && $mybb->user['ignorelist'] != "")

Zeile 744Zeile 751
		else
{
$where = " ORDER BY dateline LIMIT 0, 1";

		else
{
$where = " ORDER BY dateline LIMIT 0, 1";

		}

		}

		$query = $db->query("
SELECT u.*, u.username AS userusername, p.*, f.*, eu.username AS editusername
FROM ".TABLE_PREFIX."posts p

		$query = $db->query("
SELECT u.*, u.username AS userusername, p.*, f.*, eu.username AS editusername
FROM ".TABLE_PREFIX."posts p

Zeile 759Zeile 766
		if(!$mybb->input['pid'])
{
$mybb->input['pid'] = $showpost['pid'];

		if(!$mybb->input['pid'])
{
$mybb->input['pid'] = $showpost['pid'];

		}


		}


		// Is there actually a pid to display?
if(!$showpost['pid'])
{

		// Is there actually a pid to display?
if(!$showpost['pid'])
{

Zeile 808Zeile 815
	else // Linear display
{
$threadexbox = '';

	else // Linear display
{
$threadexbox = '';

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

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

		{

		{

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

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

		}

// Figure out if we need to display multiple pages.

		}

// Figure out if we need to display multiple pages.

Zeile 1001Zeile 1008
	$similarthreads = '';
if($mybb->settings['showsimilarthreads'] != 0)
{

	$similarthreads = '';
if($mybb->settings['showsimilarthreads'] != 0)
{

 
		$own_perm = '';
if($forumpermissions['canonlyviewownthreads'] == 1)
{
$own_perm = " AND t.uid={$mybb->user['uid']}";
}


		switch($db->type)
{
case "pgsql":

		switch($db->type)
{
case "pgsql":

Zeile 1008Zeile 1021
					SELECT t.*, t.username AS threadusername, u.username
FROM ".TABLE_PREFIX."threads t
LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid = t.uid), plainto_tsquery ('".$db->escape_string($thread['subject'])."') AS query

					SELECT t.*, t.username AS threadusername, u.username
FROM ".TABLE_PREFIX."threads t
LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid = t.uid), plainto_tsquery ('".$db->escape_string($thread['subject'])."') AS query

					WHERE t.fid='{$thread['fid']}' AND t.tid!='{$thread['tid']}' AND t.visible='1' AND t.closed NOT LIKE 'moved|%' AND t.subject @@ query

					WHERE t.fid='{$thread['fid']}' AND t.tid!='{$thread['tid']}' AND t.visible='1' AND t.closed NOT LIKE 'moved|%' AND t.subject @@ query{$own_perm}

					ORDER BY t.lastpost DESC
OFFSET 0 LIMIT {$mybb->settings['similarlimit']}
");

					ORDER BY t.lastpost DESC
OFFSET 0 LIMIT {$mybb->settings['similarlimit']}
");

Zeile 1018Zeile 1031
					SELECT t.*, t.username AS threadusername, u.username, MATCH (t.subject) AGAINST ('".$db->escape_string($thread['subject'])."') AS relevance
FROM ".TABLE_PREFIX."threads t
LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid = t.uid)

					SELECT t.*, t.username AS threadusername, u.username, MATCH (t.subject) AGAINST ('".$db->escape_string($thread['subject'])."') AS relevance
FROM ".TABLE_PREFIX."threads t
LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid = t.uid)

					WHERE t.fid='{$thread['fid']}' AND t.tid!='{$thread['tid']}' AND t.visible='1' AND t.closed NOT LIKE 'moved|%' AND MATCH (t.subject) AGAINST ('".$db->escape_string($thread['subject'])."') >= '{$mybb->settings['similarityrating']}'

					WHERE t.fid='{$thread['fid']}' AND t.tid!='{$thread['tid']}' AND t.visible='1' AND t.closed NOT LIKE 'moved|%'{$own_perm} AND MATCH (t.subject) AGAINST ('".$db->escape_string($thread['subject'])."') >= '{$mybb->settings['similarityrating']}'

					ORDER BY t.lastpost DESC
LIMIT 0, {$mybb->settings['similarlimit']}
");

					ORDER BY t.lastpost DESC
LIMIT 0, {$mybb->settings['similarlimit']}
");