Xthread Conditionals
#1 30-07-2015 
Hey @leefish ,

I posted this over at Zinga Burga's site, but haven't gotten a response. Maybe you can help me figure this one out: Thank you as always!


I'm wondering if it's possible to make a conditional for a listbox.

What I'm trying to do is make it so when a user makes a selection, it will display certian HTML and other xthread fields.

So I made a contact form with a dropdown. If the person chooses "Contact Staff" then it will display only xthread fields that I made for staff.

If they choose "Submit Article" then it will not show any staff related xthread fields.

I was reading the forums and saw how it can be created, but I'm not sure what the values are for the drop down selection.

I saw something like:


<if $GLOBALS['threadfields']['contus_select'] == 'war' then>
This is a war zone
<elseif $GLOBALS['threadfields']['contus_select'] == 'safe' then>
this is a safe zone

I'm not sure where the 'war' and 'safe' values are coming from in this example.

Thanks for the help!

#2 30-07-2015 
Try this: <if $GLOBALS['threadfields_x']['contus_select'] == 'war' then>

#3 30-07-2015 
Hmm, ok so I have two xthread fields that are listbox - 1 is called "Staff Application" the other is called "AOW Membership Application". They're in a dropdown menu.

So this is the code I have:

<if $GLOBALS['threadfields_x']['contus_select'] == 'Staff Application' then>
<h5>Welcome {$mybb->user['username']}!</h5>
<h5> We're glad that you decided to become an official member of Art of War Gaming community! Please fill out the form below with all fields required.</h5>
<h5> Once submitted, only you and a recruiter can see your application. One of the recruiters will get back to you within 24 hours.</h5>
    <elseif $GLOBALS['threadfields_x']['contus_select'] == 'AOW Membership Application' then>
        <h5>Thanks for applying</h5>

And I'm just doing the above to test to see if it works.

So if I understand the code right, if a user selects the option for "Staff Application" then it will show the Welcome text. If they select the other, then it will show the text that says "Thanks for applying"
(This post was last modified: 02-08-2015 10:38 AM by leefish.)

#4 02-08-2015 
Erich, I posted a full guide to your problem at MyBB hacks : http://mybbhacks.zingaburga.com/showthread.php?tid=5138

#5 02-08-2015 
You're the best LEE!


Sorry, that is a members only option