For new users:
<?php
elgg_register_event_handler('init', 'system', 'registro_nuevo_init');
function registro_nuevo_init() {
elgg_register_event_handler('create', 'user', 'inicializa_datos');
}
function inicializa_datos($event, $type, $user) {
$user->puntuacion = '0';
}
For existing users you could create a script you directly call/execute once (e.g. named it user_update.php and save it in the Elgg install root folder and then call it in your browser with site.url/user_update.php). The following is for Elgg 2.x versions:
<?php
require_once __DIR__ . '/vendor/autoload.php';
\Elgg\Application::start();
$ia = elgg_set_ignore_access(true);
$access_status = access_get_show_hidden_status();
access_show_hidden_entities(true);
$entities = new ElggBatch('elgg_get_entities', array(
'type' => 'user',
'limit' => false,
));
foreach ($users as $user) {
$user->puntuacion = '0';
}
access_show_hidden_entities($access_status);
elgg_set_ignore_access($ia);
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.