Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[F] Printthread doesn't show unapproved posts [C-Michael83]
#1
Bug 
Hi developers,

xeniun (MyBBoard.it) found this bug, printthread.php doesn't show unapproved posts also if you have enough permissions.

This is also easily fixable. Smile

Find:
$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' AND p.visible=1
	ORDER BY p.dateline
");

Replace with:
if(is_moderator($fid))
{
	$visible = "AND (p.visible='0' OR p.visible='1')";
}
else
{
	$visible = "AND p.visible='1'";
}
$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
");
#2
Thank you for your bug report.

This bug has been fixed in our internal code repository. Please note that the problem will not be fixed here until these forums are updated.

With regards,
MyBB Group


Forum Jump:


Users browsing this thread: 1 Guest(s)