Forums

Unfortunately no one can be told what FluxBB is - you have to see it for yourself.

You are not logged in.

#1 2013-05-06 03:20:52

j0hnnie
FluxBB Donor
Registered: 2010-05-21
Posts: 33

Making a page within forum

Hello,

I'd like to create a page on my website that has forum header, nav bar, footer, announcement, and whatever else to make it look like it is part of the site. I'd also like it to require the user to be logged in to visit the page.

I did this back in the punbb days I believe and it was simple, but I can't find any record of how I did it.

Any help is appreciated.

Thanks

Last edited by j0hnnie (2013-05-06 03:25:10)

Offline

#2 2013-05-06 19:31:07

cyberman
Member
From: Germany
Registered: 2010-01-11
Posts: 237
Website

Re: Making a page within forum

Do you mean something like this?

http://fluxbb.org/resources/mods/page-en-plus/

Offline

#3 2013-05-06 21:24:46

j0hnnie
FluxBB Donor
Registered: 2010-05-21
Posts: 33

Re: Making a page within forum

I believe this will work for me.

Thanks

EDIT: The pages the plugin creates do not require you to be logged in to view. Is there a way to require a person to be logged in? The page I intend to make has to be private from the public.

Last edited by j0hnnie (2013-05-06 21:27:19)

Offline

#4 2013-05-07 01:14:01

somdcomputerguy
Member
From: West Virginia - USA
Registered: 2013-01-30
Posts: 44
Website

Re: Making a page within forum

Put the page you want 'in' the forum by editing the iframe tag. Put a link to this file in Administration|Forums, with the filename in the Redirect URL field. Apply the correct permissions to enable a required login to access the page.

<?
/**
 * Copyright (C) 2008-2012 FluxBB
 * based on code by Rickard Andersson copyright (C) 2002-2008 PunBB
 * License: http://www.gnu.org/licenses/gpl.html GPL version 2 or higher
 */

define('PUN_ROOT', dirname(__FILE__).'/');
require PUN_ROOT.'include/common.php';
require PUN_ROOT.'header.php';
?>
<iframe src="path/to/page" width=100% height=800 FRAMEBORDER=0>
If you can see this, your browser doesn't understand IFRAME.
</iframe>
<?
require PUN_ROOT.'footer.php';
?>

Offline

#5 2013-05-07 03:20:56

j0hnnie
FluxBB Donor
Registered: 2010-05-21
Posts: 33

Re: Making a page within forum

somcomputerguy,

This error is displaying in the title of the page when I follow your instructions.

<title><br />
<b>Warning</b>:  array_reverse() expects parameter 1 to be array, null given in <b>/home/johste94/emresources.org/include/functions.php</b> on line <b>569</b><br />
<br />
<b>Warning</b>:  implode() [<a href='function.implode'>function.implode</a>]: Invalid arguments passed in <b>/home/johste94/emresources.org/include/functions.php</b> on line <b>574</b><br />
</title>

Thank you for your help.

Offline

#6 2013-05-07 06:13:26

Franz
Lead developer
From: Germany
Registered: 2008-05-13
Posts: 5,924
Website

Re: Making a page within forum

You need to set the $page_title variable to something like this before you include header.php.


fluxbb.de | develoPHP

"As code is more often read than written it's really important to write clean code."

Offline

#7 2013-05-07 14:26:03

j0hnnie
FluxBB Donor
Registered: 2010-05-21
Posts: 33

Re: Making a page within forum

Thanks Franz, I've resolved that issue now.

I am still having trouble with restricting access to my page. I know that I can make a forum to redirect to the link, and require login to see the the forum, but if someone had the link to the page, they would still be able to access it without logging into the forum.

I guess I'm looking for the code that I would need to add to the page itself to require someone to be logged in.

Thanks everyone for your help so far.

Offline

#8 2013-05-07 16:12:27

Franz
Lead developer
From: Germany
Registered: 2008-05-13
Posts: 5,924
Website

Re: Making a page within forum

After including common.php, you can achieve that like this:

if ($pun_user['is_guest'])
    message('No permission.');

Just make sure you do that before including header.php, though.


fluxbb.de | develoPHP

"As code is more often read than written it's really important to write clean code."

Offline

#9 2013-05-07 16:28:54

j0hnnie
FluxBB Donor
Registered: 2010-05-21
Posts: 33

Re: Making a page within forum

Thanks everyone for your help. I have resolved all issues. I really appreciate it.

Offline

#10 2013-05-07 19:16:19

somdcomputerguy
Member
From: West Virginia - USA
Registered: 2013-01-30
Posts: 44
Website

Re: Making a page within forum

Franz wrote:

After including common.php, you can achieve that like this:

if ($pun_user['is_guest'])
    message('No permission.');

Just make sure you do that before including header.php, though.

Ah, yes, I forgot to mention that I've also edited the file in the iframe src to have this code in it:

 <?
    define('PUN_ROOT', '../fluxbb/');
    include PUN_ROOT.'include/common.php';
    require PUN_ROOT.'header.php';
     
    if ($pun_user['is_guest'])
    {
    exit("To access the Member Site, one must login.");
    }
 ?>

Offline

Board footer

Powered by FluxBB 1.5.7