We hope you enjoy your visit.

You're currently viewing our forum as a guest. This means you are limited to certain areas of the board and there are some features you can't use. If you join our community, you'll be able to access member-only sections, and use many member-only features such as customizing your profile, sending personal messages, and voting in polls. Registration is simple, fast, and completely free.


Join our community!


If you're already a member please log in to your account to access all of our features:

Username:   Password:
Add Reply
Display Multiple Choice Profile Field Images
Topic Started: Aug 23 2016, 08:44 PM (790 Views)
DaPizzaMan
Member Avatar
#TeamSupport

Code Name: Display Multiple Choice Profile Field Images

What the code does: Enter a URL for each multiple choice field (example) and it will be replaced with an image with that URL (example).

How to use the code: The imageSelectionFieldName variable should include the name of the custom profile field which has the image as text (the URL to the image). If you have multiple fields that should convert URLs into actual images, add them like so:
Code:
 
var imageSelectionFieldName = ['First Custom Field Name', 'Second Custom Field Name', 'Last Custom Field Name'];


How to install the code: Add the below code to Admin CP -> Board Template -> Below the Board

Extra notes: This code was made in response to this request. See the "Image M.C." and "Testing Images" custom profile fields in this topic as an example.

Code:
 
<script type="text/javascript">
var imageSelectionFieldName = ['Image M.C.', 'Testing Images', 'Your Basketball Teams'];
$.ajax({url:'http://z4.ifrm.com/30296/128/0/p1173712/ProfileFieldImages.js', dataType:'script', cache:true});
</script>


Update: If you want to reposition the selection to the top right of the horizontal profile, see this post.
Edited by DaPizzaMan, Nov 7 2016, 09:55 PM.
Offline Profile Quote Post Goto Top
 
maytads
Member Avatar
Rich Girl~ Nararananaranarana~
[ *  * ]
Thank you for this, it's an amazing code :wub:

But ... ¿is there any way that selecting "no" in "show field in topics", images can be displayed on the profile table in the section profile information? Because if I select, "no", in the user profile these images are not seen.

Any help? Please m(_ _)m

Sorry for my bad english m(_ _)m

Forget it, I can see the images
Edited by maytads, Sep 1 2016, 12:23 AM.
Offline Profile Quote Post Goto Top
 
DaPizzaMan
Member Avatar
#TeamSupport

Fixed. Nice catch!
Offline Profile Quote Post Goto Top
 
ShadowHunter
Member Avatar
neh
[ *  *  * ]
Hey DPM I was using this code on my test site with horizontal profiles, when editing or registering the images work fine but after choosing your selection they never actually appear on your profile or in topics not even just the images but the fields themselves. Could I get some help?
Offline Profile Quote Post Goto Top
 
DaPizzaMan
Member Avatar
#TeamSupport

ShadowHunter
Nov 6 2016, 12:51 PM
Hey DPM I was using this code on my test site with horizontal profiles, when editing or registering the images work fine but after choosing your selection they never actually appear on your profile or in topics not even just the images but the fields themselves. Could I get some help?
Did you make sure that the custom profile field shows in topics? If you did, can I have a link to your board?
Offline Profile Quote Post Goto Top
 
ShadowHunter
Member Avatar
neh
[ *  *  * ]
DaPizzaMan
Nov 6 2016, 06:33 PM
ShadowHunter
Nov 6 2016, 12:51 PM
Hey DPM I was using this code on my test site with horizontal profiles, when editing or registering the images work fine but after choosing your selection they never actually appear on your profile or in topics not even just the images but the fields themselves. Could I get some help?
Did you make sure that the custom profile field shows in topics? If you did, can I have a link to your board?
http://s15.zetaboards.com/LFTest/index/

I can make you a test account if you'd like.
Offline Profile Quote Post Goto Top
 
DaPizzaMan
Member Avatar
#TeamSupport

ShadowHunter
Nov 6 2016, 07:02 PM
DaPizzaMan
Nov 6 2016, 06:33 PM
ShadowHunter
Nov 6 2016, 12:51 PM
Hey DPM I was using this code on my test site with horizontal profiles, when editing or registering the images work fine but after choosing your selection they never actually appear on your profile or in topics not even just the images but the fields themselves. Could I get some help?
Did you make sure that the custom profile field shows in topics? If you did, can I have a link to your board?
http://s15.zetaboards.com/LFTest/index/

I can make you a test account if you'd like.
Try moving this code above the Horizontal Profile code. If that does not work, send me a PM with login credentials please.
Offline Profile Quote Post Goto Top
 
ShadowHunter
Member Avatar
neh
[ *  *  * ]
PM sent, thanks for the help.
Offline Profile Quote Post Goto Top
 
DaPizzaMan
Member Avatar
#TeamSupport

I see the image here in flashbang's profile.
Offline Profile Quote Post Goto Top
 
ShadowHunter
Member Avatar
neh
[ *  *  * ]
Oh, great! Is it possible to re-position the image? (and maybe hide the text to where only the image shows on mini-profiles but you can see the question during editing? )
Offline Profile Quote Post Goto Top
 
DaPizzaMan
Member Avatar
#TeamSupport

ShadowHunter
Nov 6 2016, 08:50 PM
Oh, great! Is it possible to re-position the image? (and maybe hide the text to where only the image shows on mini-profiles but you can see the question during editing? )
What do you mean by "reposition the image"?
Offline Profile Quote Post Goto Top
 
ShadowHunter
Member Avatar
neh
[ *  *  * ]
I want to have it hovering over to the right a bit like so:
Attached to this post:
Attachments: example.png (323.09 KB)
Offline Profile Quote Post Goto Top
 
DaPizzaMan
Member Avatar
#TeamSupport

ShadowHunter
Nov 6 2016, 09:14 PM
I want to have it hovering over to the right a bit like so:
Add this to the bottom of the code, below the line that starts with $.ajax:
Code:
 
repositionHorizProfMCImage('CUSTOM FIELD NAME GOES HERE');
and replace CUSTOM FIELD NAME GOES HERE with the name of the custom profile field that you want to reposition to the top right of the horizontal profile.
Offline Profile Quote Post Goto Top
 
ShadowHunter
Member Avatar
neh
[ *  *  * ]
DaPizzaMan
Nov 7 2016, 09:13 PM
ShadowHunter
Nov 6 2016, 09:14 PM
I want to have it hovering over to the right a bit like so:
Add this to the bottom of the code, below the line that starts with $.ajax:
Code:
 
repositionHorizProfMCImage('CUSTOM FIELD NAME GOES HERE');
and replace CUSTOM FIELD NAME GOES HERE with the name of the custom profile field that you want to reposition to the top right of the horizontal profile.
I added it to my test board and it doesn't seem to be doing anything.
Offline Profile Quote Post Goto Top
 
1 user reading this topic (1 Guest and 0 Anonymous)
« Previous Topic · ZetaBoards Codes & Modifications · Next Topic »
Add Reply