Statistics: Posted by Bruce C — October 30th, 2011, 6:37 pm
<?php
$fields = json_decode(S2MEMBER_CURRENT_USER_FIELDS, true);
$fields["custom_field"];
?>
<?php
$fields = json_decode(S2MEMBER_CURRENT_USER_FIELDS, true);
if (current_user_can('access_s2member_level0') && $fields["custom_field"] === 'field_value')
{
?>
Content for this condition goes here.
<?php
}
else if (current_user_can('access_s2member_level0') && $fields["custom_field"] === 'another_field_value')
{
?>
Content for this other condition goes here.
<?php
}
else
{
?>
Dump public content here, or add additional conditions.
<?php
}
?>
Statistics: Posted by stebesplace — October 30th, 2011, 6:11 pm
Statistics: Posted by stebesplace — October 30th, 2011, 6:07 pm
Statistics: Posted by Bruce C — October 30th, 2011, 6:06 pm
Statistics: Posted by stebesplace — October 30th, 2011, 5:52 pm
Statistics: Posted by stebesplace — October 30th, 2011, 5:43 pm
<?php
$fields = json_decode(S2MEMBER_CURRENT_USER_FIELDS, true);
if (current_user_is('s2member_level0') && $fields["Gender"] === 'female')
{
?>
Things for females
<?php
}
else if (current_user_is('s2member_level0') && $fields["Gender"] === 'male')
{
?>
Things for males
<?php
}
else
{
?>
Things for non-members
<?php
}
?>
Statistics: Posted by stebesplace — October 30th, 2011, 5:26 pm
<?php
//This gets the user fields
$fields = json_decode(S2MEMBER_CURRENT_USER_FIELDS, true);
//Then, use the $fields variable to get your data.
$fields["my_unique_field_id"];//Replace this with yours.
?>
<?php
$fields = json_decode(S2MEMBER_CURRENT_USER_FIELDS, true);
if (current_user_is('s2member_level0') && $fields["user_gender"] === 'female')
{?>
Things for females
<?php}else if (current_user_is('s2member_level0') && $fields["user_gender"] === 'male'){?>
Things for males
<?php}else{?>
Things for non-members
<?php}?>
Statistics: Posted by Bruce C — October 30th, 2011, 5:06 pm
Statistics: Posted by stebesplace — October 30th, 2011, 4:52 pm
[s2If current_user_is(s2member_level0) AND (what conditional statement would go here in order to validate that the registration field entered was female?)]
Content for logged in user who is female goes here
[/s2If]
Statistics: Posted by stebesplace — October 30th, 2011, 4:19 pm
Statistics: Posted by Bruce C — October 30th, 2011, 4:05 pm
Statistics: Posted by stebesplace — October 30th, 2011, 3:50 pm