[2.0.15] Redirect anonymous users to login

The cleanup is complete. This forum is now read only.

Rating:

Excellent!
102
73%
Very Good
25
18%
Good
3
2%
Fair
1
1%
Poor
8
6%
 
Total votes: 139

Rayosun
Registered User
Posts: 3
Joined: Fri Aug 17, 2007 3:05 pm

Re: [2.0.15] Redirect anonymous users to login

Post by Rayosun » Fri Aug 17, 2007 3:51 pm

This looks like a great MOD that I would like to use but I can't figure out what the Author is saying in his notes:
  • ## Author Notes:
    ##
    ## To make this MOD work, the forums must be set to registered users only.
    ## Go to the "Forum Permissions Control" section and
    ## set "View", "Read", "Post", etc. to "REG".
    ## This stops guests from viewing, reading, and posting.
    ##
    ## Search engines did not see posts that are for registered users only,
    ## but you can set some forums open to all users including search engines.
    ## Go to "Forum Permissions Control" in the admin section and
    ## set "View" and "Read" to "ALL".
Is it NECESSARY or NOTto set "View", "Read", "Post", etc. to "REG"???
In one paragraph he says YES and in th next his says NO:
(the only interpretation that makes any sense to me is that the MOD will work in one way in those forums where viewership is set to "REG" and not work in those where they are set to "ALL".
Could the Author please clarify???

User avatar
Brf
Support Team Member
Support Team Member
Posts: 51326
Joined: Tue May 10, 2005 7:47 pm
Location: {postrow.POSTER_FROM}
Contact:

Re: [2.0.15] Redirect anonymous users to login

Post by Brf » Fri Aug 17, 2007 7:19 pm

This mod has nothing to do with forums, it is just suggesting you can set your forums to "Registered[hidden]" to prevent guests from seeing them.

DeborahSu
Registered User
Posts: 5
Joined: Fri Aug 24, 2007 3:45 pm

Re: [2.0.15] Redirect anonymous users to login

Post by DeborahSu » Fri Aug 24, 2007 3:52 pm

I'm doing my best here ... I downloaded the mod and followed the directions, copied & pasted as needed. BUT when I click to look at a profile while logged out, this is what I get:
Parse error: syntax error, unexpected T_ELSE in /home/realth5/public_html/forums/profile.php on line 88
This is what the code looks in profile.php like after I modified it (including a line before/after for context):
if ( $mode == 'viewprofile' )
if ($userdata['user_id'] == ANONYMOUS)
{
redirect(append_sid("login.$phpEx?redirect=profile.$phpEx&mode=viewprofile&" . POST_USERS_URL . '=' . intval($HTTP_GET_VARS[POST_USERS_URL]), true));
}
{
include($phpbb_root_path . 'includes/usercp_viewprofile.'.$phpEx);
exit;
}
Therefore, there is an error in the mod or else I thought I followed the instructions but didn't. I don't know PHP, so I'm having to trust you that it's right. Where did I mess up?

User avatar
Brf
Support Team Member
Support Team Member
Posts: 51326
Joined: Tue May 10, 2005 7:47 pm
Location: {postrow.POSTER_FROM}
Contact:

Re: [2.0.15] Redirect anonymous users to login

Post by Brf » Fri Aug 24, 2007 4:37 pm

You added the new code in the worng place.
It goes after the "{" not before.

DeborahSu
Registered User
Posts: 5
Joined: Fri Aug 24, 2007 3:45 pm

Re: [2.0.15] Redirect anonymous users to login

Post by DeborahSu » Fri Aug 24, 2007 5:48 pm

So, it should look like:
if ( $mode == 'viewprofile' )
{
if ($userdata['user_id'] == ANONYMOUS)
{
redirect(append_sid("login.$phpEx?redirect=profile.$phpEx&mode=viewprofile&" . POST_USERS_URL . '=' . intval($HTTP_GET_VARS[POST_USERS_URL]), true));
}
include($phpbb_root_path . 'includes/usercp_viewprofile.'.$phpEx);
exit;
}
???? Just verifying before I mess it up again!

User avatar
Brf
Support Team Member
Support Team Member
Posts: 51326
Joined: Tue May 10, 2005 7:47 pm
Location: {postrow.POSTER_FROM}
Contact:

Re: [2.0.15] Redirect anonymous users to login

Post by Brf » Fri Aug 24, 2007 5:53 pm

That is correct

jonathanes
Registered User
Posts: 5
Joined: Fri Aug 24, 2007 2:47 pm
Location: Oxfordshire, England, UK
Contact:

Re: [2.0.15] Redirect anonymous users to login

Post by jonathanes » Fri Aug 24, 2007 6:06 pm

Great straight forward instructions, implemented in minutes...thank you very much :D

However, still getting what I assume are human spammers...when will they ever learn :roll:

voted: Excellent!

DeborahSu
Registered User
Posts: 5
Joined: Fri Aug 24, 2007 3:45 pm

Re: [2.0.15] Redirect anonymous users to login

Post by DeborahSu » Fri Aug 24, 2007 6:22 pm

Hurray! I got it right and it's working!!!!

Thank you SO much for your help!

Andrew1806
Registered User
Posts: 15
Joined: Tue Feb 27, 2007 11:44 pm
Location: Isle of Wight, United Kingdom.
Contact:

Re: [2.0.15] Redirect anonymous users to login

Post by Andrew1806 » Fri Aug 24, 2007 8:25 pm

Hi, I'm trying to save this file but it saves as an mpeg movie file, I'm struggling to get further, can you help please? Thank you, Andrew

.....Don't answer this post as now I have looked through the previous posts I see this has been asked before, so this a reminder to all out there to look before writing! But I found it best to open the file with Wordpad, Thank you, Andrew

silverstreek
Registered User
Posts: 49
Joined: Mon Apr 16, 2007 7:20 am

Re: [2.0.15] Redirect anonymous users to login

Post by silverstreek » Sat Aug 25, 2007 6:45 pm

I like this mod, very easy to do. Now I don't have to worry about the "profile only for logged in" mod not working (or actually me not figuring out how to get it to work).

User avatar
McDLT
Registered User
Posts: 16
Joined: Fri Aug 31, 2007 3:29 pm
Contact:

Re: [2.0.15] Redirect anonymous users to login

Post by McDLT » Fri Aug 31, 2007 3:33 pm

Thanks for this MOD. I wish all MODs were this easy to install. Thanks again. :D

casner
Registered User
Posts: 2
Joined: Sat Dec 02, 2006 3:38 pm

Redirect anonymous users to login

Post by casner » Sun Sep 09, 2007 8:22 pm

I haven't yet installed this mod, but the only thing that anonymous users can see is the Usergroups. Of course, this exposes email addresses and names of active users - that's why I'm looking at this mod. Can I strip it down to just Usergroups, since everything else already does this in my 2.0.22 install?

User avatar
Brf
Support Team Member
Support Team Member
Posts: 51326
Joined: Tue May 10, 2005 7:47 pm
Location: {postrow.POSTER_FROM}
Contact:

Re: [2.0.15] Redirect anonymous users to login

Post by Brf » Mon Sep 10, 2007 1:19 am

Are you saying that anonymous users cannot see your memberlist or profiles? They can in a standard install.

casner
Registered User
Posts: 2
Joined: Sat Dec 02, 2006 3:38 pm

Re: [2.0.15] Redirect anonymous users to login

Post by casner » Mon Sep 10, 2007 2:13 am

That is correct; and after I added the Usergroup portion of this mod, they can't see the Usergroups anymore, either.

I have already installed some mods: Easymod, No Website Signature during registration, User Shield, Note to Admin on Admin Activation. One or more of these may be the reason.

User avatar
Brf
Support Team Member
Support Team Member
Posts: 51326
Joined: Tue May 10, 2005 7:47 pm
Location: {postrow.POSTER_FROM}
Contact:

Re: [2.0.15] Redirect anonymous users to login

Post by Brf » Mon Sep 10, 2007 2:15 am

Probably user shield.

Yes. You can pick and choose which files to put this mod into. It is only a couple little lines in each file, to redirect the guests.

Post Reply

Return to “[2.0.x] MOD Database Cleanup”

Who is online

Users browsing this forum: No registered users and 4 guests