vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Need hand with conditional statement pls (https://vborg.vbsupport.ru/showthread.php?t=193316)

karlm 10-10-2008 10:21 PM

Need hand with conditional statement pls
 
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:
Code:

<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.

Lynne 10-10-2008 10:59 PM

I posted on the thread you made at vb.com. You need to specify which template you are trying to use this in.


All times are GMT. The time now is 02:31 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.00907 seconds
  • Memory Usage 1,708KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_code_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (2)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete