2013-06-12, 01:32 PM
I know it's possible to assign an image to group, but I want to apply a random avatar to every user on the board. Is this possible? I don't want it to change every time they login or post... Just apply a random image to every user within a given group of users...Preferably leaving alone the users who already have an avatar, or to users as they register.
I found this http://mods.mybb.com/view/mydevel-generate which is CLOSE to what I need, but it only applies when creating new random users through the plugin.
This is close as well http://mods.mybb.com/view/default-avatar but it frustratingly only allows a single image as opposed to randomly selecting one from a given directory. Also looks like it would apply only to new signups, not existing users... Which wouldn't be so bad... The main roadblock with this is not allowing a random.
Here's another. Close but no cigar. Sets a default avatar by gender. http://mods.mybb.com/view/default-avatar-by-gender
Yet another. This looks damn close, automatically assigns an avatar at signup, but not at random from a directory... http://mods.mybb.com/view/default-profile-for-1-6
Really surprised no plugin for this yet. To apply a random avatar to users upon registration or to groups of existing users.
Okay, I've found this random image plucker code. Rated high on stack exchange.
But not sure where/how to apply it. I'd like to be able to apply it to everyone on the board who doesn't currently have an avatar and/or apply it to people as they register...
Any ideas?
I found this http://mods.mybb.com/view/mydevel-generate which is CLOSE to what I need, but it only applies when creating new random users through the plugin.
This is close as well http://mods.mybb.com/view/default-avatar but it frustratingly only allows a single image as opposed to randomly selecting one from a given directory. Also looks like it would apply only to new signups, not existing users... Which wouldn't be so bad... The main roadblock with this is not allowing a random.
Here's another. Close but no cigar. Sets a default avatar by gender. http://mods.mybb.com/view/default-avatar-by-gender
Yet another. This looks damn close, automatically assigns an avatar at signup, but not at random from a directory... http://mods.mybb.com/view/default-profile-for-1-6
Really surprised no plugin for this yet. To apply a random avatar to users upon registration or to groups of existing users.
Okay, I've found this random image plucker code. Rated high on stack exchange.
$imagesDir = 'images/tips/';
$images = glob($imagesDir . '*.{jpg,jpeg,png,gif}', GLOB_BRACE);
$randomImage = $images[array_rand($images)];
But not sure where/how to apply it. I'd like to be able to apply it to everyone on the board who doesn't currently have an avatar and/or apply it to people as they register...
Any ideas?