Alien
01-09-2010, 07:08 PM
This used to work beautifully in 3.8.x, but no longer functions in vB 4.0 and I could use some help!
I have gender required at registration, and have the proper profile fields set up with options of Male, Female, and Unknown. Depending on the selection, they can post and reply in the proper forum:
Males can post in the Male forum, but only read in the Female forum.
Females can post in the Female forum, but only read in the Male forum.
Unknown cannot post in either, but can read in both.
Here is the previous code that worked 100%:
if ($foruminfo[forumid] == 34 or $foruminfo[forumid] == 35)
{
// yes, it is
if ($foruminfo[forumid] == 34 and $vbulletin->userinfo[field5] == 'Female')
{
print_no_permission();
}
if ($foruminfo[forumid] == 35 and $vbulletin->userinfo[field5] == 'Male')
{
print_no_permission();
}
if ($vbulletin->userinfo[field5] != 'Male' and $vbulletin->userinfo[field5] != 'Female')
{
print_no_permission();
}
}
Here is the code I've tried with no luck (just results in a White page when trying to make a new thread in the proper place):
if (vB::$vbulletin->foruminfo['forumid'] == 34 or vB::$vbulletin->foruminfo['forumid'] == 35)
{
// yes, it is
if (vB::$vbulletin->foruminfo['forumid'] == 34 and vB::$vbulletin->userinfo['field5'] == 'Female')
{
print_no_permission();
}
if (vB::$vbulletin->foruminfo['forumid'] == 35 and vB::$vbulletin->userinfo['field5'] == 'Male')
{
print_no_permission();
}
if (vB::$vbulletin->userinfo['field5'] != 'Male' and vB::$vbulletin->userinfo['field5'] != 'Female')
{
print_no_permission();
}
}
Can someone help me work this out? Thank you so much!
I have gender required at registration, and have the proper profile fields set up with options of Male, Female, and Unknown. Depending on the selection, they can post and reply in the proper forum:
Males can post in the Male forum, but only read in the Female forum.
Females can post in the Female forum, but only read in the Male forum.
Unknown cannot post in either, but can read in both.
Here is the previous code that worked 100%:
if ($foruminfo[forumid] == 34 or $foruminfo[forumid] == 35)
{
// yes, it is
if ($foruminfo[forumid] == 34 and $vbulletin->userinfo[field5] == 'Female')
{
print_no_permission();
}
if ($foruminfo[forumid] == 35 and $vbulletin->userinfo[field5] == 'Male')
{
print_no_permission();
}
if ($vbulletin->userinfo[field5] != 'Male' and $vbulletin->userinfo[field5] != 'Female')
{
print_no_permission();
}
}
Here is the code I've tried with no luck (just results in a White page when trying to make a new thread in the proper place):
if (vB::$vbulletin->foruminfo['forumid'] == 34 or vB::$vbulletin->foruminfo['forumid'] == 35)
{
// yes, it is
if (vB::$vbulletin->foruminfo['forumid'] == 34 and vB::$vbulletin->userinfo['field5'] == 'Female')
{
print_no_permission();
}
if (vB::$vbulletin->foruminfo['forumid'] == 35 and vB::$vbulletin->userinfo['field5'] == 'Male')
{
print_no_permission();
}
if (vB::$vbulletin->userinfo['field5'] != 'Male' and vB::$vbulletin->userinfo['field5'] != 'Female')
{
print_no_permission();
}
}
Can someone help me work this out? Thank you so much!