Vergleich showthread.php - 1.6.5 - 1.6.9

  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: showthread.php 5639 2011-10-26 09:16:47Z Tomm $

 * $Id$

 */

define("IN_MYBB", 1);

 */

define("IN_MYBB", 1);

Zeile 80Zeile 80
}

$visibleonly = "AND visible='1'";

}

$visibleonly = "AND visible='1'";

 
$visibleonly2 = "AND p.visible='1' AND t.visible='1'";


// Is the currently logged in user a moderator of this forum?
if(is_moderator($fid))
{
$visibleonly = " AND (visible='1' OR visible='0')";


// Is the currently logged in user a moderator of this forum?
if(is_moderator($fid))
{
$visibleonly = " AND (visible='1' OR visible='0')";

 
	$visibleonly2 = "AND (p.visible='1' OR p.visible='0') AND (t.visible='1' OR t.visible='0')";

	$ismod = true;
}
else

	$ismod = true;
}
else

Zeile 122Zeile 124

// Forumdisplay cache
$forum_stats = $cache->read("forumsdisplay");


// Forumdisplay cache
$forum_stats = $cache->read("forumsdisplay");


if(!is_array($forum_stats))
{
// Attempt to rebuild it?
$forum_stats = $cache->read("forumdisplay", true);

if(!is_array($forum_stats))
{
$forum_stats = array();
}
}

 

$breadcrumb_multipage = array();
if($mybb->settings['showforumpagesbreadcrumb'])


$breadcrumb_multipage = array();
if($mybb->settings['showforumpagesbreadcrumb'])

Zeile 212Zeile 203
{
$mybb->input['action'] = "thread";
}

{
$mybb->input['action'] = "thread";
}





// Jump to the unread posts.
if($mybb->input['action'] == "newpost")
{

// Jump to the unread posts.
if($mybb->input['action'] == "newpost")
{

Zeile 244Zeile 235
			if($thread_read)
{
$lastread = $thread_read;

			if($thread_read)
{
$lastread = $thread_read;

			}

			}

			else
{
// Set $lastread to zero to make sure 'lastpost' is invoked in the last IF

			else
{
// Set $lastread to zero to make sure 'lastpost' is invoked in the last IF

Zeile 259Zeile 250
		if($readcookie > $forum_read)
{
$lastread = $readcookie;

		if($readcookie > $forum_read)
{
$lastread = $readcookie;

		}

		}

		else
{
$lastread = $forum_read;
}
}

		else
{
$lastread = $forum_read;
}
}

	

	

   if($cutoff && $lastread < $cutoff)
{
$lastread = $cutoff;
}

// Next, find the proper pid to link to.

   if($cutoff && $lastread < $cutoff)
{
$lastread = $cutoff;
}

// Next, find the proper pid to link to.

	$options = array(
"limit_start" => 0,
"limit" => 1,

	$options = array(
"limit_start" => 0,
"limit" => 1,

		"order_by" => "dateline",
"order_dir" => "asc"
);

$lastread = intval($lastread);

		"order_by" => "dateline",
"order_dir" => "asc"
);

$lastread = intval($lastread);

	$query = $db->simple_select("posts", "pid", "tid='{$tid}' AND dateline > '{$lastread}'", $options);

	$query = $db->simple_select("posts", "pid", "tid='{$tid}' AND dateline > '{$lastread}' {$visibleonly}", $options);

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

if($newpost['pid'] && $lastread)

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

if($newpost['pid'] && $lastread)

Zeile 315Zeile 306
			SELECT p.pid
FROM ".TABLE_PREFIX."posts p
LEFT JOIN ".TABLE_PREFIX."threads t ON(p.tid=t.tid)

			SELECT p.pid
FROM ".TABLE_PREFIX."posts p
LEFT JOIN ".TABLE_PREFIX."threads t ON(p.tid=t.tid)

			WHERE t.fid='".$thread['fid']."' AND t.closed NOT LIKE 'moved|%'

			WHERE t.fid='".$thread['fid']."' AND t.closed NOT LIKE 'moved|%' {$visibleonly2}

			ORDER BY p.dateline DESC
LIMIT 1
");

			ORDER BY p.dateline DESC
LIMIT 1
");

Zeile 329Zeile 320
			'limit_start' => 0,
'limit' => 1
);

			'limit_start' => 0,
'limit' => 1
);

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

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

		$pid = $db->fetch_field($query, "pid");
}
header("Location: ".htmlspecialchars_decode(get_post_link($pid, $tid))."#pid{$pid}");

		$pid = $db->fetch_field($query, "pid");
}
header("Location: ".htmlspecialchars_decode(get_post_link($pid, $tid))."#pid{$pid}");

Zeile 338Zeile 329

// Jump to the next newest posts.
if($mybb->input['action'] == "nextnewest")


// Jump to the next newest posts.
if($mybb->input['action'] == "nextnewest")

{
$options = array(
"limit_start" => 0,

{
$options = array(
"limit_start" => 0,

		"limit" => 1,
"order_by" => "lastpost"

		"limit" => 1,
"order_by" => "lastpost"

	);
$query = $db->simple_select('threads', '*', "fid={$thread['fid']} AND lastpost > {$thread['lastpost']} AND visible=1 AND closed NOT LIKE 'moved|%'", $options);

	);
$query = $db->simple_select('threads', '*', "fid={$thread['fid']} AND lastpost > {$thread['lastpost']} {$visibleonly} AND closed NOT LIKE 'moved|%'", $options);

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

// Are there actually next newest posts?
if(!$nextthread['tid'])
{
error($lang->error_nonextnewest);

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

// Are there actually next newest posts?
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);

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





	// Redirect to the proper page.
$pid = $db->fetch_field($query, "pid");
header("Location: ".htmlspecialchars_decode(get_post_link($pid, $nextthread['tid']))."#pid{$pid}");

	// Redirect to the proper page.
$pid = $db->fetch_field($query, "pid");
header("Location: ".htmlspecialchars_decode(get_post_link($pid, $nextthread['tid']))."#pid{$pid}");

Zeile 373Zeile 364
		"limit" => 1,
"limit_start" => 0,
"order_by" => "lastpost",

		"limit" => 1,
"limit_start" => 0,
"order_by" => "lastpost",

		"order_dir" => "desc"

		"order_dir" => "desc"

	);

	);

	$query = $db->simple_select("threads", "*", "fid=".$thread['fid']." AND lastpost < ".$thread['lastpost']." AND visible=1 AND closed NOT LIKE 'moved|%'", $options);

	$query = $db->simple_select("threads", "*", "fid=".$thread['fid']." AND lastpost < ".$thread['lastpost']." {$visibleonly} AND closed NOT LIKE 'moved|%'", $options);

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

// Are there actually next oldest posts?

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

// Are there actually next oldest posts?

Zeile 390Zeile 381
		"order_dir" => "desc"
);
$query = $db->simple_select("posts", "pid", "tid='".$nextthread['tid']."'", $options);

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





	// Redirect to the proper page.
$pid = $db->fetch_field($query, "pid");
header("Location: ".htmlspecialchars_decode(get_post_link($pid, $nextthread['tid']))."#pid{$pid}");

	// Redirect to the proper page.
$pid = $db->fetch_field($query, "pid");
header("Location: ".htmlspecialchars_decode(get_post_link($pid, $nextthread['tid']))."#pid{$pid}");

Zeile 641Zeile 632
	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
{
$db->shutdown_query("UPDATE ".TABLE_PREFIX."threads SET views=views+1 WHERE tid='{$tid}'");

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

Zeile 650Zeile 641

// Work out the thread rating for this thread.
$rating = '';


// Work out the thread rating for this thread.
$rating = '';

	if($forum['allowtratings'] != 0)

	if($mybb->settings['allowthreadratings'] != 0 && $forum['allowtratings'] != 0)

	{
$rated = 0;
$lang->load("ratethread");

	{
$rated = 0;
$lang->load("ratethread");

Zeile 990Zeile 981
					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 AND ts_rank_cd(to_tsvector('english',t.subject), query ) >= '{$mybb->settings['similarityrating']}'

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

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

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

Zeile 1105Zeile 1096
	// If the user is a moderator, show the moderation tools.
if($ismod)
{

	// If the user is a moderator, show the moderation tools.
if($ismod)
{

		if($forum_stats[-1]['modtools'] || $forum_stats[$forum['fid']]['modtools'])



		$customthreadtools = $customposttools = '';

if(is_moderator($forum['fid'], "canusecustomtools") && ($forum_stats[-1]['modtools'] || $forum_stats[$forum['fid']]['modtools']))

		{

		{

			$customthreadtools = $customposttools = '';


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

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

Zeile 1118Zeile 1109
				default:
$query = $db->simple_select("modtools", "tid, name, type", "CONCAT(',',forums,',') LIKE '%,$fid,%' OR CONCAT(',',forums,',') LIKE '%,-1,%' OR forums=''");
}

				default:
$query = $db->simple_select("modtools", "tid, name, type", "CONCAT(',',forums,',') LIKE '%,$fid,%' OR CONCAT(',',forums,',') LIKE '%,-1,%' OR forums=''");
}

		

	

			while($tool = $db->fetch_array($query))
{
if($tool['type'] == 'p')

			while($tool = $db->fetch_array($query))
{
if($tool['type'] == 'p')

Zeile 1136Zeile 1127
			{
eval("\$customposttools = \"".$templates->get("showthread_inlinemoderation_custom")."\";");
}

			{
eval("\$customposttools = \"".$templates->get("showthread_inlinemoderation_custom")."\";");
}

		}

		}


eval("\$inlinemod = \"".$templates->get("showthread_inlinemoderation")."\";");



eval("\$inlinemod = \"".$templates->get("showthread_inlinemoderation")."\";");


Zeile 1145Zeile 1136
		{
eval("\$customthreadtools = \"".$templates->get("showthread_moderationoptions_custom")."\";");
}

		{
eval("\$customthreadtools = \"".$templates->get("showthread_moderationoptions_custom")."\";");
}

 


		eval("\$moderationoptions = \"".$templates->get("showthread_moderationoptions")."\";");
}

		eval("\$moderationoptions = \"".$templates->get("showthread_moderationoptions")."\";");
}

 


	$lang->newthread_in = $lang->sprintf($lang->newthread_in, $forum['name']);

// Subscription status

	$lang->newthread_in = $lang->sprintf($lang->newthread_in, $forum['name']);

// Subscription status