The forum of the forums
Welcome to the Official Support Forum of Forumotion!

To take full advantage of everything offered by our forum, please log in if you are already a member, or join our community if you've not yet.



Create a free forum like this one.

Local user's profile image

View previous topic View next topic Go down

Solved Local user's profile image

Post by BloodDrunk on May 1st 2017, 10:31 pm

Hello,

how do I get the local user's profile image? I have a div and I want to put it inside the div, but don't know what variable to use. I'm editing templates, so what variable is for profile image?
I tried using {USERNAME_AVATAR}, but it displays nothing.
Precisely, when I use it as a link withing src="", it displays (nothing).


Last edited by BloodDrunk on May 2nd 2017, 1:49 pm; edited 1 time in total
avatar
BloodDrunk
Forumember

Posts : 127
Reputation : 4
Language : English

http://www.nfssecrets.tk/

Back to top Go down

Solved Re: Local user's profile image

Post by Justice™ on May 1st 2017, 10:47 pm

Hello,

This JS code should do what you want:
Code:
$(function(){
$("selector").attr("src", _userdata.avatar.split(" ")[1].split("\"")[1]);
})
Of course, you have to replace selector with the class or id of the img element.
avatar
Justice™
Forumember

Posts : 521
Reputation : 121
Language : Romanian and English

http://board.realmsn.com

Back to top Go down

Solved Re: Local user's profile image

Post by BloodDrunk on May 1st 2017, 11:13 pm

Wolfuryo wrote:Hello,

This JS code should do what you want:
Code:
$(function(){
$("selector").attr("src", _userdata.avatar.split(" ")[1].split(""")[1]);
})
Of course, you have to replace selector with the class or id of the img element.

Thanks, I'll try it.
Btw, where do you get that? How do you know, do you see that somewhere or what..
EDIT: I believe you means only 2 ""'s, and not 3?


Last edited by BloodDrunk on May 1st 2017, 11:18 pm; edited 1 time in total
avatar
BloodDrunk
Forumember

Posts : 127
Reputation : 4
Language : English

http://www.nfssecrets.tk/

Back to top Go down

Solved Re: Local user's profile image

Post by Justice™ on May 1st 2017, 11:20 pm

Take a look at the source of a forum page. There's big JS code with all sort of goodies Smile
It's not """, it is "\"".
avatar
Justice™
Forumember

Posts : 521
Reputation : 121
Language : Romanian and English

http://board.realmsn.com

Back to top Go down

Solved Re: Local user's profile image

Post by BloodDrunk on May 1st 2017, 11:22 pm

Uuuuuuu, lovely Very Happy
Thank you, sir!

I'll come back here, I'll have more questions!
avatar
BloodDrunk
Forumember

Posts : 127
Reputation : 4
Language : English

http://www.nfssecrets.tk/

Back to top Go down

Solved Re: Local user's profile image

Post by Justice™ on May 1st 2017, 11:23 pm

Glad I could help you Smile
avatar
Justice™
Forumember

Posts : 521
Reputation : 121
Language : Romanian and English

http://board.realmsn.com

Back to top Go down

Solved Re: Local user's profile image

Post by APE on May 2nd 2017, 12:09 am

@BloodDrunk is this now solved ?
If yes please make sure you say so in the topic then mark as solved by clicking the mark solved button.



avatar
APE
Manager
Manager

Male Posts : 11014
Reputation : 1031
Language : fluent in dork / mumbojumbo & English haha
Location : STUCK IN FORUMOTIONS SERVERS HELP ME !!!!!!

http://chatworld.forumotion.co.uk/

Back to top Go down

Solved Re: Local user's profile image

Post by BloodDrunk on May 2nd 2017, 7:09 pm

Yes, solved!
avatar
BloodDrunk
Forumember

Posts : 127
Reputation : 4
Language : English

http://www.nfssecrets.tk/

Back to top Go down

Solved Re: Local user's profile image

Post by APE on May 2nd 2017, 7:12 pm

Thank you Smile

Have a great day.
Problem solved & topic archived.
Please read our forum rules: ESF General Rules



avatar
APE
Manager
Manager

Male Posts : 11014
Reputation : 1031
Language : fluent in dork / mumbojumbo & English haha
Location : STUCK IN FORUMOTIONS SERVERS HELP ME !!!!!!

http://chatworld.forumotion.co.uk/

Back to top Go down

View previous topic View next topic Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum