Vergleich showthread.php - 1.6.10 - 1.6.12

  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 50Zeile 50

// Get the thread details from the database.
$thread = get_thread($mybb->input['tid']);


// Get the thread details from the database.
$thread = get_thread($mybb->input['tid']);

 

if(!$thread || substr($thread['closed'], 0, 6) == "moved|")
{
error($lang->error_invalidthread);
}


// Get thread prefix if there is one.
$thread['threadprefix'] = '';


// Get thread prefix if there is one.
$thread['threadprefix'] = '';

Zeile 65Zeile 70
	}
}


	}
}


if(substr($thread['closed'], 0, 6) == "moved|")




$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)

{

{

	$thread['tid'] = 0;

	$reply_subject = my_substr($reply_subject, 0, 82).'...';

}

}


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

$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['visible'] != 1 && $ismod == false) || ($thread['visible'] > 1 && $ismod == true))

{
error($lang->error_invalidthread);

{
error($lang->error_invalidthread);

}

$forumpermissions = forum_permissions($thread['fid']);

}

$forumpermissions = forum_permissions($thread['fid']);


// Does the user have permission to view this thread?
if($forumpermissions['canview'] != 1 || $forumpermissions['canviewthreads'] != 1)


// Does the user have permission to view this thread?
if($forumpermissions['canview'] != 1 || $forumpermissions['canviewthreads'] != 1)

{
error_no_permission();

{
error_no_permission();

}

if(isset($forumpermissions['canonlyviewownthreads']) && $forumpermissions['canonlyviewownthreads'] == 1 && $thread['uid'] != $mybb->user['uid'])
{
error_no_permission();

}

if(isset($forumpermissions['canonlyviewownthreads']) && $forumpermissions['canonlyviewownthreads'] == 1 && $thread['uid'] != $mybb->user['uid'])
{
error_no_permission();

}

}


$archive_url = build_archive_link("thread", $tid);



$archive_url = build_archive_link("thread", $tid);


Zeile 147Zeile 154
		if($forum_read == 0 || $forum_read < $read_cutoff)
{
$forum_read = $read_cutoff;

		if($forum_read == 0 || $forum_read < $read_cutoff)
{
$forum_read = $read_cutoff;

		}
}
else
{

		}
}
else
{

		$forum_read = intval(my_get_array_cookie("forumread", $fid));
}


		$forum_read = intval(my_get_array_cookie("forumread", $fid));
}


Zeile 162Zeile 169
			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 246Zeile 253
			'order_dir' => 'desc',
'limit_start' => 0,
'limit' => 1

			'order_dir' => 'desc',
'limit_start' => 0,
'limit' => 1

		);

		);

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

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

Zeile 726Zeile 733

// Threaded or linear display?
if($mybb->input['mode'] == 'threaded')


// Threaded or linear display?
if($mybb->input['mode'] == 'threaded')

	{

	{

		$isfirst = 1;

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

		$isfirst = 1;

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

		{

		{

			$where = "AND p.pid='".$mybb->input['pid']."'";
}
else
{
$where = " ORDER BY dateline LIMIT 0, 1";

			$where = "AND p.pid='".$mybb->input['pid']."'";
}
else
{
$where = " ORDER BY dateline LIMIT 0, 1";

		}
$query = $db->query("

		}
$query = $db->query("

			SELECT u.*, u.username AS userusername, p.*, f.*, eu.username AS editusername
FROM ".TABLE_PREFIX."posts p
LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid=p.uid)

			SELECT u.*, u.username AS userusername, p.*, f.*, eu.username AS editusername
FROM ".TABLE_PREFIX."posts p
LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid=p.uid)

Zeile 750Zeile 757

// Choose what pid to display.
if(!$mybb->input['pid'])


// Choose what pid to display.
if(!$mybb->input['pid'])

		{

		{

			$mybb->input['pid'] = $showpost['pid'];
}


			$mybb->input['pid'] = $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);