MyBB Community Forums

Full Version: Latest Posts on Profile (shows threads users shouldn’t see)
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
This plugin shows threads even if the user/usergroup does not have permission to see. Unsure how to fix and still no reply from plugin creator on the suggestions.

See here for more information: https://community.mybb.com/mods.php?acti...14&sid=151
What I had to do with my Recent Threads on Index plugin was have it do an immediate refresh of the threads because something about forum permissions causes issues.
This is the Latests Posts on Profile plugin by fizz.
There is code missing for forum permissions which Fizz needs to add.
I posted that some time ago but still no reply. Do you by chance know how to fix this? I can add the code in wherever it needs to go.
Find:
$tp = TABLE_PREFIX;

Add after:
	if($unviewable = get_unviewable_forums(true))
	{
		$exclude .= " AND t.fid NOT IN ($unviewable)";
	}
	if($inactive = get_inactive_forums())
	{
		$exclude .= " AND t.fid NOT IN ($inactive)";
	}
	$exclude .= " AND t.visible='1' AND t.closed NOT LIKE 'moved|%'";

This will ensure the thread is visible as well (not hidden/soft deleted) and it isn't a redirect (moved to another forum).
Only thing that is bad is the t.closed not LIKE 'moved|%' because it creates a full table scan. What I did was omit the t.closed part and just have it go to the correct thread using PHP. It's more efficient for the server that way.
How would your code be like ? Or you mean showing the redirects ?
By omitting the closed like in the query, if it is not handled correctly, the moved redirect thread will be listed twice.
Note that LIKE 'moved|%' has a prefix.
I will wait until a resolve that is correct to do this. Thanks for all the help everybody, I appreciate it, so I’ll just follow this thread until a resolve is given. Smile
Pages: 1 2