Changelog:
View iionly's plugins
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.
is this a new update?
It works perfectly!! Thank you very much @iionly for the quick response and fix
it does! thank you this is a really good plugin : )
@Michele: sounds like a bug. I guess the problem is within the Badges plugin and not the Userpoints plugin. I will have to test it to be sure but I think the userpoints will get awarded correctly. Most likely it's the logic within the Badges plugin that assigns the badge that is faulty in the sense of assigning the badge always to the logged in user instead of the user who actually received the points because the possibility of manually assigning of points to a user by the admin was simply not taken into account. Let's see if I can fix it...
i have a problem when i delete people i get this error
Unsupported operand types in /home/user/public_html/ssite.com/mod/elggx_userpoints/start.php on line 293
There's a metadata field added to the user entities by the userpoints plugin to save the current number of userpoints of this user. The error you see is caused by the value saved in this field being invalid (not a number and therefore not the current number of points of this user). Of course, it should not happen that the metadata field gets invalid but sometimes it happens nonetheless (my guess is due to some server glitches). A sign that something is wrong with the metadata field is that instead if the number of points "Array" is displayed on a profile page.
The userpoints plugin has an option on its settings page to restore the metadata field value (by re-calculating the number of points gained based on existing content entities of this user account). You can also let the metada fields of all user accounts re-calculated. So, if account deletion fails, you should restore the metadata field of this account first and then retry.
i see i will try that thank you : ) retore meta data
i tried still shows error when i delete a user or other actions, for now i delted line 293 will that be ok?
Without line 293 the number of userpoints shown for your users on your site will no longer get updated when they get new userpoints.
Does the user account get deleted when the error occurs or not? If not, what is shown on the profile page below of the profile image area where the number of userpoints should be shown? Do you see the word "Array" instead of the number of userpoints? If that's the case, does restoring the userpoints changes anything?
oh i see, the user account does not get deleted and i get a fatal error line 293 start.php on this plugin, i did before get array and when i restored i had 3099 user points only had 400 before i will download this plugin again and try using 1.8.1.6
all fixed now thanks to your advice above : )
Works perfectly. A suggestion: A small icon/image that beside or above the text in the user profile.
@Nefea: I'm afraid I don't fully understand what you are suggesting. What kind of image / what purpose do you have in mind? If you only have a static image/icon in mind (same image for all users), you could modify elggx_userpoints/views/default/elggx_userpoints/icon.php accordingly for the image to be displayed or modify the userpoints_profile class in elggx_userpoints/views/default/elggx_userpoints/css.php. If you have something different in mind there might be other changes necessary but I have no idea what you do have in mind then.
Instead of the text point, a small image of something or a choice of text or image.
Another thing, being the admin my point show up in an odd way. The points I give myself show up as - 1000. Maybe an option to give choosen members unlimited points that doesn't show on their profile?
Nefea, what you mean is already made by the same author, Elggx badges and it works perfectly together with the userpoint plugin.
http://community.elgg.org/plugins/834800/1.8.10/elgg-1819-elggx-badges
@Nefea As I said, you can modify elggx_userpoints/views/default/elggx_userpoints/icon.php according to your needs, if you want an image instead of the number of points or in addition to the number of points respectively to be displayed. I don't see any sense in replacing the number of points by a image though. After all the users should be able to see how many points they have, shouldn't they? Therefore, I won't make such a modification in the code in the published version of the Userpoints plugin. Likewise, an image in addition to the number of points is something that seems not something that is really necessary for everyone. Starting with the selection of the image already this seems rather something that will not fit every site. As I said, if you want to have this on your site, you can modify elggx_userpoints/views/default/elggx_userpoints/icon.php to your liking.
Regarding manual adding of points I can't see any issues when awarding the points to myself. It shows the updated number of points on my profile page as expected. An "unlimited" number of points for certain users is not possible. The metadata entry in the database must always be a number within the allowed numerical range (even if the number is very, very large). The only way I can think of to simulate an unlimited number would be by adding a plugin hook handler that sets/resets a user's userpoints to a predefined number for example at login or when the user's gains or loses points. Sounds much like cheating to me though. If you think you need such a feature I'm afraid you will have to implement it on your own though. The plugin hook handler approach should work even if I can't explain it in every detail.
@driesdk: thanks. Maybe that's the solution. I wasn't aware that Nefea might have badges in mind as it sounded to me he wanted rather a static image - and I did ask for more details. If he would have said "images to be displayed depending on the number of points" most likely even I would have understood. :-)
@iionly I would like to award users for adding an object of my custom entity. How may I do this please?
@Ryan: take a look at mod/elggx_userpoints/views/default/elggx_userpoints/actions.php. This view contains the configuration of the plugin settings that correspond to awarding of userpoints. In case of an object with subtype "custom_subtype" you would have to add a new plugin setting here:
So, subtype of object = name of plugin setting. Then you need to add the label 'userpoints_standard:custom_subtype' to the language file and you're done. You can configure the number of points to be awarded on object creation in the usual way and it should work.
Hi,
I also go this error
[Thu Feb 27 11:11:09 2014] [error] [client 81.30.38.67] PHP Fatal error: Unsupported operand types in /home/sites/site40042/subdomains/intra/mod/elggx_userpoints/start.php on line 293
Can you put some error handling code in start.php so that the corrupted data will not influence the sites behaviour?
@Tauvic: I can try but I can't say if it will work. The problem is that I was never able to reproduce this issue so far, so it kind of difficult to implement a catch for the error.
@iionly - Worked like magic! Amazingly simple. Thanks :)
Your plugin is great. @iionly, how can I add the top users to the custom index?
Thanks.
@Tokiso: in case you use the Widget Manager plugin also for configuring the index page of your site (instead of configuring it with the custom_index plugin) the Userpoints plugin already comes with an index page widget you can select.
In case you don't use the Widget Manager plugin you can add the following code at the approriate place in mod/custom_index/views/default/page/layouts/custom_index.php to add a toppoints widget to your index page. Appropriate place means you have to decide in with column and at which position the widget should be added.