MyBB Community Forums

Full Version: Make a page Visible to Guests?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
(2014-08-06, 11:31 PM)jshort Wrote: [ -> ]How exactly are you making your forum hidden to guests? Are you using the individual forum permissions or something else?

No, Not via individual forum permissions.
I am Doing it through Usergroup Settings

User & Groups > Groups > Guests > Forums and Posts

[Image: r3nJdr1.jpg]
^ if guests can view the board then they should be able to view the php pages (unless you put restrictions !)
Would it be the same letting the guests view the board, but not any forum in it?

ie checking "Can view board?" and then making every category/forum private
^ no need to change individual forum permissions unless specially required.

from the guests group permissions,
letting the guests view the board and not allowing to the forums, threads and other things
would provide them just a glance of your community. permission to view the board is required
as php pages are part of the board
(2014-08-06, 06:28 PM)RateU Wrote: [ -> ]
(2014-08-06, 05:22 PM)Alish1 Wrote: [ -> ]I have links set in header the links to the pages are visible to everyone but because my forum is visible only to Registered Members, when a guest click on example.php page the content of page is not viewable by guests. So my question is very simple how we can allow guests to view the contents of that example.php page.

You can add this kinds of code to your custom pages:
define('ALLOWABLE_PAGE','');

RateU is correct. You'll want to put that code before you include global.php. The relevant code in global.php is this, and as you can see, the Allowable_page variable is designed to do exactly what you're asking. If it isn't working, can you please post your custom page code here for us to look at?

if($mybb->usergroup['canview'] != 1)
{
	// Check pages allowable even when not allowed to view board
	if(defined("ALLOWABLE_PAGE"))
	{
		if(is_string(ALLOWABLE_PAGE))
		{
			$allowable_actions = explode(',', ALLOWABLE_PAGE);
			
			if(!in_array($mybb->input['action'], $allowable_actions))
			{
				error_no_permission();
			}
			
			unset($allowable_actions);
		}
		else if(ALLOWABLE_PAGE !== 1)
		{
			error_no_permission();
		}
	}
	else
	{
		error_no_permission();
	}
}
Pages: 1 2