We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 28033
    • 925 Posts
    I’m installing WLPE on my website. Right now, all of my web users from PPP don’t have avatars, because PPP didn’t use MODx’s innate photo field.

    The photo field is blank for all of them, so a search+replace won’t work. Does anyone know of a command for phpMyAdmin where it will add this code to everyone’s profile that doesn’t have any text in their photo field?

    assets/snippets/webloginpe/userimages/default_user.jpg


    I’d rather not have to go through all 50+ profile’s fields and have to manually that to all of them...x_x.
      My Snippets
      -> PopUpChunk v1.0
      • 33337
      • 3,975 Posts
      I think the better solution to add a check in snippet which looks for the avatar, and if empty it uses the default one.
        Zaigham R - MODX Professional | Skype | Email | Twitter

        Digging the interwebs for #MODX gems and bringing it to you. modx.link
        • 6726
        • 7,075 Posts
        Or if the avatar field is a TV, no need for a snippet.

        You can set the default value directly in the TV itself. Or use PHx with an ifempty or if... then...else clause which allow a different output if the field is empty = default avatar, if the field has a value = avatar field.

        I’ve done it several times, works like a charm smiley
          .: COO - Commerce Guys - Community Driven Innovation :.


          MODx est l'outil id
          • 26435
          • 1,193 Posts
          Assuming your table prefix is the default "modx_"...
          UPDATE `modx_web_user_attributes`
          SET `photo` = 'assets/snippets/webloginpe/userimages/default_user.jpg'
          WHERE `photo` = ''


          -sD-
          Dr. Scotty Delicious, Scientist DFPA.
            Husband, Father, Brother, Son, Programmer, Atheist, Nurse, Friend, Lover, Fighter.
            All of the above... in no specific order.


            I send pointless little messages
            • 28033
            • 925 Posts
            Quote from: Dr. at Sep 16, 2007, 07:43 AM

            Assuming your table prefix is the default "modx_"...
            UPDATE `modx_web_user_attributes`
            SET `photo` = 'assets/snippets/webloginpe/userimages/default_user.jpg'
            WHERE `photo` = ''


            -sD-
            Dr. Scotty Delicious, Scientist DFPA.

            Thanks, that’s just what I needed. smiley
              My Snippets
              -> PopUpChunk v1.0