Vergleich showthread.php - 1.6.10 - 1.6.11

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

require_once "./global.php";
require_once MYBB_ROOT."inc/functions_post.php";


require_once "./global.php";
require_once MYBB_ROOT."inc/functions_post.php";

require_once MYBB_ROOT."/inc/functions_indicators.php";

require_once MYBB_ROOT."inc/functions_indicators.php";

require_once MYBB_ROOT."inc/class_parser.php";
$parser = new postParser;


require_once MYBB_ROOT."inc/class_parser.php";
$parser = new postParser;


Zeile 70Zeile 70
	$thread['tid'] = 0;
}


	$thread['tid'] = 0;
}


$thread['subject'] = htmlspecialchars_uni($parser->parse_badwords($thread['subject']));








$reply_subject = $parser->parse_badwords($thread['subject']);
$thread['subject'] = htmlspecialchars_uni($reply_subject);
// Subject too long? Shorten it to avoid error message
if(my_strlen($reply_subject) > 85)
{
$reply_subject = my_substr($reply_subject, 0, 82).'...';
}
$reply_subject = htmlspecialchars_uni($reply_subject);

$tid = $thread['tid'];
$fid = $thread['fid'];


$tid = $thread['tid'];
$fid = $thread['fid'];


Zeile 95Zeile 102
}

// Make sure we are looking at a real thread here.

}

// Make sure we are looking at a real thread here.

if(!$thread['tid'] || ($thread['visible'] == 0 && $ismod == false) || ($thread['visible'] > 1 && $ismod == true))

if(!$thread || ($thread['visible'] != 1 && $ismod == false) || ($thread['visible'] > 1 && $ismod == true))

{
error($lang->error_invalidthread);
}

{
error($lang->error_invalidthread);
}

Zeile 256Zeile 263

// 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,
"limit" => 1,

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

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

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

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

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

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

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

		"limit" => 1,
"order_by" => "dateline",
"order_dir" => "desc"
);
$query = $db->simple_select('posts', 'pid', "tid='{$nextthread['tid']}'", $options);

		"limit" => 1,
"order_by" => "dateline",
"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}");
exit;
}



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


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

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

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

	);
$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?
if(!$nextthread['tid'])
{

	// Are there actually next oldest posts?
if(!$nextthread['tid'])
{

Zeile 330Zeile 337
	if(!$mybb->settings['threadsperpage'])
{
$mybb->settings['threadsperpage'] = 20;

	if(!$mybb->settings['threadsperpage'])
{
$mybb->settings['threadsperpage'] = 20;

	}

	}


$query = $db->simple_select("forums", "threads, unapprovedthreads", "fid = '{$fid}'", array('limit' => 1));
$forum_threads = $db->fetch_array($query);


$query = $db->simple_select("forums", "threads, unapprovedthreads", "fid = '{$fid}'", array('limit' => 1));
$forum_threads = $db->fetch_array($query);

Zeile 353Zeile 360

// If we have 0 threads double check there aren't any "moved" threads
if($threadcount == 0)


// If we have 0 threads double check there aren't any "moved" threads
if($threadcount == 0)

	{

	{

		$query = $db->simple_select("threads", "COUNT(tid) AS threads", "fid = '$fid' $visibleonly $uid_only", array('limit' => 1));
$threadcount = $db->fetch_field($query, "threads");
}

		$query = $db->simple_select("threads", "COUNT(tid) AS threads", "fid = '$fid' $visibleonly $uid_only", array('limit' => 1));
$threadcount = $db->fetch_field($query, "threads");
}

Zeile 540Zeile 547
				}
}
else

				}
}
else

			{

			{

				$pollstatus = $lang->poll_closed;
}
$lang->total_votes = $lang->sprintf($lang->total_votes, $totalvotes);

				$pollstatus = $lang->poll_closed;
}
$lang->total_votes = $lang->sprintf($lang->total_votes, $totalvotes);

Zeile 576Zeile 583

// Mark this thread as read
mark_thread_read($tid, $fid);


// Mark this thread as read
mark_thread_read($tid, $fid);





	// If the forum is not open, show closed newreply button unless the user is a moderator of this forum.
if($forum['open'] != 0)
{

	// If the forum is not open, show closed newreply button unless the user is a moderator of this forum.
if($forum['open'] != 0)
{

Zeile 586Zeile 593
		if($thread['closed'] == 1)
{
eval("\$newreply = \"".$templates->get("showthread_newreply_closed")."\";");

		if($thread['closed'] == 1)
{
eval("\$newreply = \"".$templates->get("showthread_newreply_closed")."\";");

		}
else

		}
else

		{
eval("\$newreply = \"".$templates->get("showthread_newreply")."\";");
}
}

		{
eval("\$newreply = \"".$templates->get("showthread_newreply")."\";");
}
}





	// Create the admin tools dropdown box.
if($ismod == true)
{
$adminpolloptions = $closelinkch = $stickch = '';

if($pollbox)

	// Create the admin tools dropdown box.
if($ismod == true)
{
$adminpolloptions = $closelinkch = $stickch = '';

if($pollbox)

		{

		{

			$adminpolloptions = "<option value=\"deletepoll\">".$lang->delete_poll."</option>";

			$adminpolloptions = "<option value=\"deletepoll\">".$lang->delete_poll."</option>";

		}

		}

		if($thread['visible'] != 1)
{
$approveunapprovethread = "<option value=\"approvethread\">".$lang->approve_thread."</option>";

		if($thread['visible'] != 1)
{
$approveunapprovethread = "<option value=\"approvethread\">".$lang->approve_thread."</option>";

		}

		}

		else
{
$approveunapprovethread = "<option value=\"unapprovethread\">".$lang->unapprove_thread."</option>";
}
if($thread['closed'] == 1)

		else
{
$approveunapprovethread = "<option value=\"unapprovethread\">".$lang->unapprove_thread."</option>";
}
if($thread['closed'] == 1)

		{

		{

			$closelinkch = ' checked="checked"';

			$closelinkch = ' checked="checked"';

		}

		}

		if($thread['sticky'])
{
$stickch = ' checked="checked"';

		if($thread['sticky'])
{
$stickch = ' checked="checked"';

Zeile 623Zeile 630
		$inlinecount = "0";
$inlinecookie = "inlinemod_thread".$tid;
$plugins->run_hooks("showthread_ismod");

		$inlinecount = "0";
$inlinecookie = "inlinemod_thread".$tid;
$plugins->run_hooks("showthread_ismod");

	}

	}

	else

	else

	{

	{

		$modoptions = "&nbsp;";
$inlinemod = "";
}

		$modoptions = "&nbsp;";
$inlinemod = "";
}

Zeile 634Zeile 641
	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 658Zeile 665
			$thread['averagerating'] = floatval(round($thread['totalratings']/$thread['numratings'], 2));
$thread['width'] = intval(round($thread['averagerating']))*20;
$thread['numratings'] = intval($thread['numratings']);

			$thread['averagerating'] = floatval(round($thread['totalratings']/$thread['numratings'], 2));
$thread['width'] = intval(round($thread['averagerating']))*20;
$thread['numratings'] = intval($thread['numratings']);

		}

		}


if($thread['numratings'])
{


if($thread['numratings'])
{

Zeile 670Zeile 677

$not_rated = '';
if(!$rated)


$not_rated = '';
if(!$rated)

		{

		{

			$not_rated = ' star_rating_notrated';
}


			$not_rated = ' star_rating_notrated';
}


Zeile 681Zeile 688
	if($ismod)
{
$visible = "AND (p.visible='0' OR p.visible='1')";

	if($ismod)
{
$visible = "AND (p.visible='0' OR p.visible='1')";

	}

	}

	else
{
$visible = "AND p.visible='1'";

	else
{
$visible = "AND p.visible='1'";

Zeile 728Zeile 735
	if($mybb->input['mode'] == 'threaded')
{
$isfirst = 1;

	if($mybb->input['mode'] == 'threaded')
{
$isfirst = 1;





		// Are we linked to a specific pid?
if($mybb->input['pid'])
{

		// Are we linked to a specific pid?
if($mybb->input['pid'])
{

Zeile 752Zeile 759
		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 761Zeile 768
		}

$attachcache = array();

		}

$attachcache = array();

		if($thread['attachmentcount'] > 0)

		if($thread['attachmentcount'] > 0 || is_moderator($fid, 'caneditposts'))

		{
// Get the attachments for this post.
$query = $db->simple_select("attachments", "*", "pid=".$mybb->input['pid']);

		{
// Get the attachments for this post.
$query = $db->simple_select("attachments", "*", "pid=".$mybb->input['pid']);

Zeile 817Zeile 824
		if(!empty($mybb->input['pid']))
{
$post = get_post($mybb->input['pid']);

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

			$query = $db->query("
SELECT COUNT(p.dateline) AS count FROM ".TABLE_PREFIX."posts p
WHERE p.tid = '{$tid}'
AND p.dateline <= '{$post['dateline']}'
{$visible}
");
$result = $db->fetch_field($query, "count");
if(($result % $perpage) == 0)

			if($post)








			{

			{

				$page = $result / $perpage;
}
else
{
$page = intval($result / $perpage) + 1;











				$query = $db->query("
SELECT COUNT(p.dateline) AS count FROM ".TABLE_PREFIX."posts p
WHERE p.tid = '{$tid}'
AND p.dateline <= '{$post['dateline']}'
{$visible}
");
$result = $db->fetch_field($query, "count");
if(($result % $perpage) == 0)
{
$page = $result / $perpage;
}
else
{
$page = intval($result / $perpage) + 1;
}

			}
}


			}
}


Zeile 948Zeile 958
			$pids = "pid IN($pids)";

$attachcache = array();

			$pids = "pid IN($pids)";

$attachcache = array();

			if($thread['attachmentcount'] > 0)

			if($thread['attachmentcount'] > 0 || is_moderator($fid, 'caneditposts'))

			{
// Now lets fetch all of the attachments for these posts.
$query = $db->simple_select("attachments", "*", $pids);

			{
// Now lets fetch all of the attachments for these posts.
$query = $db->simple_select("attachments", "*", $pids);