Ejemplo n.º 1
0
<?php

/**
* 	Plugin: Valoraciones linguisticas con HFLTS
*	Author: Rosana Montes Soldado
*			Universidad de Granada
*	Licence: 	CC-ByNCSA
*	Reference:	Microproyecto CEI BioTIC Ref. 11-2015
* 	Project coordinator: @rosanamontes
*	Website: http://lsi.ugr.es/rosana
*	
*	File: info at profile 
*/
if ($vars['size'] == 'large') {
    if (elgg_get_plugin_setting('profile_display', 'hflts')) {
        $vars['entity']->karma = userKarma($vars['entity']->guid);
        if (!$vars['entity']->nValorations) {
            $vars['entity']->nValorations = 0;
        }
        ?>

        <div class="hflts_profile">
            <div><?php 
        echo elgg_echo('hflts:profile') . ': <span style="color:#F05A23">' . $vars['entity']->karma;
        ?>
</span></div>
            <div><?php 
        echo elgg_echo('hflts:number') . ' <span style="color:#F05A23">' . $vars['entity']->nValorations . '</span> ' . elgg_echo('hflts:users');
        ?>
</div>
        </div>
Ejemplo n.º 2
0
function update_allusers_expertise()
{
    $base = elgg_get_plugin_setting('base_expertise', 'hflts');
    //system_message("Computing with B=" . $base . " %");
    $options = array('type' => 'user', 'limit' => $limit, 'offset' => $offset);
    //,
    $entities = elgg_get_entities_from_metadata($options);
    $i = 0;
    //counter
    $points = array();
    $values = array();
    if (is_array($entities)) {
        foreach ($entities as $entity) {
            $entity->karma = userKarma($entity->guid);
            //recalculo todo de cara a overview
            $points[$i] = $entity->userpoints_points;
            $i++;
        }
    }
    $values = relativeUserExpertise($points);
    $i = 0;
    foreach ($entities as $entity) {
        $entity->expertise = $values[$i];
        //system_message($entity->name ." with ". $entity->expertise);
        $i++;
    }
}