miniBB ® 

miniBB

®
Support Forums
  
 | Start | Register | Search | Statistics | File Bank | Manual |
Custom Tutorials and Modifications miniBB Support Forums / Custom Tutorials and Modifications /  
 

Hide a posting form from guests / anonymous users

 
Author Team
8-)
#1 | Posted: 3 Oct 2006 06:03 
Paste the code below at the end of your language pack (/lang/eng.php or whatever):

/* Hide form from anonymous users */
if($user_id==0 and ($action=='vthread' or $action=='vtopic')) {
$roForums[]=$forum;
$l_userFormWarning='Only registered users can make new postings on our forums. Log-in first on the start page, or <a href="'.$main_url.'/'.$indexphp.'action=registernew">register</a> first.';
}
else $l_userFormWarning='';
/* --Hide form from anonymous users */
{$l_userFormWarning} is the variable to paste in main_post_form.html. It should be displayed when form won't be available.

Author tom322
Guest
#2 | Posted: 26 Feb 2006 01:02 
3 Oct 2006 06:03 - Attached on merging:
Get rid of the post form for not logged-in users

If all users must register before posting - is it possible that the post form doesn't show up for not registered/logged-in users? Currently there's only a message "you must login/sign up before posting" - but it would be better that the posting form doesn't show up at all, I think.

Author Team
8-)
#3 | Posted: 27 Feb 2006 10:06 
Paste this snippet in bb_plugins.php and you should be done:

/* Hiding logging form from anonymous users */
if($forum!=0 and $user_id==0 and ($action=='vtopic' OR $action=='vthread')) $roForums[]=$forum;
/* --Hiding logging form from anonymous users */

Author tom322
Guest
#4 | Posted: 27 Feb 2006 19:42 
Thank you! (and please check your email ;)

Author helmet
Guest
#5 | Posted: 25 Feb 2008 13:46 
My admin user id is "1", and in testing I've noticed that this

/* Hiding logging form from anonymous users */
if($forum!=0 and $user_id==0 and ($action=='vtopic' OR $action=='vthread')) $roForums[]=$forum;
/* --Hiding logging form from anonymous users */

causes the reply form to be visible only to me. Any ideas?

Author Paul
Lead Developer 
#6 | Posted: 25 Feb 2008 14:31 
helmet: You as admin will always see this form. As well any registered user should see this form when he's logged in. Where's the confusion?

Have you set up any kind of closed forums?

Author helmet
Guest
#7 | Posted: 25 Feb 2008 15:20 
No closed forums, the only thing I was trying to do was hide the form from users who are not logged-in using the code above, but when I created another account to test, that person shows as logged in to the system but the form is not visible to them.

Author tom322
Active Member
#8 | Posted: 25 Feb 2008 16:40 
The addon provided above works (and should work).

Author Paul
Lead Developer 
#9 | Posted: 26 Feb 2008 03:39 
I've just tested this code and it definitely works, so I don't know where you did it wrong... maybe you have pasted it in bb_plugins2.php? It's the common mistake I've met.

Author eclipsme
Partaker
#10 | Posted: 23 Mar 2008 06:19 
Sorry to come to the party late, but I am just trying to configure this the way I want it, and the above is part of what I am looking at.

I have done these mods, and yes, they work. However, if a user that is not logged in clicks on 'search' and enters some valid text to search on, s/he will be able to read the post.

How can I make it so anybody not signed in can not see *anything* except the login fields and the 'sign up' button. It seems to me that this is what a 'closed' forum should do by default, but perhaps I am biased by my personal feature desires.

Harvey

Author Paul
Lead Developer 
#11 | Posted: 25 Mar 2008 05:36 

Custom Tutorials and Modifications miniBB Support Forums / Custom Tutorials and Modifications /
 Hide a posting form from guests / anonymous users
 Share Topic's Link

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


  ?
Post as a Guest, leaving the Password field blank. You could also enter a Guest name, if it's not taken by a member yet. Sign-in and post at once, or just sign-in, bypassing the message's text.


Before posting, make sure your message is compliant with forum rules; otherwise it could be locked or removed with no explanation.

 

 
miniBB Support Forums Powered by Forum Software miniBB ® Home  Features  Requirements  Demo  Download  Showcase  Gallery of Arts
Compiler  Premium Extensions  Premium Support  License  Contact Us
Try the Private Messaging add-on: allow your miniBB-forums members to communicate with each other.


  ⇑