WordPress.org

Ready to get started?Download WordPress

Forums

Simple Local Avatars
Using this plugin in a front-end page. (16 posts)

  1. Dominor Novus
    Member
    Posted 2 years ago #

    Can we have an example of how to output a form with the upload field in a front-end page?

    http://wordpress.org/extend/plugins/simple-local-avatars/

  2. xnau
    Member
    Posted 2 years ago #

    @Dominor Novus

    OK, it's been monthe, and you've probably figured this out by now, but I'm doing this also and I thought I'd share how I got it done. Really, you just need to install a plugin called "Front End Users" that creates a front-end profile (among other things) for your users. It will include the avatar field from this plugin, and it works very well.

  3. thatwastaxing
    Member
    Posted 2 years ago #

    Or Theme My Login.

  4. nicolaelvin
    Member
    Posted 1 year ago #

    @xnau yes Front End Users does display the avatar and upload button, but it doesn't actually work. When you browse for the file and then click update, it doesn't save the picture.

  5. xnau
    Member
    Posted 1 year ago #

    nicolaelvin,

    I have it working on several installations, so the plugin does work. You need to go in and do some debugging: look for errors in your browser console, check your PHP error log.

  6. nicolaelvin
    Member
    Posted 1 year ago #

    xnau

    Ahh I am past that plugin now. I decided just to hard code all my profile fields in. I don't know how now though to include the avatar field when I am now doing it by hand.

  7. tmayombo
    Member
    Posted 1 year ago #

    Hi Xnau

    Is it also possible to use the "Front End Users" plugin to display the back end page of the "participant database" list of participants in the front end including all functionalities such as filters ?

  8. xnau
    Member
    Posted 1 year ago #

    nicolaelvin,

    I use a plugin called "Simple Local Avatars" to deal with avatars, and there is a function in the plugin that you can include when you are defining your custom user fields. I don't remember the code exactly, but the plugin is pretty simple, so it's not hard to find the function that adds the avatar field.

  9. xnau
    Member
    Posted 1 year ago #

    tmayombo,

    Since the users in the Participants Database plugin are not WordPress users "Front End Users" won't be of any help. You kinda need to use one or the other for managing your users. Front End Users works really well for giving your users the ability to do all kinds of things on your website. Participants Database is really more for maintaining a list of people and their data. It doesn't give those people any ability to log in to the website, and so there is no "profile" as such for those people.

  10. devrimg
    Member
    Posted 1 year ago #

    I had this working before but now it doesn't save an avatar.

    Front-end Users - Simple local avatars.

  11. Florence
    Member
    Posted 1 year ago #

    Im using thos code to add the upload box to the front end, but there is no save option. Any ideas?

    '<?php
    $myAv = new simple_local_avatars();
    $myAv->edit_user_profile($profileuser);
    ?>'
  12. Florence
    Member
    Posted 1 year ago #

    Never mind, I figured it out!

  13. orenmedina
    Member
    Posted 1 year ago #

    @Florence hi!
    can you please share your solution??
    i am also trying to create this box for my users...
    thanks,
    oren

  14. Florence
    Member
    Posted 1 year ago #

    Sure! I have a profile using a shortcode so I was looking for a box using a shortcode as well. Here's how I did it:

    Instal Simple Local Avatars

    Install this plugin http://wordpress.org/extend/plugins/php-code-for-posts/

    Add a new shortcode and enter this code:

    <?php get_header();
    global $user_ID;
    if ($user_ID) {
    $user_info = get_userdata($user_ID);
    $id = $user_info->ID;
    }
     ?>
    
    <?php if(isset($_POST['user_avatar_edit_submit']))
          {
               do_action('edit_user_profile_update', $id);
          }
    ?>
    
    <form id="your-profile" action="" method="post">
        <?php
        $myAv = new simple_local_avatars();
        $myAv->edit_user_profile($user_info);
        ?>
        <input type="submit" name="user_avatar_edit_submit" value="OK"/>
    </form>

    Copy and paste the shortcode onto a page and voilla! There's your front-end avatar uploader!

  15. orenmedina
    Member
    Posted 1 year ago #

    Hi @Florence,

    THANKS!

    it works great though i'm trying to add this feature into another profile front-end plugin (which provides avatars only on pro version..).

    BTW, the avatar image, for some reason, is not showing on the page (it DOES get updated on the "backstage", but the code above keep showing the default avatar..

    thanks,

    oren

  16. Florence
    Member
    Posted 1 year ago #

    Oh that's weird... It works for me.. Try turning off your other plugins. Maybe there's a conflict/

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic