Moodle
  1. Moodle
  2. MDL-20053

Database: create ##userpicture## tag to allow the user's profile picture to be displayed

    Details

    • Difficulty:
      Easy
    • Affected Branches:
      MOODLE_19_STABLE, MOODLE_20_STABLE, MOODLE_24_STABLE
    • Rank:
      5489

      Description

      Similar to forum, it would be good to display a user's profile picture within the database activity module. We currently have a ##user## tag so ##userpicture## seems obvious. I am attaching a patch which implements this feature. Feel free to test the patch and provide feedback. Peace - Anthony

      1. data_userpicture_large.patch
        3 kB
        Anthony Borrow
      2. data_userpicture.patch
        2 kB
        Anthony Borrow
      3. MDL-20053.patch
        2 kB
        Anthony Borrow
      4. MDL-20053.patch
        2 kB
        Anthony Borrow

        Activity

        Hide
        Wenxin Lu added a comment -

        Great! Thanks a lot, Anthony. It works perfect on my Moodle1.9.7. I have been waiting for this photo display for years. Also, the picture links to full profile as well! Just one suggestion: Currently, it shows f2.jpg, the smaller one. Can we have the choice to show f1.jpg, the bigger one?

        Show
        Wenxin Lu added a comment - Great! Thanks a lot, Anthony. It works perfect on my Moodle1.9.7. I have been waiting for this photo display for years. Also, the picture links to full profile as well! Just one suggestion: Currently, it shows f2.jpg, the smaller one. Can we have the choice to show f1.jpg, the bigger one?
        Hide
        Anthony Borrow added a comment -

        You can try this patch which introduces ##userpicturelarge## which seemed to be the easiest way to implement. Keep in mind that at first this did not appear to be working because my theme (standard) was forcing the .userpicture to display at 35px despite the right file being selected. Peace - Anthony

        Show
        Anthony Borrow added a comment - You can try this patch which introduces ##userpicturelarge## which seemed to be the easiest way to implement. Keep in mind that at first this did not appear to be working because my theme (standard) was forcing the .userpicture to display at 35px despite the right file being selected. Peace - Anthony
        Hide
        Anthony Borrow added a comment -

        Hartmut is requesting a patch for 2.0 (http://moodle.org/mod/forum/discuss.php?d=127757#p756982). Peace - Anthony

        Show
        Anthony Borrow added a comment - Hartmut is requesting a patch for 2.0 ( http://moodle.org/mod/forum/discuss.php?d=127757#p756982 ). Peace - Anthony
        Hide
        Anthony Borrow added a comment -

        Hartmut - Give https://github.com/arborrow/moodle/commit/afa1abd1ccb18bc86a78bab5992cf91cf5b258ff a try and see if that helps. I've not tested it but the print_user_picture function is deprecated in 2.0 so the basic approach will be something along these lines. Peace - Anthony

        Show
        Anthony Borrow added a comment - Hartmut - Give https://github.com/arborrow/moodle/commit/afa1abd1ccb18bc86a78bab5992cf91cf5b258ff a try and see if that helps. I've not tested it but the print_user_picture function is deprecated in 2.0 so the basic approach will be something along these lines. Peace - Anthony
        Hide
        Anthony Borrow added a comment -

        Hartmut - Actually I got to work and tested what I did when I was half awake this morning and of course it did not work so save yourself the trouble. Here is a patch file and the branch can be checked out at https://github.com/arborrow/moodle/tree/MDL-20053. Let me know if you have any questions. There may have been a better way of avoiding getting the whole user record; however, user_picture was throwing an error when I tried to be more minimalistic so I figured I would just use what worked. Peace - Anthony

        Show
        Anthony Borrow added a comment - Hartmut - Actually I got to work and tested what I did when I was half awake this morning and of course it did not work so save yourself the trouble. Here is a patch file and the branch can be checked out at https://github.com/arborrow/moodle/tree/MDL-20053 . Let me know if you have any questions. There may have been a better way of avoiding getting the whole user record; however, user_picture was throwing an error when I tried to be more minimalistic so I figured I would just use what worked. Peace - Anthony
        Hide
        Anthony Borrow added a comment -

        updated patch file with courseid parameter

        Show
        Anthony Borrow added a comment - updated patch file with courseid parameter
        Hide
        Helen Foster added a comment -

        Adrian, I'm just adding you, as database activity component lead, as a watcher, hoping you can take a look at this issue.

        Show
        Helen Foster added a comment - Adrian, I'm just adding you, as database activity component lead, as a watcher, hoping you can take a look at this issue.

          People

          • Votes:
            7 Vote for this issue
            Watchers:
            7 Start watching this issue

            Dates

            • Created:
              Updated: