Previous Thread
Next Thread
Print Thread
Rate Thread
Joined: Feb 2001
Posts: 143
Member
Member
Offline
Joined: Feb 2001
Posts: 143
I search for a Hack, which allows only registered users to read in a Forum.
Unregistered Users are supposed to be able to read only the main page.
I would be pleased with an answer.

help

Sponsored Links
Joined: May 2001
Posts: 6,708
Member
Member
Offline
Joined: May 2001
Posts: 6,708
There is an Option in General Display Settings to turn off guest viewing. But they can't see the main page. When they try to access it they will reach a login page.

Joined: Feb 2001
Posts: 143
Member
Member
Offline
Joined: Feb 2001
Posts: 143
Thanks, I know that. But the login screen should appear, first if a unregistered user wants to enter a forum.

:rolleyes:

Joined: Nov 2001
Posts: 1,704
CTM Offline
Moderator / Da Masta
Moderator / Da Masta
Offline
Joined: Nov 2001
Posts: 1,704
Try this...

Open ubb_forum.cgi, find:

Quote
code:
Code
	# determine path for the forum files
$permission = $this_forum[6];
$exact_path = "Forum$in{f}";
if ($permission =~ m/private/) {

$exact_path .= "/private-$this_forum[7]";

# does user have permission to enter?
&check_private_access($in{f}, $this_forum[12]);

}

Add after:

code:
[qb]
Code
	# check to see if user is logged in
if (($username eq '') && ($password eq '')) {
&StandardHTML("$vars_wordlets_err{not_logged_in}");
}
[/qb]
Open ubb_get_topic.cgi, find:

Quote
code:
Code
	# determine exact path & check permission if necessary
my $permission = $this_forum[6];
$exact_path = "Forum$_[0]";
if ($permission =~ m/private/) {

$exact_path .= "/private-$this_forum[7]";

# does user have permission to enter?
&check_private_access($_[0], $this_forum[12]);

}

Add after:

code:
[qb]
Code
	# check to see if user is logged in
if (($username eq '') && ($password eq '')) {
&StandardHTML("$vars_wordlets_err{not_logged_in}");
}
[/qb]
Hope that works for you. smile

Joined: May 2001
Posts: 6,708
Member
Member
Offline
Joined: May 2001
Posts: 6,708
Quote
quote:
Originally posted by J.o.h:
Thanks, I know that. But the login screen should appear, first if a unregistered user wants to enter a forum.

:rolleyes:
Sheesh sorry, just a misunderstanding. :rolleyes:

Sponsored Links
Joined: Feb 2001
Posts: 143
Member
Member
Offline
Joined: Feb 2001
Posts: 143
Thanks! I'll try it soon!

smile

Joined: Feb 2001
Posts: 143
Member
Member
Offline
Joined: Feb 2001
Posts: 143
Works great! Credits for you!

laugh

Joined: May 2002
Posts: 362
Junior Member
Junior Member
Offline
Joined: May 2002
Posts: 362
Whoa! Great, perfect, awesome hack! I've been asking about something similar to this for quite a while. A quick question though, any chance you could make it so you must be logged in to view today's active topics, also to view the calendar if you have that hack?

One more thing I just noticed - if you click the link after welcome to the newest member "Joeblue" - you can read their profile, is there any way to require login for this too?

Again, thank you sooooooo much!

Joined: Nov 2001
Posts: 1,704
CTM Offline
Moderator / Da Masta
Moderator / Da Masta
Offline
Joined: Nov 2001
Posts: 1,704
Hmm... Sure, this should be possible. smile

Today's Active Topics: http://www.iphq.co.uk/ubbhacks/download.cgi?dl=6

Calendar*: http://www.iphq.co.uk/ubbhacks/download.cgi?dl=7

Profile: http://www.iphq.co.uk/ubbhacks/download.cgi?dl=8

* I'm 60% sure that's all that needs to be done to the Calendar, because LK already added some code to make sure only members could access some parts of the Calendar. Someone please correct me if I'm wrong. wink

Joined: May 2002
Posts: 362
Junior Member
Junior Member
Offline
Joined: May 2002
Posts: 362
It works perfectly! Thank you sooooo very much!

Sponsored Links

Link Copied to Clipboard
Donate Today!
Donate via PayPal

Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.

Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.
Recommended Hosts
We have personally worked with and recommend the following Web Hosts:
Stable Host
bluehost
InterServer
Visit us on Facebook
Member Spotlight
Nettomo
Nettomo
Germany, Bremen
Posts: 417
Joined: November 2001
Forum Statistics
Forums63
Topics37,573
Posts293,925
Members13,849
Most Online5,166
Sep 15th, 2019
Today's Statistics
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
Top Posters
AllenAyres 21,079
JoshPet 10,369
LK 7,394
Lord Dexter 6,708
Gizmo 5,833
Greg Hard 4,625
Top Posters(30 Days)
Top Likes Received
isaac 82
Gizmo 20
Brett 7
WebGuy 2
Morgan 2
Top Likes Received (30 Days)
None yet
The UBB.Developers Network (UBB.Dev/Threads.Dev) is ©2000-2024 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 8.0.0
(Preview build 20240430)