karlm
10-10-2008, 10:21 PM
Hello folks,
Just need a quick hand with a condition statement...
I'm trying to use two different ad codes depending on if the member is male or female.
I created a profile field for Man / Woman.
I currently have:
<if condition="$post['field7'] == 'Man'">
<--code here for male members-->
</if>
<if condition="$post['field7'] == 'Woman'">
<--code here for female members-->
</if>
I know the problem is with the condition code, and I also know I can't use (or at least, I don't know how to if I can?) is_member_of as that is for member groups, not profile fields.
Any help, muchly appreciated.
ETA: I mean, I know the above code works on the postbit and checks whether the member who posted is male or female... what I need it to do though, is check the reader's membership to field7 - whether they are male or female, and display ads according to the sex of the view - not the poster.
In addition, I will be adding a condition based on the forumID. So for example, a man viewing a thread under the 'fathers forum' (say, ID=10) will see ads for (e.g.) "dads rights, thinning hair help, muscle building" while a woman would see ads similar, but based more towards their sex (e.g.) "safe sex, moms clubs, etc." - however, if a man viewed a different forum, e.g. 'health' , he'd see items relating to mens health - while women viewing the health forum would see ads directed towards women's health... long winded, but you get the idea I hope.
Just need a quick hand with a condition statement...
I'm trying to use two different ad codes depending on if the member is male or female.
I created a profile field for Man / Woman.
I currently have:
<if condition="$post['field7'] == 'Man'">
<--code here for male members-->
</if>
<if condition="$post['field7'] == 'Woman'">
<--code here for female members-->
</if>
I know the problem is with the condition code, and I also know I can't use (or at least, I don't know how to if I can?) is_member_of as that is for member groups, not profile fields.
Any help, muchly appreciated.
ETA: I mean, I know the above code works on the postbit and checks whether the member who posted is male or female... what I need it to do though, is check the reader's membership to field7 - whether they are male or female, and display ads according to the sex of the view - not the poster.
In addition, I will be adding a condition based on the forumID. So for example, a man viewing a thread under the 'fathers forum' (say, ID=10) will see ads for (e.g.) "dads rights, thinning hair help, muscle building" while a woman would see ads similar, but based more towards their sex (e.g.) "safe sex, moms clubs, etc." - however, if a man viewed a different forum, e.g. 'health' , he'd see items relating to mens health - while women viewing the health forum would see ads directed towards women's health... long winded, but you get the idea I hope.