Skip to:
Content
Pages
Categories
Search
Top
Bottom

customize avatar file name


  • a608237
    Participant

    @a608237

    Where can I customize what the file name of uploaded avatars is? I see that they get uploaded to uploads/images/avatar/__/________bpthumb.jpg but the name is some kind of hash, and I would like it to be something predictable for use in MySQL. Also, I read that the directories to avatar files are not stored in MYsql, is this true?

    Thanks in advance.

Viewing 4 replies - 1 through 4 (of 4 total)

  • a608237
    Participant

    @a608237

    I’ve decided to create a hidden xprofile field to store this data, but using xprofile_set_field_data only seems to work temporarily, after several minutes, the entire row containing the data disappears from wp_bp_xprofile_data. How can I make this permanent?

    add_action( 'bp_setup_nav', 'write_path' );
    function write_path() {
    	global $bp;
            global $current_user;
    
            $avatar_path = bp_core_fetch_avatar('html=false'); 
            xprofile_set_field_data('path', $current_user->ID, $avatar_path); 
    }

    a608237
    Participant

    @a608237

    So this is a very hacky way i’m doing it. I noticed using xprofile_set_field_data to set the data for an extended profile field only works temporarily. However, overwriting an existing default profile field (i.e. Facebook, Snapchat) seems to stay permanently.

    xprofile_set_field_data('Snapchat', $current_user->ID, $avatar_path);

    So as admin, I went in and changed the name of the default profile field to my desired one (i.e. Snapchat -> path) and applied

    add_filter( 'xprofile_updated_profile', 'update_xprof' );
    
    function update_xprof() {
    $path=bp_core_fetch_avatar();
    xprofile_set_field_data('path', $current_user->ID, $path); 
    }

    This way works more or less. However, I noticed that the function only kicks in when the user literally clicks ‘Edit’ and changes the data in her/his profile from the front end.

    This function does not kick in whenever the user changes his/her avatar. I tried to use
    xprofile_avatar_uploaded in place of xprofile_updated_profile, but with it, the function doesn’t seem to work at all. Can someone comment on why?


    willam14
    Participant

    @willam14

    To avoid this situation, take a copy of the Avatars directory when upgrading JIRA and place this into the avatars directory of the JIRA Home Before upgrading JIRA to a JIRA 6+ environment Myloweslife


    denniosgwanka
    Participant

    @denniosgwanka

    overwriting an existing default profile field (i.e. Facebook, Snapchat) seems to stay permanently., I noticed that the function only kicks in when the user literally clicks ‘Edit’ and changes the data in her/his profile from the front end.

Viewing 4 replies - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.
Skip to toolbar