PDA

View Full Version : Custom userfield for ads


control1110
08-06-2013, 07:40 PM
Hi,

I am wanting to add a paid subscription to my site where if a user has paid they can have the option to remove ads.

I am doing this by creating a custom user field called Remove ads:

I then go to my header template style and add the code

<vb:if condition="$bbuserinfo['field14'] == No">

This does not work. Any idea how I can get this working?

Thanks,
Jason

kh99
08-06-2013, 10:47 PM
Try putting single quotes around No, like
<vb:if condition="$bbuserinfo['field14'] == 'No'">

control1110
08-06-2013, 11:30 PM
Thanks works perfectly

--------------- Added 1375836489 at 1375836489 ---------------

On a side note if I also want to do a subscription check too it would be

<vb:if condition="$bbuserinfo['field14'] == 'No'" && $bbuserinfo['usergroup'] == X>

If their subscription ends a am assuming the field will still be set which is why I need the second condition.

Does bbuserinfo['usergroup'] pick up additional user groups too or just primary?

Is this correct?

kh99
08-07-2013, 09:38 AM
The function is_member_of() checks both primary and additional user groups, so something like:
<vb:if condition="$bbuserinfo['field14'] == 'No' && is_member_of($bbuserinfo, X)">