Local user's profile image Hitskin_logo Hitskin.com

This is a Hitskin.com skin preview
Install the skinReturn to the skin page

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.
2 posters

    Local user's profile image

    BloodDrunk
    BloodDrunk
    Forumember


    Posts : 127
    Reputation : 4
    Language : English

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


    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.
    BloodDrunk
    BloodDrunk
    Forumember


    Posts : 127
    Reputation : 4
    Language : English

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


    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 "\"".
    BloodDrunk
    BloodDrunk
    Forumember


    Posts : 127
    Reputation : 4
    Language : English

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


    Solved Re: Local user's profile image

    Post by Guest May 1st 2017, 11:23 pm

    Glad I could help you Smile
    Ape
    Ape
    Administrator
    Administrator


    Male Posts : 19324
    Reputation : 2005
    Language : fluent in dork / mumbojumbo & English haha

    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
    BloodDrunk
    BloodDrunk
    Forumember


    Posts : 127
    Reputation : 4
    Language : English

    Solved Re: Local user's profile image

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

    Yes, solved!
    Ape
    Ape
    Administrator
    Administrator


    Male Posts : 19324
    Reputation : 2005
    Language : fluent in dork / mumbojumbo & English haha

    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