Hi,
Could anyone point me the way to a solution to let elgg check how many images a user has with tidypics?
What I basicly want to do is to have a way to define a special role, let's call it 'empty_user' for anyone that has less then 5 images in their account.
I'm using the roles plugin and I would want to role to be set to the 'fedault_role' from the moment that they have more then 5 images in their account.
Thanks!
info@elgg.org
Security issues should be reported to security@elgg.org!
©2014 the Elgg Foundation
Elgg is a registered trademark of Thematic Networks.
Cover image by Raül Utrera is used under Creative Commons license.
Icons by Flaticon and FontAwesome.
- Dries@driesdk

Dries - 0 likes
- Nikolai Shcherbin@rivervanrain

Nikolai Shcherbin - 0 likes
- Dries@driesdk

Dries - 0 likes
- Nikolai Shcherbin@rivervanrain

Nikolai Shcherbin - 0 likes
- Dries@driesdk

Dries - 0 likes
You must log in to post replies.Nobody an idea on how to handle this the most easy way?
I think this should be quite easy together with the roles plugin, probably with this function: function roles_set_role($role, $user = null)
So, should this be in its own plugin, should it be part of tidypics, in the start file, should it be in the startfile of the roles plugin,...?
I think it has to check whether the user has the 'empty_user' role or the 'default' role, and when the user has the 'empty_user' role, it has to check how many images there are in the users account, if it's + 5 it has to set this users role to 'normal'. Next time the plugin checks the users role and sees he has 'default' it can just move on and do nothing.
Am I right here?
Too busy looking for TidyPics settings' code but the general code is:
It's an action for TidyPics plugin or your own theme/plugin
Thanks RvR, though this isn't exactly what I intent to do, but usefull anyway, so thanks :)
With this code I can check what someones role is and do an action.
But I actually want to check what their image count in tidypics is and do an action according to that number, if it's under 5, I want their role to be set to 'novice' or something simmilar and do nothing if it's over 5.
Well, then additional to above code you need to set user' role as:
I don't check it but think that all correct.
Try it.
Hi RvR, sorry for the late reply, but..thank you! :)