MyBB Community Forums

Full Version: Guests cant view threads, but allow certain area?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I have the GCVT plug in on my forum - http://www.phoenixsupras.net

I want un-registered people to be able to see the forum sections - which they can.
And the threads - which they can.

I don't want them to see the posts in the threads - which they can not.

I do have a one area of the forum that I do want them to be able to see inside the threads. How can I achieve this??

This is the code for the plug in below. Or would it be achieved in a different way?!?



<?php
$plugins->add_hook('showthread_start', 'gcvt_thread');
$plugins->add_hook('archive_thread_start', 'gcvt_thread');

function gcvt_info()
{
	return array(
		'name'			=> 'Guests Can\'t View Threads',
		'description'	=> 'Guests cannot view threads.',
		'website'		=> 'http://mybbplug.in/',
		'author'		=> 'Jammerx2',
		'authorsite'	=> 'http://mybbplug.in/',
		'version'		=> '1.1',
		'guid'        => '8ac34edb831b6a420c48602ed5384b59'
	);
}

function gcvt_activate()
{
}

function gcvt_deactivate()
{
}
function gcvt_thread()
{
	global $db, $mybb,$lang, $thread;

                	if($mybb->user['uid'] == 0)
                	{
                    	error("<center>You must be logged into the forum in order to view the thread.<br /><br /><a href='member.php?action=register'>Register</a> or <a href='/member.php?action=login'>Log in</a></center>  ","Error");
                	}
		
		
	
	$lang->send_thread = "";
}
?>
Bump.

Anyone able to give me some direction on this?
Bump.
This is very useful so I hope it's possible maybe with a short code that can be added by a group in the text editor. Allowing for that content inside the code to be displayed to guests.
go to the admincp> forums and post> forum management>

select the forum that you want to select. > Edit forum settings> Forum Permissions> guest> Set Custom Permissions.

viewing> Can view forums? : Remove the checklist
That doesn't work.

That allows them to either see the forums or not.

I want them to be able to see in the forums and see the thread titles but if they click the thread they can't see it (as what happens now with the guests can't view thread plugin).

There is one area (for example, the photos section) that I do want them to be able to see inside the threads. Would it be through the plugin that we manipulate it. Or another way?
That particular plugin makes it so guests cannot view threads; it uses no queries as far as I can tell.

In order to specify the forum you want to be visible then it will need to query the db - on every load of forumdisplay.php and/or showthread. That will be a lot of hits to DB on a busy forum.