PDA

View Full Version : Dont Show Forum To User Under A Certain Age


wolfe
22 Mar 2007, 11:07
hi i was woundering if there was a mod out to stop users going in forums above there age rating

like if its a adult jokes forum if the user is under 18 they get an error message and also members get in.

i tried sumit like this as a plug in and got errors

if ($ageinfo = $vbulletin->db->query_first("
SELECT user.age
FROM " . TABLE_PREFIX . "user AS user
WHERE user.userid = $bbuserinfo[userid]"));
{

if ($ageinfo < 101 & $forumid == 19)
{
eval(standard_error(fetch_error('invalidid','You Are Under 18'));
}

Dismounted
22 Mar 2007, 11:30
You're starting an if condition without ending it. You also have a semicolon after your closing condition bracket. Also, the age should already be loaded and can be accessed by $vbulletin->userinfo['age'] or $bbuserinfo[age] in templates.

wolfe
22 Mar 2007, 11:33
if ($ageinfo = $vbulletin->db->query_first("
SELECT user.age
FROM " . TABLE_PREFIX . "user AS user
WHERE user.userid = $bbuserinfo[userid]"));
{

if ($ageinfo < 101 & $forumid == 19)
{
eval(standard_error(fetch_error('invalidid','You Are Under 18'));
}

what would i put in the else condition ?

louis_chypher
22 Mar 2007, 18:59
http://www.vbulletin.org/forum/showthread.php?t=118496

wolfe
22 Mar 2007, 19:05
nice one m8 :P thx alot.