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


Back to top Go down

Solved Re: Local user's profile image

Post by BloodDrunk 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
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 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
Guest
Guest


Back to top Go down

Solved Re: Local user's profile image

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

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 1st 2017, 11:23 pm

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


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 : 19123
Reputation : 1993
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 2nd 2017, 7:09 pm

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 2nd 2017, 7:12 pm

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 : 19123
Reputation : 1993
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