function get_avatar_url($uid, $size = 'min') { $uid = intval($uid); if (!$uid) { return G_STATIC_URL . '/common/' . $size . '-img.jpg'; } //get avatar url in ucenter if (get_setting('ucenter_enabled') == 'Y') { $user_info = AWS_APP::model('account')->get_user_info_by_uid($uid); if($user_info) { $uc_uid = AWS_APP::model('ucenter')->is_uc_user($user_info['email']); if($uc_uid) { return 'http://YOUR_UC_PATH/avatar.php?uid='. $uc_uid . '&size=small'; } } } foreach (AWS_APP::config()->get('image')->avatar_thumbnail as $key => $val) { $all_size[] = $key; } $size = in_array($size, $all_size) ? $size : $all_size[0]; $uid = sprintf("%09d", $uid); $dir1 = substr($uid, 0, 3); $dir2 = substr($uid, 3, 2); $dir3 = substr($uid, 5, 2); if (file_exists(get_setting('upload_dir') . '/avatar/' . $dir1 . '/' . $dir2 . '/' . $dir3 . '/' . substr($uid, - 2) . '_avatar_' . $size . '.jpg')) { return get_setting('upload_url') . '/avatar/' . $dir1 . '/' . $dir2 . '/' . $dir3 . '/' . substr($uid, - 2) . '_avatar_' . $size . '.jpg'; } else { return G_STATIC_URL . '/common/' . $size . '-img.jpg'; } }
AI智能回复搜索中,请稍后...
这家伙很懒,还没有设置简介