Topic: How do I make a page for members only

I have a html page that I wish to have linked along the top of the menu.
It has no forum data on the page. But I only want the 'members' of my forum to have access to it.
Is this possible?

Re: How do I make a page for members only

You need to do three things:

1) rename [whatever].htm to [whatever].php
2) add this or similar code right before the content of the page:

<?php

define('PUN_ROOT', './forums/');
require PUN_ROOT.'include/common.php';

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

?>

3) add the link to your top menu via the admin options

Looking for a certain modification for your forum? Please take a look here before posting.

Re: How do I make a page for members only

pogenwurst wrote:

You need to do three things:

1) rename [whatever].htm to [whatever].php
2) add this or similar code right before the content of the page:

<?php

define('PUN_ROOT', './forums/');
require PUN_ROOT.'include/common.php';

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

?>

3) add the link to your top menu via the admin options

dont you have to add

<?php
require PUN_ROOT.'footer.php';

to the end aswell

Sorry. Unactive due to personal life.

Re: How do I make a page for members only

if you want the page to be inside of the punbb directory.... forum/yourpage.php
or /yourpage.php outside of punbb

Q

My stuff or my style might sux, but atleast I'm willing to help when I can.
Don't be stupid and help ! We are the stupid one's !!!

Re: How do I make a page for members only

Thank you all, I will attempt this next week (fingers crossed).

Re: How do I make a page for members only

It worked very well,

it took me half an hour to realise my forums is a forum (spelling) and I needed two dots before it.

this ended up been the working code:
define('PUN_ROOT', '../forum/');

I now have a secure area on my site for my stock market game, thanks.

Re: How do I make a page for members only

So to continue with this making a secure page on my forums I would like the alternate
no permission page
to be something other than the current one:
http://www.stockmarketgame.biz/game/game.php
(which is a miss match of the forum menu (that doesn't work) and some text not in the style.

Is it possible to make it so that if the user is a guest it redirects them to
another page?

Thanks in advance

Re: How do I make a page for members only

Ignore that last question I now have it sorted.

To make the page go to a set page I used this for guests:

<?php

define('PUN_ROOT', '../forum/');
require PUN_ROOT.'include/common.php';

if($pun_user['is_guest'])
$URL="type URL here";
header ("Location: $URL");

?>

Re: How do I make a page for members only

Thanks to everyone for your help and please take the time to play the demo game here:
http://www.stockmarketgame.biz
and view my forum:
http://www.stockmarketgame.biz/forum/
All of which will develop over time.