Simple Machines Community Forum

Customizing SMF => Modifications and Packages => Topic started by: Oldiesmann on May 13, 2005, 05:52:48 PM

Title: Additional Avatar Permissions
Post by: Oldiesmann on May 13, 2005, 05:52:48 PM
Link to Mod (http://mods.simplemachines.org/index.php?mod=129)

This mod adds two more avatar-related permissions to SMF:

profile_avatar_allow ("Can use avatars") - controls whether users in that group can use avatars at all.

profile_avatar_upload ("Can upload their own avatar") - controls whether or not the "upload avatar" feature is available to that group.

This allows you to do the following:
Disable avatars on a group-by-group basis
Specify which avatar options are available to which groups.

Note: These permissions work alongside the existing settings in the "Avatars" section of the "Edit Features and Options" area. If you don't have a particular avatar option enabled, it won't be available to anyone, regardless of what the permissions say. See the included readme for more information.
Title: Re: Additional Avatar Permissions
Post by: Miraenda on May 14, 2005, 01:44:12 AM
Sounds like a great mod Oldiesmann (https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fbestgarden.net%2Fsmilies%2Fthumb.gif&hash=fef4d25799562c6654bc97f1e645bdea20079cd9)
Title: Re: Additional Avatar Permissions
Post by: diva_uno on May 14, 2005, 04:25:19 AM
Oldiesmann

You are super-dee-duper!!!
Thank you soo much for hearing my plea!
:D
Title: Re: Additional Avatar Permissions
Post by: diva_uno on May 14, 2005, 05:16:07 AM
Added this to my board...
I have the permissions on disallow for the groups I'm disallowing. And allow for the others.
However if I click on "Forum Profile Information" under the profile section and I'm not logged in as the Admin... I recieve this error at the bottom of the page.

An Error Has Occurred!
implode(): Bad arguments.


But upload does not show up for the groups that are disallowed...so that works. However...I will have to ask some of my members to check that out...because I only have 2 accounts I can test that out on. A newbie account...and a Sr. Member account that is the second admin which I turned off to test.
Title: Re: Additional Avatar Permissions
Post by: Oldiesmann on May 14, 2005, 05:17:28 PM
That's really weird. The implode() there is the thing that loads all the server-stored avatars. The only thing I did there was replaced a line to tell it whether or not to show that. If they don't have permission to use avatars, they shouldn't see anything there. I'm not sure why you'd be getting that.
Title: Re: Additional Avatar Permissions
Post by: diva_uno on May 14, 2005, 06:06:14 PM
Oh...
Yeah...
The avatars that are saved on the server don't show up to chose one of those...
Title: Re: Additional Avatar Permissions
Post by: Oldiesmann on May 16, 2005, 02:27:12 PM
Admin -> Edit Permissions

Check the box next to each membergroup, and select "Choose an avatar ()" next to "Add permission..." (either one of those options should set it), and click "Set Permissions!". I am not sure why "Choose an avatar" is showing up twice or why there is missing text there. I will look more into this later and release an update as soon as I fix the problem (the update will also ensure that the permission is enabled by default).
Title: Re: Additional Avatar Permissions
Post by: Oldiesmann on May 16, 2005, 03:02:58 PM
Ok. I looked over the mod and located the source of the bug. Turns out I mis-read something and thought that one section was setting default permissions, when it was actually specifying whether each permission was a single one or an "any/own" permission, so I accidentally set that one to an "any/own" instead of a single one. I am working on an upgrade and will upload it shortly.
Title: Re: Additional Avatar Permissions
Post by: Oldiesmann on May 16, 2005, 04:40:23 PM
Update released. Just download it again and it will upgrade for you. This will also set the "Can choose avatar" permission to "Allow" for all non-post-based groups (including "ungrouped members"). You will still have to set the permission to upload avatars for each group.
Title: Re: Additional Avatar Permissions
Post by: robone on May 18, 2005, 03:57:32 AM
I should have come back to this forum. I have been having the same problem. The only person who could upload avatars was me (admin). I will update tonight and see. Does the update automatically update or must I uninstall the previous version?
Title: Re: Additional Avatar Permissions
Post by: robone on May 18, 2005, 01:50:15 PM
Well I did what you suggested and there was an error (failure) on one of the mdifications when installing the Mod 1.01 but I continued anyway, however it still did not work and the same problems are still happening as were happening with the previous version.

I then tried to uninstall it so I could install it cleanly and I get the following:

Type     Action     Description
1.    Execute Modification    ./Sources/ManagePermissions.php    Failure
2.    Execute Modification    ./Sources/Profile.php    Failure
3.    Execute Modification    ./Themes/default/Profile.template.php    Success
4.    Execute Modification    ./Themes/default/languages/Modifications.english.php    Failure

So I never continued with the unistall

Help!!!!
Title: Re: Additional Avatar Permissions
Post by: Oldiesmann on May 18, 2005, 02:25:14 PM
Hmmm... Not sure why the upgrade wasn't working, but I fixed the problem. I also noticed that I forgot to include the new step to automatically enable the "can use avatars" permission (you will still have to set the "Can upload their own avatar?" permission yourself), and added that to the upgrade. Try it now.
Title: Re: Additional Avatar Permissions
Post by: robone on May 18, 2005, 02:54:58 PM
At the moment I have to leave the forum alone, because I am going away tomorrow for 2 weeks.

As administrator I can upload pics for the groups I have given permissions to, so if they want they will have to email me the avatar they want and I wil have to upload. But no one else can access the SMF avatars.

Also I actually don't quite understand what you are asking me to do so I will rather leave it alone for the moment and while I am away, maybe someone else can resolve this
Title: Re: Additional Avatar Permissions
Post by: robone on May 19, 2005, 03:34:09 AM
These are the errors shown in the error log when I go "edit features and options" and only have a look. Not trying to change anything

log 1

8: Undefined index: permissionname_profile_use_avatar_own
File: ..........................................................................forum/Sources/ManagePermissions.php
Line: 1098

log 2

8: Undefined index: permissionname_profile_use_avatar_any
File: ............................................................................forum/Sources/ManagePermissions.php
Line: 1102

Thanks
Title: Re: Additional Avatar Permissions
Post by: diva_uno on May 20, 2005, 02:55:30 PM
I got it to work! You just need to edit the permissions to allow for "choose an avatar" and "choose a remotely stored avatar". And then disallow for "Can upload their own avatar?". The upload option appears when they go to their profile and choose Forum Profile Information to choose an avatar. But it they try to upload something it just doesn't upload.

I know I might recieve some messages something is wrong because they can't upload an avatar so this is something I'm going to have to announce.

Thanks again Oldiesmann
Title: Re: Additional Avatar Permissions
Post by: robone on May 21, 2005, 11:21:42 AM
Sorry, but I only want them to upload there own avatar, so I need to get this to work
Title: Re: Additional Avatar Permissions
Post by: Oldiesmann on May 23, 2005, 09:30:25 AM
Set "Can use a remote avatar" to "disallow" and the other two to "allow". They will still be able to use a server-stored avatar unless you completely disable that for everyone (I don't see any point in having a permission to not allow that). And it shouldn't even show an upload box if they can't upload their own avatar, unless I'm completely missing something.
Title: Re: Additional Avatar Permissions
Post by: robone on May 23, 2005, 12:44:08 PM
Okay I have done that but I am still getting errors such as:

8: Undefined index: permissionname_profile_use_avatar_own
File: ..............................................................forum/Sources/ManagePermissions.php
Line: 1098

and the errors logged when a member wants to change their avatar is:

8: Undefined index: avatar_list
File: ................................................................forum/Themes/default/Profile.template.php (eval?)
Line: 1018

Now...what I think I have to do is uninstall and re install again, but then I look at my errors produced when I try and uninstall ...see post of 18th....do you think I can just continue and unistall.
Title: Re: Additional Avatar Permissions
Post by: Oldiesmann on May 25, 2005, 08:34:46 PM
Just re-upload Sources/ManagePermissions.php, Sources/Profile.php and Themes/default/Modifications.english.php, delete the list of installed mods (Admin -> Package Manager -> View and Delete Installed Packages -> Delete Mod List). Of course, this is assuming that the Additional Avatar Permissions mod is the only mod you have installed.
Title: Re: Additional Avatar Permissions
Post by: robone on May 26, 2005, 12:21:19 PM
Thanks, but unfortunately it is not, so That I cannot do. Maybe you could tell me what I have to do to manually correct those errors that are occuring at the various lines.

I think when I installed this mod, it probably does not take into account the fact that I did have other mods installed and that is why I have errors at lthose lines occuring.

I am not complaining, not much anyway :) , but I would like to resolve this and use this mod. I have 3 other mods installed and I never had any problems with them.

Just for interest they are:

ultimate shout mod
online users today mod
integrated chat mod

Thanks

Title: Re: Additional Avatar Permissions
Post by: Oldiesmann on May 31, 2005, 03:54:45 PM
Download Packages/installed.list from your server via FTP, open it up, and delete the line dealing with my package. Then re-upload it (overwriting the current one), and re-upload Sources/ManagePermissions.php, Sources/Profile.php and Themes/default/Profile.template.php. None of the mods you have installed now would have made any modifications to those files, so re-uploading them shouldn't cause any problems.
Title: Re: Additional Avatar Permissions
Post by: robone on May 31, 2005, 07:51:42 PM
Thanks. I am in LA at the moment and New York tomorrow so I will do this when I get back to Johannesburg South Africa
Title: Re: Additional Avatar Permissions
Post by: robone on June 30, 2005, 12:25:21 PM
Okay  did as suggested...eventually and when I tried to install mod I got this:

Installing this package will perform the following actions:
   Type    Action    Description
1.    Execute Modification    ./Sources/ManagePermissions.php    Failure
2.    Execute Modification    ./Sources/Profile.php    Failure
3.    Execute Modification    ./Themes/default/Profile.template.php    Failure
4.    Execute Modification    ./Themes/default/languages/Modifications.english.php    Success

So I have not continued.

Mind you since the last time I have installed a few more mods.

Upgraded to 1.05
and Gmail mod.

Can you tell me how I can do this installation manually?
Title: Re: Additional Avatar Permissions
Post by: robone on July 02, 2005, 06:23:56 AM
Okay, now I know there will be failures, because the changes to those files had a happened previously and in modification.xml it searchs for certain text, which it won't find, because the mods had already been implemented.

So I went into each of the files and checked that each of the changes that you have programmed to take place, actually did make the changes, and they have. All the changes have been implemented in each of the files, exactly as per your .xml files

This has me now completely bamboozled.

The only change that does not tie up is the change in you upgrade.xml which requires that 'profile_use_avatar' => false whereas mine says true in the managepermissions.php. I don't see this as a problem as I think this is changed because i set it that way in the way I have set up the permissions.

Anyhelp will do because at the moment I have had to turn off all permissions and must change the avatars myself.....not what I call fun.

Maybe I should up grade to smf 1.1!!!

Title: Re: Additional Avatar Permissions
Post by: robone on July 06, 2005, 01:01:50 PM
Bump...just so oldiesmann can see this...or anyone...some help would be great.
Title: Re: Additional Avatar Permissions
Post by: Vranx on October 28, 2005, 11:35:30 AM
I couldnt get this to install into SMF 1.1 rc1.
Title: Re: Additional Avatar Permissions
Post by: Krysia on December 06, 2006, 12:10:10 PM
This seems like a wonderful mod, especially for those of us who like to have "reward-esque" type features for our posters.

I'm wondering a couple of things. Firstly, if there'll be an update to 1.1 compatibility?

Another thing I was wondering, is if it'd be possible to make some kind of tweakage to this mod so that not only can you decide whether or not a group is permitted an avatar, you can decide which avatars a group is permitted to use based on post-count.

I've seen this in action (http://www.tarotforum.net/misc.php?do=showavatars) on a different forum, where they have it set up as follows:
Standard Avatars Requiring at Least 0 Posts >Lists<
Standard Avatars Requiring at Least 100 Posts >Lists<
Standard Avatars Requiring at Least 250 Posts >Lists<


I think it'd be fun to have it coincide with post count as well. :)