Image List OR HTML/BBC in Radio/Select Box Type as Custom Profile Field

Started by TssCman123, July 16, 2013, 10:26:40 PM

Previous topic - Next topic

TssCman123

As shown in the attached image, there is an option to have a radio button or select box list.  That is just for text.  Some might want to have a list of images.

I think that either HTML or BBC should be allowed in the select box/radio buttons fields (for the image code), or there should be a field type of a list of images.

This can be useful for things like this. where users can select from various images:

MrPhil

So you're asking for radio buttons (or checkboxes or drop-down selection list) with images instead of/in addition to a text label? I can't look at the code right now, but for radio buttons or checkboxes, if SMF just takes your code "as is" and doesn't try to muck with it, you might be able to put in <img src="....." alt="some text"/> right now. Have you tried that? If it comes out as literal text, try BBCode instead. There's no reason that at the HTML level you can't "label" a radio button or checkbox with an image and/or text. It depends on if and how SMF tries to "protect" you by disabling tags here or otherwise assuming that the label is text.

A drop-down selection box with images instead of text would be a problem, as I believe that <option>s must be text (I'm away from my HTML references right now). A selection box would have to be emulated with <div>s and Javascript code in order to include images. Possibly CSS background images could be used with text labels, but that may still require some code modification.

Kindred

it won't work, MrPhil.

I believe that SMF only accepts text in those field values....
either because we determined it to be a better choice or because someone complained that an admin with priviledges could insert an attack code into that field...
(stupidest security reports ever)
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

emanuele

Quote from: Kindred on July 17, 2013, 12:31:38 PM
(stupidest security reports ever)
Not really...nothing is stupid, remember that up to 2.0.3/1.1.17 using a properly formatted page it was possible to induce an admin to change *anything* on the admin panel (and I mean *any* *single* setting, e.g. give normal users admin rights).
Obviously if there is such a security issue, some html in a field is nothing, though it's always better to sanitise as much as possible to avoid any kind of surprise.


Take a peek at what I'm doing! ;D




Hai bisogno di supporto in Italiano?

Aiutateci ad aiutarvi: spiegate bene il vostro problema: no, "non funziona" non è una spiegazione!!
1) Cosa fai,
2) cosa ti aspetti,
3) cosa ottieni.

TssCman123

I have indeed tried entering HTML and BBC code into the fields, and those codes were not supported.  See This Thread

It is best for radio buttons, not check boxes or a drop down list.

I have a Forumotion forum where I have the option to create an images list as a custom profile field.

If you look at the attachment "before.jpg", you will see how there is an image that is displayed as a custom profile field.  Once the orange/green arrows icon is pressed, I have the option to select between multiple images (shown in attachment "after.jpg").  What you saw was a warning system substitution which allows all members to see each other's warning status.

Advertisement: