custom profile: user selects image from name list

Started by abraamz, January 15, 2011, 01:32:10 PM

Previous topic - Next topic

abraamz

trying to use the custom profile fields as mood selection fields.
I want members to select an image like happy, angry, nervous etc
I need a custom profile field configured as a drop down list. The member can select his moods name (in Greek) and below avatar in each post a mood icon should appear.
How can i use images in drop down lists in custom profile fields?


Matthew K.

"Show Enclosed Within Text (Optional):
We strongly recommend to use an input mask to validate the input supplied by the user."

I would think you'd want to do something like...
<img src="{DEFAULT_IMAGES_URL}/moods/{INPUT}.png" alt="" border="" />

Making the input obviously a select box / dropdown with all of your moods.

abraamz

Thanks for that. I did saw that but for some reason i thought i cant use it with lists

Matthew K.

Nope, you should be able to :)

Good luck,
Labradoodle-360

abraamz

The above solution works fine with images named in English but not in Greek. I would like to make visible also the greek translation of that moods name.
I have moods images with names like angry.gif nervous.gif etc
I can make visible the image angry.gif and the word angry below it in a custom profile field  but i would like to have the word "θυμωμένος" visible instead of "angry"(which mean angry of cource).  Can this be done easily?
I can add some text strings in Modifications.greek.php if needed.
In which file is {INPUT} defined and converted?

Matthew K.

I'd suggest taking a peak at the helptext for the field that explains what {INPUT} does, it allows the user to select something or input something, whatever the VALUE of that input is, is what {INPUT} equals.

abraamz

Thanks Labradoodle-360 for your replies!
I believe i understand what {INPUT} does. I use the code below:
<img src="{DEFAULT_IMAGES_URL}/moods/{INPUT}.gif" alt="{INPUT}" border="" />
Member A selects for input "angry" The image with name angry.gif appears in that custom field.
Member B selects for input "tired" the image with name tired.gif appears in that custom field.

In my case all of the above works just fine but i need to use not the word angry or tired but their translation.
If i use images with names in greek characters the above code doesnt work, posibly because servers cant find images with greek names or something like that. But if i need to use the translation maybe i could use something like this:
$txt['angry']='θυμωμένος' in Modifications.greek.php and change my code to something like this:
<img src="{DEFAULT_IMAGES_URL}/moods/{INPUT}.gif" alt="{INPUT}" border="" /><p>' , $txt['{INPUT}'] , '</p>
but that code doesnt work obviously.
To be honest it works but it doesnt do what i wanted. With that code i can see the image and below it this text:
Quote' , $txt['angry'] , '

I supose that if i see how and where is {INPUT} or {DEFAULT_IMAGES_URL} generated or used or handled by code i could add something like {INPUT_TRANSLATION} and then use it with my custom field.

Advertisement: