miniBB ® miniBB®
miniBB Support Forums
 | Forums | Register | Reply | Search | Statistics | Manual |
Custom Tutorials and Modifications miniBB Support Forums / Custom Tutorials and Modifications /   

Guests should not be able to even view the forums / Disable viewing of /hide forums unless logged in

Page  Page 2 of 2:  « Previous  1  2  
Author Paul
Lead Developer
#16 | Posted: 27 Feb 2008 05:03 | Edited by: Paul 
What I could say these solutions should work with 2.2 as much as any other previous 2.x version. I've just tried them with my local version and everything works. The only thing you need to carry on is to enable $startPageModern=FALSE; dynamically if the user is not logged in. I've fixed the code above.

The only difference is in HTML code provided in my post #13 above, I have fixed that too.

Extra restrictions: it should work by the following code:

$clForums=array(1,2,3,4,5,6,7,8,9);
$clForumsUsers=array();
foreach($clForums as $k) $clForumsUsers[$k]=array();
$clForumsUsers[2]=array(2);


i.e. you should not define $clForums twice.

Then addition to the code above will be (pasted in lang.pack):

if(!isset($clForums)) $clForums=array();
if(isset($user_id) and $user_id!=0) {
foreach($clForums as $k) {
if(sizeof($clForumsUsers[$k])==0 and !in_array($user_id, $clForumsUsers[$k])) $clForumsUsers[$k][]=$user_id;
}
}
else $startPageModern=FALSE;


I tested it on my side and it 100% works.

Anyway... these solutions appear to me like you are trying to use a can opener for closing the can. We are creating the thing which is opened from everybody - you are trying to close it from everybody instead of choosing the thing which is already created for such goal. Strange world.

Author Sir Igor
Guest
#17 | Posted: 27 Feb 2008 11:09 
Works perfectly well!

Page  Page 2 of 2:  « Previous  1  2 
Custom Tutorials and Modifications miniBB Support Forums / Custom Tutorials and Modifications / Guests should not be able to even view the forums / Disable viewing of /hide forums unless logged in Top

Your Reply Click this icon to move up to the quoted message

 Short link for this topic:

 ?
Only registered users are allowed to post here. Please, enter your username/password details upon posting a message, or register first.


Before posting, make sure your message is compliant with our forum posting rules. If not, it may be locked or deleted with no explanation.
 
 
miniBB Support Forums Powered by Forum Software miniBB ® Features  Requirements  Demo  Download  Showcase  Gallery of Arts
Compiler  Premium Extensions  Premium Support  License  Contacts
Proceed with the Captcha add-on: protect your miniBB-forums from the automated spam and flood.
Captcha Addon for miniBB