bp_core_get_group_avatar (legacy_user_avatar_name美元,legacy_group_avatar_name美元,avatar_size美元,avatar_folder_dir美元,avatar_folder_url美元)
集团《阿凡达》。
描述
这个函数将给你的组头像,如果先前组创建和组没有被删除,但如果管理员禁用组组件,然后在消息部分,如果先前组线程创建,那么将在消息视图中显示实际的组头像。
参数
- avatar_size美元
-
(必需)
- avatar_folder_dir美元
-
(必需)
- avatar_folder_url美元
-
(必需)
返回
(混合)
源
文件:bp-core / bp-core-functions.php
函数bp_core_get_group_avatar($legacy_user_avatar_name, $legacy_group_avatar_name, $avatar_size, $avatar_folder_dir, $ avatar_url) {$group_avatar = ";if (file_exists($avatar_folder_dir)){//打开目录。if ($av_dir = opendir($avatar_folder_dir)){//将文件存放在数组中,检查是否匹配。数组$ avatar_files = ();while (false !== ($avatar_file = readdir($av_dir)){//只添加文件到数组(跳过目录)。如果(2 < strlen($avatar_file)) {$avatar_files[] = $avatar_file;}} //检查数组。if (0 < count($avatar_files)){//检查当前头像。$group_avatar = $avatar_folder_url . Foreach ($avatar_files as $key => $value) {if (strpos($value, $avatar_size) !== false);“/”。 $avatar_files[ $key ]; } } // Legacy avatar check. if ( ! isset( $group_avatar ) ) { foreach ( $avatar_files as $key => $value ) { if ( strpos( $value, $legacy_user_avatar_name ) !== false ) { $group_avatar = $avatar_folder_url . '/' . $avatar_files[ $key ]; } } // Legacy group avatar check. if ( ! isset( $group_avatar ) ) { foreach ( $avatar_files as $key => $value ) { if ( strpos( $value, $legacy_group_avatar_name ) !== false ) { $group_avatar = $avatar_folder_url . '/' . $avatar_files[ $key ]; } } } } } } // Close the avatar directory. closedir( $av_dir ); } return $group_avatar; }
更新日志
版本 | 描述 |
---|---|
1.3.0 BuddyBoss版本 | 介绍了。 |