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?
You are not logged in. Please login or register.
PunBB Forums → PunBB 1.2 discussion → 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?
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
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
if you want the page to be inside of the punbb directory.... forum/yourpage.php
or /yourpage.php outside of punbb
Q
Thank you all, I will attempt this next week (fingers crossed).
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.
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
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");
?>
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.
PunBB Forums → PunBB 1.2 discussion → How do I make a page for members only
Powered by PunBB, supported by Informer Technologies, Inc.