[Elgg 1.8-1.12 & 2.X & 3.X: Elggx Userpoints] v1.8.5

Release Notes


  • Fixed pagination on list, detail and moderate tabs on Elggx Userpoints plugin settings page.
  • Hello it looks like there is still some weirdness going on with this.  See my reply here: http://community.elgg.org/discussion/view/1223274/error-fatal-500-internal-server-error  It definitely still occurs for me with this version but it is on an existing install which started off with a earlier version.  Currently I have the plugin disabled.

    Like Wogker it just suddenly happened after being fine for a while with no other config changes.  Also it's a fairly large site and coincidentally (?) when I noticed the issue it was after being hit by a moderate spambot attack after things have been quiet for a while.  Interesting parallels there with Wogker.  I'm unsure if it's meaningful.  Let me know if I can help troubleshoot or you have new code for me to try.  I did the upgrade to this version by disabling the plugin, unzipping over the existing plugin, then re-enabling.  Let me know if  should use another procedure instead.

  • @gts fan9: please try the following: first I would suggest to validate your database using the Database Validator plugin. If you deleted spam accounts after a spam bots attack it's always good to check if there might have remained some entities with errors. This is not only helpful in case of the issue with the Elggx Userpoints plugin.

    The issue with the error 500 on adding userpoints (it does occur then, does it?) will not automatically be solved just by upgrading the plugin to the latest version. I still haven't found out why the issue does actually starting to occur. The problem is that the metadata that contains user's number of userpoints seems to get corrupted under some bad circumstances. As soon as the metadata entry does not contain a number anymore adding new points will fail. If you would check your server logs, you should notice some log entries that coincidence with the error 500 appearances.

    Now to fix the problem, the Elggx Userpoints plugin now offers an option to restore the userpoints metadata. Go to the Elggx Userpoints settings page (Administer - Utilities - Elggx Userpoints). You will see the options to restore the userpoints metadata entry of a single account or for all accounts. Use any of these options (maybe "Restore all" is better suited in your case). These options re-calculate the current number of userpoints of a member by adding up the user's userpoints annotations. In the end all accounts should have a valid metadata entry again and there shouldn't be anymore error 500 on adding new userpoints.

  • I tested this plugin in different conditions because it is very interesting for my website. Overall works well but when, for example, have a hundred or more online users the web is very slow and I have to disable it temporarily. I understand that this is normal because this plugin generates many calls to the database. I recommend it, it is an excellent job of iionly!

  • Hey, I was trying (no sucess) to implant it in my groups this way:

    In the right side of my groups layout, I wanted to list the 'top points' plugin, but showing only the members of the group, not the entire site members...for example, I have a group with 10 members, so I wanted to show, in the group, the top 5 of these members.


    Well, I need help, Thanks since now and keep the great job.


  • @Phil: I'm not sure if you mean to show the top users of a group in the sidebar or in the right column of the groups' profile pages. I also don't know what problem exactly you are stuck with. A view that could be included could be the following:


    $limit = 5;

    $options = array('type' => 'user',
                     'limit' => $limit,
                     'relationship' => 'member',
                     'relationship_guid' => $vars['entity']->guid,
                     'inverse_relationship' => true,
                     'order_by_metadata' =>  array('name' => 'userpoints_points', 'direction' => DESC, 'as' => integer));
    $options['metadata_name_value_pairs'] = array(array('name' => 'userpoints_points', 'value' => 0,  'operand' => '>'));
    $entities = elgg_get_entities_from_relationship($options);

    $html = '';

    foreach ($entities as $entity) {

        $icon = elgg_view_entity_icon($entity, 'small');
        $branding = (abs($entity->userpoints_points) > 1) ? elgg_echo('elggx_userpoints:lowerplural') : elgg_echo('elggx_userpoints:lowersingular');
        $info = "<a href=\"{$entity->getURL()}\">{$entity->name}</a><br><b>{$entity->userpoints_points} $branding</b>";
        $html .= elgg_view('page/components/image_block', array('image' => $icon, 'body' => $info));

    echo $html;

    I've not tested the code but it should filter the group members of the current group and then list them based on their userpoints. How exactly proceed further with this view file depends on where you want to add it. One way would be to extend the sidebar within the group context with this view. Or in case you are using the widget manager plugin you could create a groups widget on the group's profile pages. Or you could create a group_tools module (like blogs etc.) that would add the view on profile pages when not using the widget manager plugin.

  • Hi,

    First of all let me tell you how much I really appreciate you for putting this plugin.

    While working on my site I found that the plugin is creating a lot of junk entries for the events which we have not configured. For eg: I have not configured points for login. But still I see entries like "0 points awarded for : Login".

    I am getting this kind of entries for all the unconfigured event in the plugin.

    I thin a check to see if configuration is blank thaen do not try to create any userpoint object would be nice.

  • @itsGaurab: when you say "events which we have not configured" does this mean there's no value within these input fields on the userpoints plugin points settings page or do you have entered "0" as value? I just did some brief testing both with the login userpoints awarding and also as a second case with awarding points for comments. When I don't enter any value in these point setting input fields there are no entries created. With "0" there is a new entry - with 0 points obviously.

    So, if you don't want to use some events then don't enter any value or delete any values and save the settings again. If this still does not work it might be a bug - though I don't know right now what would cause it.

  • I never entered any value in those fields. I will try saving the settings as suggested and see what happens. Thanks :)

  • Thanks a lot iionly for reviving good plugins!

    This is an interesting plugin. It lets you earn points. As far as I can see (pls correct me if wrong), there is currently no way of "spending" these points. Other than the badge. I read that Divagater had originally implemented a gateway to 'Classifieds' plugin. That plugin unfortunately does not exist anymore but it would be interesting if some other plugins (e.g. Market, Freelance, Discount Vouchers etc) would accept "Elgg User points". Some kind of "Elgg bitcoins"... Could be useful for the sites where people want to pay back in a way other than money... regards.

  • Beside spending points on bagdes you can also spend them on gifts (http://community.elgg.org/plugins/834971/1.8.1/elgg-18-gifts).

    I don't know if the Classified plugin allowed spending userpoints. Right now it's rather the other way round, i.e. you can gain points for postings an item via the Classified plugin. I doubt that it was ever possible to spent points in the Classified plugin though. I think what you mean by "gateway" is the Userpoints plugin API that can be used by any other plugin if necessary. The gifts and badges plugin do it already.

    The market plugin or any other similar plugin could also be modified to allow for spending userpoints. Though I'm not sure how this could work out exactly. My personal interest is also not really on these type of plugins (i.e. I wouldn't need them for myself and therefore I have to spend the time on other plugin projects unfortunately). But anyone who wants to implement a way of spending userpoints within the Market, Freelance or other plugins can do so (are these plugins GPL anyway?).

    Last year I had started a simple plugin to allow for two other ways of spending userpoints: one way would be to transfer them directly to another account (making userpoints as a gift instead of buying a gift with userpoints). The second option suggested by Speedynails was a simple gamble mechanism. If I remember correctly you had to guess a number. If the randomly created game result is the same number you would gain userpoints (depending on how much you gambled for) and otherwise the points were lost. Let's see when I will have the time to finish this plugin.

    Gaming would also be a possible way of spending userpoints. I can imagine it would be possible to allow playing a game that's available on your site only by spending a certain amount of userpoints. The Userpoints plugin API is ready to be used. It only requires someone who codes it...

  • Indeed there is also the Gifts plugin! You are most likely right about the way the Classifieds was integrated into the userpoints. All I know is it had some integration with the userpoints. Indeed gaming is also a potential consumer of userpoints. I understand nlybe is interested in using userpoints for his vouchers plugin (http://community.elgg.org/plugins/1197146/ For the consumers of userpoints, I would think, integration effort is on the side of the consumer, rather than the userpoints plugin, provided that the userpoints consume-points API is coded. Best Regards.

  • Buying vouchers sounds like it works quite similar to buying gifts. I think the best approach to implement buying vouchers with userpoints would be to study the code of the gifts plugin. It's really quite straightforward and I think it can be added to the vouchers plugin in the same way.

  • <?php

    /* TRADUCCION POR Gonzalo Arroyo de GEARinvent.com */

    $spa = array(
    'admin:administer_utilities:elggx_userpoints' => 'Elggx Userpoints',
    'item:object:userpoint' => 'Puntos del perfil',
    'elggx_userpoints:settings' => 'Parámetros de Plugin',
    'elggx_userpoints:actions' => ' Configuración de Puntos',
    'elggx_userpoints:list' => 'Lista',
    'elggx_userpoints:user' => 'Usuario',
    'elggx_userpoints:action' => 'Acción',
    'elggx_userpoints:reset' => 'Resetear',
    'elggx_userpoints:restore' => 'Restaurar',
    'elggx_userpoints:restore_all' => 'Restaurar todos los Puntos de Usuarios',
    'elggx_userpoints:restore_help' => 'Due to server glitches it can happen sometimes that a user\'s userpoints metadata entry in the database gets corrupted (showing "Array" instead of the number of userpoints on the profile page). If the user\'s userpoints metadata entry is corrupted any further attempts in adding userpoints will fail (resulting in an Internal Server Error 500 even). Restoring the metadata entry is possible by re-calculation of the number of userpoints of this user.<br><b> Please enter here the username of the user account you want to restore the number of userpoints of: </b>',
    'elggx_userpoints:restore_all_help' => 'If a lot of user\'s userpoints metadata entries are corrupted you can also select to restore the corresponding metata entries of all users of your site (Warning: this could take a while if you have a large userbase): ',
    'elggx_userpoints:detail' => 'Detalle',
    'elggx_userpoints:awarded_for' => 'otorgado por',
    'elggx_userpoints:moderate' => 'Moderar',
    'elggx_userpoints:moderate_empty' => 'No hay Puntos esperando moderación.',
    'elggx_userpoints:approved_empty' => 'Este Usuario no ganó ningún Punto todavía.',
    'elggx_userpoints:add' => 'Agregar Puntos',
    'elggx_userpoints:userpoints' => 'Puntos de Usuario',
    'elggx_userpoints:admin' => 'Administración de Puntos de Usuario',
    'elggx_userpoints:admin_settings' => 'Cambiar Configuración Userpoints',
    'elggx_userpoints:pending' => 'Esperando moderación',
    'elggx_userpoints:pending_message' => 'Te ha sido otorgado %d %s esperando moderación.',
    'elggx_userpoints:awarded_message' => 'Ha sido otorgado %d %s.',
    'elggx_userpoints:total' => 'Total',
    'elggx_userpoints:approved' => 'Aprobado',
    'elggx_userpoints:approved_message' => 'El %s ha sido Aprobado.',
    'elggx_userpoints:denied' => 'Denegado',
    'elggx_userpoints:denied_message' => 'El %s ha sido Denegado.',
    'elggx_userpoints:delete' => 'Borrar',
    'elggx_userpoints:deleteconfirm' => 'Estás seguro que queres borrar los Puntos?',
    'elggx_userpoints:delete_success' => 'Correctamente borrados.',
    'elggx_userpoints:settings:expire_after' => 'Expirar Puntos luego de un determinado intervalo de tiempo? ',
    'elggx_userpoints:settings:expire_after:help' => 'Requires the Expiration date plugin and that Elgg cronjobs be configured.',
    'elggx_userpoints:upperplural' => 'Puntos',
    'elggx_userpoints:lowerplural' => 'puntos',
    'elggx_userpoints:lowersingular' => 'punto',
    'elggx_userpoints:settings:yes' => 'Si',
    'elggx_userpoints:settings:no' => 'No',
    'elggx_userpoints:settings:moderated' => 'Moderado',
    'elggx_userpoints:settings:approved' => 'Aprobado',
    'elggx_userpoints:settings:save:ok' => 'Successfully saved the Elggx Userpoints plugin settings.',
    'elggx_userpoints:settings:transaction_status' => 'Estado de transacción? ',
    'elggx_userpoints:settings:transaction_status_info' => 'Select whether all points should be approved automatically, or moderated requiring admin approval.',
    'elggx_userpoints:settings:subtract' => 'Permitir restar Puntos? ',
    'elggx_userpoints:settings:delete' => 'Permitir borrar Puntos? ',
    'elggx_userpoints:settings:delete:note' => 'Note: Points awarded for Elgg annotations (like comments) will not be deleted.',
    'elggx_userpoints:settings:displaymessage' => 'Mostrar un mensaje cuando se otorguen los Puntos? ',
    'elggx_userpoints:settings:never' => 'Nunca',
    'elggx_userpoints:settings:1_hour' => '1 Hora',
    'elggx_userpoints:settings:1_day' => '1 Día',
    'elggx_userpoints:settings:1_week' => '1 Semana',
    'elggx_userpoints:settings:2_weeks' => '2 Semanas',
    'elggx_userpoints:settings:4_weeks' => '4 Semanas',
    'elggx_userpoints:settings:365_days' => '365 Días',
    'elggx_userpoints:settings:toppoints:num' => 'Número de Usuarios a mostrar',
    'elggx_userpoints:settings:profile_display' => 'Mostrar Puntos en Perfil de Usuario? ',
    'elggx_userpoints:toppoints' => 'Puntaje',
    'elggx_userpoints:add:user' => 'Usuario:',
    'elggx_userpoints:add:description' => 'Descripción:',
    'elggx_userpoints:add:success' => 'Se agregaron correctamente %d %s al usuario %s',
    'elggx_userpoints:reset:confirm' => 'Seguro de resetear los Puntos del Usuario %s a 0?',
    'elggx_userpoints:reset:success' => 'Correctamente borrados %s',
    'elggx_userpoints:restore:confirm' => 'Seguro de restaurar los Puntos del Usuario %s?',
    'elggx_userpoints:restore:success' => 'Correctamente restaurados los Puntos del Usuario %s.',
    'elggx_userpoints:restore:error' => '%s no es un nombre de Usuario válido.',
    'elggx_userpoints:restore_all:confirm' => 'Seguro de restaurar los Puntos de todos los Usuarios?',
    'elggx_userpoints:restore_all:success' => 'Correctamente restaurados los Puntos de todos los Usuarios.',
    'elggx_userpoints:reset:all' => 'Resetear todos los Puntos',
    'elggx_userpoints:reset:all:confirm' => 'Seguro de borrar todos los Puntos de los Usuarios a 0?',
    'elggx_userpoints:widget:toppoints:info' => 'Un widget para mostrar los Puntos otorgados.',

    'userpoints_standard:invitesettings' => 'Configuración de Invitaciones',
    'userpoints_standard:misc' => 'Miscelaneo',
    'userpoints_standard:loginsettings' => 'Configuración de Login',
    'userpoints_standard:activities' => 'Actividades Generales',
    'userpoints_standard:classifieds' => 'Plugins Clasificados',
    'userpoints_standard:add_classified' => 'Agregar Clasificado',
    'userpoints_standard:izap_videos' => 'Izap Videos',
    'userpoints_standard:add_video' => 'Agregar Video',
    'userpoints_standard:tidypics' => 'Tidypics',
    'userpoints_standard:fivestar' => 'Elggx Fivestar',
    'userpoints_standard:fivestar_vote' => 'Puntos para votar / ranquear:',
    'userpoints_standard:recommendations' => 'Recomendaciones',
    'userpoints_standard:recommendations:points' => 'Puntos por hacer una recomendación:',
    'userpoints_standard:recommendations:approve' => 'Requerir aprobación:',
    'userpoints_standard:friend' => 'Puntos por hacer un Amigo:',
    'userpoints_standard:blog' => 'Puntos por publicar en Blog:',
    'userpoints_standard:file' => 'Puntos por subir un Archivo:',
    'userpoints_standard:bookmarks' => 'Puntos por agregar una Fuente de Información:',
    'userpoints_standard:invited' => 'Invitar un Amigo',
    'userpoints_standard:verify_email' => 'Validar direcciones de e-mail de Amigos?',
    'userpoints_standard:group' => 'Puntos por comenzar un Grupo:',
    'userpoints_standard:profile' => 'Puntos por editar el Perfil:',
    'userpoints_standard:messageboard' => 'Puntos por publicar un mensaje en un Amigo:',
    'userpoints_standard:page_top' => 'Puntos por agregar una página de Wiki:',
    'userpoints_standard:likes' => 'Puntos por poner "Me gusta" a algún contenido:',
    'userpoints_standard:create_album' => 'Puntos por crear un Album de fotos:',
    'userpoints_standard:upload_photo' => 'Puntos por subir una Foto:',
    'userpoints_standard:comment' => 'Puntos por publicar un comentario:',
    'userpoints_standard:polls' => 'Plugin de Encuestas',
    'userpoints_standard:poll' => 'Puntos por publicar una Encuesta:',
    'userpoints_standard:pollvote' => 'Puntos por votar en una Encuesta:',
    'userpoints_standard:login' => 'Puntos por ingresar al sitio web:',
    'userpoints_standard:phototag' => 'Puntos por etiquetar una Foto:',
    'userpoints_standard:riverpost' => 'Puntos por publicar en Actualizaciones:',
    'userpoints_standard:thewire' => 'Puntos por publicar en Actualizaciones:',
    'userpoints_standard:group_topic_post' => 'Puntos por publicar un tema en un Grupo:',
    'userpoints_standard:invite' => 'Puntos por invitar un Amigo:',
    'userpoints_standard:expire_invite' => 'Expirar Puntos por invitaciones pendientes / Permitir reenviar invitación luego:',
    'userpoints_standard:require_registration' => 'Requerir registro para Amigos invitados?',
    'userpoints_standard:login_threshold' => 'Tiempo antes de otorgar Puntos nuevamente?',
    'userpoints_standard:login_interval' => 'Número de días máximos entre Inicios de Sesión para otorgar Puntos:',
    'userpoints_standard:1hour' => '1 Hora',
    'userpoints_standard:4hours' => '4 Horas',
    'userpoints_standard:8hours' => '8 Horas',
    'userpoints_standard:12hours' => '12 Horas',
    'userpoints_standard:1day' => '1 Día',
    'userpoints_standard:1week' => '1 Semana',
    'userpoints_standard:1month' => '1 Mes',
    'userpoints_standard:delete' => 'Borrar Puntos si el contenido por el que fueron otorgados se suprimió?',

    add_translation("es", $spa);

  •     'elggx_userpoints:toppoints' => 'Usuarios con mayor puntaje',

  • how do you show the points on the profile page?

  • @Gonzalo: thanks for the Spanish translation.

    What do you mean with showing the points on profile pages? The points are already shown below the profile image on profile pages. Does it not work for you?

  • How can I easily make userpoints plugin work for other plugins apart from the default plugins it works with?

  • It depends on the kind of action within the other plugin(s) you want to award userpoints for. If the action is something like adding content of a specific subtype provided by these other plugin(s), it's not difficult. In this case I would suggest to take a look into the file elggx_userpoints/views/default/elggx_userpoints/actions.php. This file implements the settings page where you can configure the userpoints to be awarded for the different actions. You can simply add another code block of the form


            <td width="40%"><label><?php echo elgg_echo('userpoints_standard:blog'); ?></label></td>
            <td><?php echo elgg_view('input/text', array('name' => "params[blog]", 'value' => $plugin->blog)); ?></td>

    but with changing the object's subtype (i.e. "blog" here) to the corresponding object's subtype implemented in the other plugin. You would also want to add a language string of the form 'userpoints_standard:NEW_SUBTYPE' to the language files to have a nice text output on the settings page. Everything else (awarding / removal of userpoints) works automatically then for these kind of actions where userpoints are to be added on addition of a content object of a specific subtype.

    Other kind of actions might be more difficult to implement. I can't give some general advice here as it depends on the circumstances involved. The Userpoints plugin offers some functions it uses itself for more other kind of actions (e.g. logging in / inviting people etc.) where the simple case of content added is not fullfilled. But these functions can also be used by other plugins to implement scenarios where userpoints are involved (the Gifts and Badges plugins are examples of plugins that make use of these functions).

  • OK thanks..I will give it a try


  • Category: Misc
  • License: GNU General Public License (GPL) version 2
  • Updated: 2021-2-14
  • Downloads: 14165
  • Recommendations: 47

Other Projects

View iionly's plugins