SMF Development > Bug Reports
"No Avatar" Radio Button Always Displayed in Profile
emanuele:
That's what I was thinking: https://gist.github.com/536454077e3982723843
But at the moment I'm not sure if the 'enable' is taken in consideration when saving the form.
archiebald:
--- Quote from: emanuele on June 05, 2012, 12:33:41 PM ---That what I was wondering me too...on the other hand which other way there is to allow someone to use an avatar apart from those three?
If you remove those three permissions the users will be de facto unable to select an avatar.
--- End quote ---
That is what I need and that is how it worked in previous 1.xx versions, I believe there was an admin permission setting for something like "allow users to select their own avatar". If it was unchecked, then nothing regarding avatars would appear on the user's profile page. This is how I had it set up before and never had an issue. All user avatars were pre-set by the admins using company ID photos.
I guess something was changed in 2.xx but I only noticed this behavior recently because a member edited their date of birth and their avatar disappeared.
Just to clarify the scenario, this is in a forum used for global communication between company employees in various countries. New members cannot create their own account - all sign-ups are made by the admins so that membership is strictly controlled to employees only and we assign them an avatar when we create the account.
emanuele:
The thing changed from 1.x to 2.0 is the fact that in 2.0 there is the option to select "no avatar". ;)
kirbyiwaki:
Is there a fix for this? I reverted to let users choose, but I wish I could just change some code and keep it as is.
emanuele:
What you can quickly do is, in Profile.template.php:
--- Code: (find) ---function template_profile_avatar_select()
{
global $context, $txt, $modSettings;
// Start with the upper menu
echo '
--- End code ---
--- Code: (replace with) ---function template_profile_avatar_select()
{
global $context, $txt, $modSettings;
if (empty($context['member']['avatar']['allow_server_stored']) && empty($context['member']['avatar']['allow_external']) && empty($context['member']['avatar']['allow_upload']))
return;
// Start with the upper menu
echo '
--- End code ---
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version