vBulletin Mods

The Official vBulletin Modifications Site
https://www.vbulletin.org/forum/showthread.php?t=250418

Lynne 25 Jun 2015 19:26

Since you didn't use the code tags, it looked like your code was not all on one-line, which it needs to be if you don't use the parenthesis.

You don't use that code for a radio button though. That code is for Multiple-Selection Menu and Multiple-Selection Checkbox profile fields. You need to use the code for For Single-Line Text Box, Multiple-Line Text Box, Single-Selection Radio Buttons, and Single-Selection Menu profile fields.

ProfC 09 Jul 2015 22:44

Hi Lynne,

Is it possible to display a different image on the postbit depending on the option chosen on a single-selection menu?

Example: "What is your favourite colour?"
Red
Blue
Green
Orange

I've used method one but am suspecting that method two may actually be more suitable for this task.

Thank you in advance,

ProfC.

Lynne 10 Jul 2015 17:01

You could use either template edits or a plugin to do what you want. In the examples I show, just replace 'Your 1rst option' with '<img src="image.png" alt="Red Image" height="xx" width="yy">'

ProfC 10 Jul 2015 17:25

Quote:

Originally Posted by Lynne (Post 2549860)
You could use either template edits or a plugin to do what you want. In the examples I show, just replace 'Your 1rst option' with '<img src="image.png" alt="Red Image" height="xx" width="yy">'

Thank you! I'll take a look and see what I get. :)

friendlymela 21 Jul 2015 17:28

Good advices thanks for share this

ProfC 24 Jul 2015 14:05

I'm having a bit of trouble somewhere with this. I decided to go the plugin method for multiple selection fields, as it seemed to offer the means to set different things to display based on the option selected. Unfortunately, I haven't been able to get any further than it displaying "house memberships" (the field name) on the postbit.

I'm not sure whether I've even used the right method or not but the "single selection menu" method didn't appear to have the options to display a different result based on what was selected in the profile menu.

Would it be possible for someone to tell me where I've gone wrong? (I get the sensation I'll be asking this a lot -sigh-) Thank you in advance :)

Plugin code:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.


MarkFL 24 Jul 2015 14:22

You want to use "==" instead of "&" in your conditionals. However, might I suggest using a switch statement instead?


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.


ProfC 24 Jul 2015 15:48

Thank you; although it appears I'm getting the same result using your version as I am with the one I added following the article.

MarkFL 24 Jul 2015 16:46

What hook location are you using?

ProfC 24 Jul 2015 16:52

"postbit_display_complete" as mentioned in the article.

MarkFL 24 Jul 2015 17:03

Okay, try using the plugin code:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

What do you get now?

ProfC 24 Jul 2015 17:13

"House Membership: Default", I have "Ravenclaw" selected in my profile. I edited my profile to leave it blank, and the field disappeared but upon changing it to Ravenclaw again, it went to "Default" on the postbit.

MarkFL 24 Jul 2015 17:18

Okay, it sounds to me that the value being stored in the variable $post['field17'] isn't what you are expecting.

ProfC 24 Jul 2015 17:43

It seems it.

I'm not sure what I may have done wrong. This is a screenshot of the profile field from the ACP.

MarkFL 24 Jul 2015 18:25

Okay, try this as your plugin code:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.



All times are GMT. The time now is 13:04.

Powered by vBulletin® Version 3.8.14
Copyright © 2021, MH Sub I, LLC dba vBulletin. All Rights Reserved. vBulletin® is a registered trademark of MH Sub I, LLC
Copyright ©2001 - , vbulletin.org. All rights reserved.