miniBB ®

miniBB

®
Support Forums
  
 · Start · Sign in · 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:03Reply Quote
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:02Reply Quote
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:06Reply Quote
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:42Reply Quote
Thank you! (and please check your email ;)

Author helmet
Guest
#5 · Posted: 25 Feb 2008 13:46Reply Quote
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 Lead Developer
#6 · Posted: 25 Feb 2008 14:31Reply Quote
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:20Reply Quote
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:40Reply Quote
The addon provided above works (and should work).

Author Paul
Lead Lead Developer
#9 · Posted: 26 Feb 2008 03:39Reply Quote
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:19Reply Quote
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 Lead Developer
#11 · Posted: 25 Mar 2008 05:36Reply Quote

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

BB code for the Bold StyleBB code for the Italic StyleBB Code for the PictureBB code for the URLUpload a File

  ?
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
Get the Private Messaging add-on: allow your miniBB-forums members to communicate with each other.