Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - Access forum according to DOB setting?
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Access forum according to DOB setting?

 Post Reply Post Reply
Author
serendipity View Drop Down
Groupie
Groupie
Avatar

Joined: 10 June 2003
Status: Offline
Points: 43
Post Options Post Options   Thanks (0) Thanks(0)   Quote serendipity Quote  Post ReplyReply Direct Link To This Post Topic: Access forum according to DOB setting?
    Posted: 18 July 2003 at 11:34am
I'd like to set up a forum that allows only those members who are 18 or over to access a certain forum, but still allow them to post in other forums that have no age restriction. If member enters no date-of-birth in their profile, or the date of birth means they're under 18, they can see the forum but they just can't enter.

Is this possible??

Edited by serendipity
Back to Top
faubo View Drop Down
Senior Member
Senior Member
Avatar

Joined: 30 May 2002
Location: Brazil
Status: Offline
Points: 560
Post Options Post Options   Thanks (0) Thanks(0)   Quote faubo Quote  Post ReplyReply Direct Link To This Post Posted: 18 July 2003 at 11:45am

you will have to modify your registry page.

use datadiff to see if the user is under 18, if he/she is... then give them the normal group permissions settings.

If they are above 18 instead of the normal group permissions you put them in the Above18 group permissions.

Now you just need to set up the above 18 forum to only accept people from above18 group.

 

This is only theory, but I think it should work

Back to Top
serendipity View Drop Down
Groupie
Groupie
Avatar

Joined: 10 June 2003
Status: Offline
Points: 43
Post Options Post Options   Thanks (0) Thanks(0)   Quote serendipity Quote  Post ReplyReply Direct Link To This Post Posted: 18 July 2003 at 3:09pm
Sorry, prob a stupid question but what is datadiff ??
Back to Top
faubo View Drop Down
Senior Member
Senior Member
Avatar

Joined: 30 May 2002
Location: Brazil
Status: Offline
Points: 560
Post Options Post Options   Thanks (0) Thanks(0)   Quote faubo Quote  Post ReplyReply Direct Link To This Post Posted: 18 July 2003 at 3:53pm

Not stupid, I wrote that in a hurry, should have explained better.

DateDiff is a VBScript date function.

(start a copy from 4guysfromrolla)

DateDiff returns the difference in intervals between two dates. The interval can be one of the following settings:

	"yyyy"		Year
	"q"		Quarter
	"m"		Month
	"y"		Day of Year
	"d"		Day
	"w"		Weekday
	"ww"		Week of Year
	"h"		Hour
	"n"		Minute
	"s"		Second

So, DateDiff("d",#10/5/98#,#10/8/98#) would return 3, since there are three days between 10/8/98 and 10/5/98.

(end copy)

you need DateDiff("yyyy", DOB, Today), if return 18 then the user already have 18.

Off course you will need to change manually when a user signs with less than 18 but then complete 18 years old, although you probably can do some automatic way to do that.

Back to Top
serendipity View Drop Down
Groupie
Groupie
Avatar

Joined: 10 June 2003
Status: Offline
Points: 43
Post Options Post Options   Thanks (0) Thanks(0)   Quote serendipity Quote  Post ReplyReply Direct Link To This Post Posted: 18 July 2003 at 4:05pm
Aaah, got it. I'm assuming this would be code on registration.asp page somewhere. I'll play with it and see what I can come up with.

Thanks for your help!
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.