Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

Default photo

This discussion is related to the IndexPhotos addon.

Any way to add a default photo for those users that haven't uploaded a photo yet. I'm using 2.1 if that makes a difference.

Comments

  • KasperKasper Scholar of the Bits Copenhagen Vanilla Staff
    edited January 2013

    The Vanillicon and Gravatar plugins do it like this:

    class YourPlugin extends Gdn_Plugin {
        public function ProfileController_AfterAddSideMenu_Handler($Sender, $Args) {
            if (!$Sender->User->Photo) {
                $Sender->User->Photo = "http://whatever.com/neat.png";
            }
        }
    }
    
    if (!function_exists("UserPhotoDefaultUrl")) {
        function UserPhotoDefaultUrl($User, $Options = array()) {
            $PhotoUrl = "http://whatever.com/neat.png";
            return $PhotoUrl;
        }
    }
    

    Kasper Kronborg Isager (kasperisager) | Freelance Developer @Vanilla | Hit me up: Google Mail or Vanilla Mail | Find me on GitHub

    UnderDogDirtyDogbusinessdad
Sign In or Register to comment.