function donut_get_user_avatar( $userid, $size = 40 )
{
if ( !defined( 'QA_WORDPRESS_INTEGRATE_PATH' ) ) {
$useraccount = qa_db_select_with_pending( qa_db_user_account_selectspec( $userid, true ) );
$user_avatar = qa_get_user_avatar_html( $useraccount['flags'], $useraccount['email'], null,
$useraccount['avatarblobid'], $useraccount['avatarwidth'], $useraccount['avatarheight'], $size );
} else {
$user_avatar = qa_get_external_avatar_html( $userid, qa_opt( 'avatar_users_size' ), true );
}
if ( empty( $user_avatar ) ) {
// if the default avatar is not set by the admin , then take the default
$user_avatar = donut_get_default_avatar( $size );
}
return $user_avatar;
}
function qa_get_user_avatar_img($flags, $email, $handle, $blobId, $width, $height, $size, $padding = false)
{
if (qa_to_override(__FUNCTION__)) { $args=func_get_args(); return qa_call_override(__FUNCTION__, $args); }
require_once QA_INCLUDE_DIR . 'app/format.php';
if (strlen($handle) == 0) {
return null;
}
$avatarSource = qa_get_user_avatar_source($flags, $email, $blobId);
switch ($avatarSource) {
case 'gravatar':
$html = qa_get_gravatar_html($email, $size);
break;
case 'local-user':
$html = qa_get_avatar_blob_html($blobId, $width, $height, $size, $padding);
break;
case 'local-default':
$html = qa_get_avatar_blob_html(qa_opt('avatar_default_blobid'), qa_opt('avatar_default_width'), qa_opt('avatar_default_height'), $size, $padding);
break;
default: // NULL
return null;
}
return $html;
}
function donut_get_user_avatar( $userid, $size = 40 )
{
if ( !defined( 'QA_WORDPRESS_INTEGRATE_PATH' ) ) {
$useraccount = qa_db_select_with_pending( qa_db_user_account_selectspec( $userid, true ) );
$user_avatar = qa_get_user_avatar_img(
$useraccount['flags'],
$useraccount['email'],
$useraccount['handle'],
$useraccount['avatarblobid'],
$useraccount['avatarwidth'],
$useraccount['avatarheight'],
$size,
false
);
} else {
$user_avatar = qa_get_external_avatar_html( $userid, qa_opt( 'avatar_users_size' ), true );
}
if ( empty( $user_avatar ) ) {
// if the default avatar is not set by the admin , then take the default
$user_avatar = donut_get_default_avatar( $size );
}
return $user_avatar;
}