Jump to content

Logged-in User's picture - UPDATE - scroll down for latest


Graham Quince

Recommended Posts

I'll probably end up turning this into a widget, but in the meantime, if you want to display the user's picture when they log in:

<div class="userpic"></div>
<script>
var user = FrogOS ? FrogOS.getUser() : this.getUser();

Frog.Model.api('users.getOne', {
    uuid: user.uuid
}).done(function(listResponse) {
    var photo = listResponse.data.categories[0].fields[6].value;
            
    if (!photo) {
        photo = "users/public/images/default_no_gender.png";                 
    } 
    this.element.find('.userpic').html(
        '<img style="width: 150px; max-height: 150px;"   src="'+photo+'">'
    )
}.bind(this));
    

</script>

 

Link to comment
Share on other sites

  • 2 weeks later...

I think we should ignore my original post here.  I've competely missed it - looks like the field thumbnail is in FrogOS.getUser();

<div class="userpic"></div>
<script>
var user = FrogOS ? FrogOS.getUser() : this.getUser();
    this.element.find('.userpic').html(
        '<img style="width: 150px; max-height: 150px;" src="'+user.thumbnail+'">'
    )
</script>

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...