MyBB Community Forums

Full Version: Users can view their own unapproved posts
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Is there any way to enable this?
just to confirm :
do you want that original poster of the unapproved post should be able to see own post - BUT not others ?
I haven't tested it, but I believe this should work:

Open showthread.php and find:

// Work out if we are showing unapproved posts as well (if the user is a moderator etc.)
	
if($ismod)
{
	$visible = "AND (p.visible='0' OR p.visible='1')";
}
else
{
	$visible = "AND p.visible='1'";
}

Change it to:

// Work out if we are showing unapproved posts as well (if the user is a moderator etc.)
	
if($ismod || $mybb->user['uid'] == $post['uid'])
{
	$visible = "AND (p.visible='0' OR p.visible='1')";
}
else
{
	$visible = "AND p.visible='1'";
}
Thanks favious - I have been trying to figure this out for a while. However, I think that that adjustment would make it that all unapproved posts by a certain poster in a thread could be seen by the poster of the unapproved post(s). Is there any way to make it so that it is ONLY the first post that is affected by this edit?