The forum of the forums
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Local user's profile image

2 posters

Go down

Solved Local user's profile image

Post by BloodDrunk May 2nd 2017, 03:31

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, 18:49; edited 1 time in total
BloodDrunk
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 Guest May 2nd 2017, 03:47

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
Guest
Guest


Back to top Go down

Solved Re: Local user's profile image

Post by BloodDrunk May 2nd 2017, 04:13

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 2nd 2017, 04:18; edited 1 time in total
BloodDrunk
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 Guest May 2nd 2017, 04:20

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
Guest
Guest


Back to top Go down

Solved Re: Local user's profile image

Post by BloodDrunk May 2nd 2017, 04:22

Uuuuuuu, lovely Very Happy
Thank you, sir!

I'll come back here, I'll have more questions!
BloodDrunk
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 Guest May 2nd 2017, 04:23

Glad I could help you Smile
avatar
Guest
Guest


Back to top Go down

Solved Re: Local user's profile image

Post by Ape May 2nd 2017, 05:09

@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.


Local user's profile image Left1212Local user's profile image Center11Local user's profile image Right112
Local user's profile image Ape_b110
Local user's profile image Ape1010
Ape
Ape
Administrator
Administrator

Male Posts : 19436
Reputation : 2010
Language : fluent in dork / mumbojumbo & English haha

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

Back to top Go down

Solved Re: Local user's profile image

Post by BloodDrunk May 3rd 2017, 00:09

Yes, solved!
BloodDrunk
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 May 3rd 2017, 00:12

Thank you Smile

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


Local user's profile image Left1212Local user's profile image Center11Local user's profile image Right112
Local user's profile image Ape_b110
Local user's profile image Ape1010
Ape
Ape
Administrator
Administrator

Male Posts : 19436
Reputation : 2010
Language : fluent in dork / mumbojumbo & English haha

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

Back to top Go down

Back to top

- Similar topics

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