Method | Description | |
---|---|---|
createAvatar ( ) | Create an avatar picture (and checks all necessary things too) TODO decouple TODO total rebuild | |
deleteAvatar ( integer $userId ) : boolean | Delete a user's avatar | |
deleteAvatarImageFile ( integer $userId ) : boolean | Removes the avatar image file from the filesystem | |
getGravatarLinkByEmail ( string $email ) : string | Gets a gravatar image link from given email address | |
getPublicAvatarFilePathOfUser ( integer $user_has_avatar, integer $user_id ) : string | Gets the user's avatar file path | |
getPublicUserAvatarFilePathByUserId ( $user_id ) : string | Gets the user's avatar file path | |
isAvatarFolderWritable ( ) : boolean | Checks if the avatar folder exists and is writable | |
resizeAvatarImage ( string $source_image, string $destination, integer $final_width = 44, integer $final_height = 44 ) : boolean | Resize avatar image (while keeping aspect ratio and cropping it off in a clean way). | |
validateImageFile ( ) : boolean | Validates the image Only accepts gif, jpg, png types | |
writeAvatarToDatabase ( $user_id ) | Writes marker to database, saying user has an avatar now |
public static createAvatar ( ) |
public static deleteAvatar ( integer $userId ) : boolean | ||
$userId | integer | |
return | boolean | success |
public static deleteAvatarImageFile ( integer $userId ) : boolean | ||
$userId | integer | |
return | boolean |
public static getGravatarLinkByEmail ( string $email ) : string | ||
string | The email address | |
return | string |
public static getPublicUserAvatarFilePathByUserId ( $user_id ) : string | ||
$user_id | integer The user's id | |
return | string | avatar picture path |
public static isAvatarFolderWritable ( ) : boolean | ||
return | boolean | success status |
public static resizeAvatarImage ( string $source_image, string $destination, integer $final_width = 44, integer $final_height = 44 ) : boolean | ||
$source_image | string | The location to the original raw image |
$destination | string | The location to save the new image |
$final_width | integer | The desired width of the new image |
$final_height | integer | The desired height of the new image |
return | boolean | success state |
public static validateImageFile ( ) : boolean | ||
return | boolean |
public static writeAvatarToDatabase ( $user_id ) | ||
$user_id |