function get_user_avatar($email, $s = 80, $class = '', $d = 'mm', $r = 'g', $img = false) { $url = 'http://www.gravatar.com/avatar/'; $url .= md5(strtolower(trim($email))); $url .= "?s=200&d={$d}&r={$r}"; $avatarsize = getimagesize($url); $avatar = '<img src="' . $url . '" ' . imgResize($avatarsize[1], $avatarsize[1], $s) . ' class="' . $class . '" />'; return Hooks::apply_filter('user_avatar', $avatar, $email, $s); }
/** * Function for retrieving a person's * uploaded school photo. * * @since 4.5 * @param int $id * Person ID. * @param string $email * Email of the requested person. * @param int $s * Size of the photo. * @param string $class * HTML element for CSS. * @return mixed */ function getSchoolPhoto($id, $email, $s = 80, $class = 'thumb') { $app = \Liten\Liten::getInstance(); $nae = $app->db->person()->select('photo')->where('personID = ?', $id)->_and_()->where('photo <> ""')->_and_()->where('photo <> "NULL"')->findOne(); if ($nae !== false) { $photosize = getimagesize(get_base_url() . 'static/photos/' . $nae->photo); if (getPathInfo('/form/photo/') === '/form/photo/') { $avatar = '<a href="' . get_base_url() . 'form/deleteSchoolPhoto/"><img src="' . get_base_url() . 'static/photos/' . $nae->photo . '" ' . imgResize($photosize[1], $photosize[1], $s) . ' alt="' . get_name($id) . '" class="' . $class . '" /></a>'; } else { $avatar = '<img src="' . get_base_url() . 'static/photos/' . $nae->photo . '" ' . imgResize($photosize[1], $photosize[1], $s) . ' alt="' . get_name($id) . '" class="' . $class . '" />'; } } else { $avatar = get_user_avatar($email, $s, $class); } return $avatar; }