Fancy Avatar
Automatically assigns unique DiceBear avatars to users without custom avatars. New registrations receive DiceBear avatars based on their username.
Change Log
STABLE
1.1.0
Jul 28, 2026
Provider System (New)
- Multi-provider support — DiceBear, UI Avatars, and Avataaars.
- Provider Dispatcher — `fancyavatar_generate_url()` automatically routes requests to the appropriate provider.
- DiceBear — Supports 24+ artistic styles using the 7.x API with configurable style, background, shape, mouth, and expression parameters.
- UI Avatars — Generates initials-based avatars with configurable color, bold text, and initials length.
- Avataaars — Creates customizable cartoon avatars using deterministic hash-based parameter selection.
- Provider-Aware Statistics — Admin statistics queries use `fancyavatar_provider_where()` to count users across all supported providers.
- URL Detection — `fancyavatar_is_provider_url()` validates avatar URLs from any supported provider.
- SQL Helper — `fancyavatar_provider_where()` generates SQL WHERE clauses for all supported provider URLs.
Settings (Refactored)
- `settings.json` is now the single source of truth for all 16 plugin settings, replacing hardcoded PHP arrays.
- PluginLibrary loads settings directly from the JSON file via `$PL->settings()`.
- Added provider-specific settings for UI Avatars (`uiavatars_color`, `uiavatars_bold`, `uiavatars_length`) and Avataaars (`avataaars_style`).
- Settings hash now includes all provider options, enabling automatic avatar refresh when configuration changes.
CSS (Refactored)
- Stylesheet is registered through `$PL->stylesheet()` using `Assets/fancyavatar.css`, stored in the database, and cached by the active theme.
- Removed inline CSS from `install.php`.
- Removed `$page->extra_header` injection from the `pre_output_page` hook.
UserCP Shuffle (JS Refactored)
- Client-side JavaScript now generates avatar URLs for all three providers instead of DiceBear only.
- Avataaars uses deterministic hash-based parameter generation in JavaScript, matching the PHP implementation.
- All provider settings are passed to the UserCP template through the `usercp_avatar` hook.
Bug Fixes
- Fixed nested `<form>` issue in UserCP that triggered MyBB core validation by using a dynamically created form with `document.createElement('form').submit()`.
- Added the missing `fancyavatar_ucp_confirm` language string.
- Increased the avatar column from `VARCHAR(200)` to `VARCHAR(500)` to support longer Avataaars URLs.
- Fixed `pre_output_page` hook handling by replacing `</head>` with `str_replace()` instead of using the unavailable `$page` object.
- Fixed language initialization error caused by calling `$l->fancyavatar` before `$lang` was loaded.
- Fixed `modcp_can_manage_user()` being called before the function was available.
- Fixed duplicate `fancyavatar_uninstall_run()` declaration between `install.php` and `uninstall.php`.
Templates
- `fancyavatar_usercp_avatar_option.html` — Multi-provider avatar preview and shuffle interface.
- `fancyavatar_mod_options_change_avatar.html` — Moderator avatar replacement link.
- `fancyavatar_usercp_info.html` — UserCP notification panel.
Admin
- Provider-aware dashboard statistics showing user counts by avatar provider.
- Uses a lightweight bridge module (`admin/modules/user/fancyavatar.php`) that loads `FancyAvatar/Admin/fancyavatar.php`.
Files
- `inc/plugins/fancyavatar.php` — Main plugin entry point, hooks, and automatic refresh logic.
- `inc/plugins/FancyAvatar/Functions/avatar_functions.php` — Provider dispatcher, URL generators, detection, batch update, force refresh, and avatar regeneration.
- `inc/plugins/FancyAvatar/Functions/hook_functions.php` — Hook callback implementations.
- `inc/plugins/FancyAvatar/install.php` — Installation, activation, settings, templates, and stylesheet registration.
- `inc/plugins/FancyAvatar/settings.json` — Plugin settings.
- `inc/plugins/FancyAvatar/Assets/fancyavatar.css` — Plugin stylesheet.
- `inc/plugins/FancyAvatar/Templates/*.html` — Template files.
- `inc/languages/english/fancyavatar.lang.php` — Front-end language strings.
- `inc/languages/english/admin/fancyavatar.lang.php` — Admin Control Panel language strings.
- `admin/modules/user/fancyavatar.php` — Admin module bridge.
