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
hi

i have a forum which is only visible to registered members.
i made few pages with the help of http://community.mybb.com/thread-116225.html

Now i have a page example.php which i want guests users to see when they click on it, how do i allow guests to view a specific custom page?

the code for my example.php page is

<?php 

define('IN_MYBB', 1); require "./global.php";

add_breadcrumb("Example Page", "example.php"); 

eval("\$html = \"".$templates->get("example")."\";"); 

output_page($html);

?>


thanks
Include the link to the page somewhere in the forum Smile
marcus123

What do you mean by that?
Since this is a custom page it ain't included anywhere in the forum so it remains hidden from search engine and pretty much everyone!
To make it visible you have to add a link to it somewhere in your header, footer of in the forum.

<a href="{$mybb->settings['bburl']}/custompage.php">hello I am custom page</a>
(2014-08-06, 05:07 PM)marcus123 Wrote: [ -> ]Since this is a custom page it ain't included anywhere in the forum so it remains hidden from search engine and pretty much everyone!
To make it visible you have to add a link to it somewhere in your header, footer of in the forum.

<a href="{$mybb->settings['bburl']}/custompage.php">hello I am custom page</a>

I thought you might giving me some solution on how can i allow guests to view the contents of that page.

read my first post again please.

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.
Ok sorry for getting it wrong? Are you saying that you want to redirect guests trying to access that forum to some other location? If so you'll need a simple plugin!

You can use this plugin to make private forum

You can modify it to redirect anyone that doesn't have permission to view the forum to your custom page!
(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','');
Then you should not use:
eval("\$html = \"".$templates->get("example")."\";");

Instead add your HTML directly into custom page this way it should show. But it always depends on what are you trying to show? If you use some functions that require permission check then I don't think you will be able to do it?

However I believe that if you use a plugin I mentioned before it could be done since you are not setting forum permissions using Admin control panel.
Could be wrong just trying to help.
(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','');

Doesnt Work Sad

(2014-08-06, 08:09 PM)marcus123 Wrote: [ -> ]Then you should not use:
eval("\$html = \"".$templates->get("example")."\";");

Instead add your HTML directly into custom page this way it should show. But it always depends on what are you trying to show? If you use some functions that require permission check then I don't think you will be able to do it?

However I believe that if you use a plugin I mentioned before it could be done since you are not setting forum permissions using Admin control panel.
Could be wrong just trying to help.

I Tried But Its not working
How exactly are you making your forum hidden to guests? Are you using the individual forum permissions or something else?
Pages: 1 2