How return Login Page for Private Forum request?
-
I need show the login page when a non logged user tries enter a private forum.
-
if the forums private, the it won’t show to non-logged in users on the list.
How do you plan that non-logged in will navigate to this, as that may provide the solution.
ok, quick solution for you
This solution
-
uses the restrict content plugin to create a login prompt if the user is not logged in
-
sets the forums to private so that they are not seen on the main index
-
creates a page just for that private forum, which the restrict content plugin can then use to display the need to be logged in message and login boxes
It does rely on you setting your users to at least wordpress subscriber level – as the plugin only works on wordpress levels, but that should be fine for most uses.
1.Install “restrict content” plugin
Dashboard>plugins>add new
search for “Restrict Content” and it’s then one called just that
Install and activate
2. go into dashboard>settings>restrict content and add the following text (you can tailor it to say what you want) to all the options
Sorry, you need to be a member to see this area. Login if needbe [bbp-login]
3. Go into Dashboard>forums>whichever forum and change to visibility ‘private’. This will stop thisn forum being seen in the main index unless logged in, so we’ll need to add a menu item later on so not logged in users can see it
4. Find out the ID of the forum you have set to private
This link shows you how
http://www.authorcode.com/forums/topic/how-to-get-forum-id-in-bbpress/
5. Create a new page called whatever eg “free speech forum”
and put the following code into it
[bbp-single-forum id=2922] where the id number is the number that you found out in 4. above
6. Within this page you’ll also see below the main text you’ve just entered a new box called “restrict content” set this to subscriber (or higher if you’re really restricting).
7. add this page to your menu’s if need beIf a user is logged in, and sleects the menu item, they’ll just go straight into the forum.
If they are not logged in and select the menu item, they’ll get the message you set up in 2. above together with the login boxes and having logged in will see the forum
give it a go, and come back if anything is not clear
This method is working fine when linking to a specific page to access a private forum, but I cannot see how to force a logon to anyone using a link from one of the general subscription emails. These seem to be in the form //site_address//forums/topic/topic_name and are generated automatically when an update is made to a topic.
I can edit the 404 page to give a login message, but, I think that by then the originally requested page address has been lost.
Thanks
Fionaagree to @FionaTreveil
Plug in is not that usefull for a simple case (@robin-w):someone who is logged in shares the URL of the restricted page (forum/topic/reply) and sends this URL to someone who is not innitially logged and lands in a specific page instead of the forum-archive-page. And so, instead of showing some page ‘restricted_content’ as ur suggested plug-in would, the bbpress redirects user to 404.
I would suggest that a new page is needed in bbpress plug in for such a case and the 404 should not be edited.
- You must be logged in to reply to this topic.