X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=classes%2FProfile.php;h=eb29d63a27977cea8a654439b2d500969ffa9904;hb=9bb55af26f47d960cc33b02ec355d832d18b31b7;hp=be4708a5571e24182412792dad007f848f5e5eaf;hpb=0fa97d6e2e296c780db78b7e88d283670adf1226;p=quix0rs-gnu-social.git diff --git a/classes/Profile.php b/classes/Profile.php index be4708a557..eb29d63a27 100644 --- a/classes/Profile.php +++ b/classes/Profile.php @@ -1,4 +1,24 @@ . + */ + +if (!defined('LACONICA')) { exit(1); } + /** * Table Definition for profile */ @@ -25,4 +45,31 @@ class Profile extends DB_DataObject /* the code above is auto generated do not remove the tag below */ ###END_AUTOCODE + + function getAvatar($width, $height=NULL) { + $avatar = DB_DataObject::factory('avatar'); + $avatar->profile_id = $this->id; + $avatar->width = $width; + if (is_null($height)) { + $avatar->height = $width; + } else { + $avatar->height = $height; + } + if ($avatar->find(true)) { + return $avatar; + } else { + return NULL; + } + } + + function getOriginalAvatar() { + $avatar = DB_DataObject::factory('avatar'); + $avatar->profile_id = $this->id; + $avatar->original = true; + if ($avatar->find(true)) { + return $avatar; + } else { + return NULL; + } + } }