Vergleich printthread.php - 1.8.10 - 1.8.30

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

$thread = get_thread($mybb->get_input('tid', MyBB::INPUT_INT));



$thread = get_thread($mybb->get_input('tid', MyBB::INPUT_INT));


if(!$thread)

if(!$thread || $thread['visible'] == -1)

{
error($lang->error_invalidthread);
}

{
error($lang->error_invalidthread);
}

Zeile 132Zeile 132
{
$visible = "AND p.visible='1'";
}

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

 

$postrow_cache = $attachcache = array();


$query = $db->query("
SELECT u.*, u.username AS userusername, p.*
FROM ".TABLE_PREFIX."posts p
LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid=p.uid)
WHERE p.tid='$tid' {$visible}

$query = $db->query("
SELECT u.*, u.username AS userusername, p.*
FROM ".TABLE_PREFIX."posts p
LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid=p.uid)
WHERE p.tid='$tid' {$visible}

	ORDER BY p.dateline

	ORDER BY p.dateline, p.pid

	LIMIT {$start}, {$perpage}
");

	LIMIT {$start}, {$perpage}
");

 


while($postrow = $db->fetch_array($query))

while($postrow = $db->fetch_array($query))

 
{
$postrow_cache[$postrow['pid']] = $postrow;
}

$postrow_cache = array_filter($postrow_cache);

$pids = implode("','", array_keys($postrow_cache));

// Get the attachments for all posst.
if($mybb->settings['enableattachments'])
{
$queryAttachments = $db->simple_select("attachments", "*", "pid IN ('{$pids}')");

while($attachment = $db->fetch_array($queryAttachments))
{
$attachcache[$attachment['pid']][$attachment['aid']] = $attachment;
}
}

foreach($postrow_cache as $postrow)

{
$parser_options = array(
"allow_html" => $forum['allowhtml'],

{
$parser_options = array(
"allow_html" => $forum['allowhtml'],

Zeile 153Zeile 177
		"filter_badwords" => 1
);
if($postrow['smilieoff'] == 1)

		"filter_badwords" => 1
);
if($postrow['smilieoff'] == 1)

	{

	{

		$parser_options['allow_smilies'] = 0;
}


		$parser_options['allow_smilies'] = 0;
}


	if($mybb->user['showimages'] != 1 && $mybb->user['uid'] != 0 || $mybb->settings['guestimages'] != 1 && $mybb->user['uid'] == 0)

	if($mybb->user['uid'] != 0 && $mybb->user['showimages'] != 1 || $mybb->settings['guestimages'] != 1 && $mybb->user['uid'] == 0)

	{
$parser_options['allow_imgcode'] = 0;

	{
$parser_options['allow_imgcode'] = 0;

	}

if($mybb->user['showvideos'] != 1 && $mybb->user['uid'] != 0 || $mybb->settings['guestvideos'] != 1 && $mybb->user['uid'] == 0)

	}

if($mybb->user['uid'] != 0 && $mybb->user['showvideos'] != 1 || $mybb->settings['guestvideos'] != 1 && $mybb->user['uid'] == 0)

	{
$parser_options['allow_videocode'] = 0;

	{
$parser_options['allow_videocode'] = 0;

	}


	}


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

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

Zeile 177Zeile 201
	$postrow['profilelink'] = build_profile_link($postrow['username'], $postrow['uid']);

$postrow['message'] = $parser->parse_message($postrow['message'], $parser_options);

	$postrow['profilelink'] = build_profile_link($postrow['username'], $postrow['uid']);

$postrow['message'] = $parser->parse_message($postrow['message'], $parser_options);

 

if($mybb->settings['enableattachments'] == 1 && !empty($attachcache[$postrow['pid']]) && $thread['attachmentcount'] > 0 || is_moderator($fid, 'caneditposts'))
{
get_post_attachments($postrow['pid'], $postrow);
}


	$plugins->run_hooks("printthread_post");
eval("\$postrows .= \"".$templates->get("printthread_post")."\";");
}

	$plugins->run_hooks("printthread_post");
eval("\$postrows .= \"".$templates->get("printthread_post")."\";");
}