Display the statistics on Profile

How can to display the details of statistics on Profile for Elgg 1.8 How can to display the details of statistics on Profile for Elgg 1.8

Under owner block

Open the file

elgg\mod\profile\views\default\profile\owner_block.php

After this code

$content_menu = elgg_view_menu('owner_block', array(
'entity' => elgg_get_page_owner_entity(),
'class' => 'profile-content-menu',
));

Add this code

$content_menu .= elgg_echo('usersettings:statistics:label:membersince');
$content_menu .= ': ';
$content_menu .= date("F j, Y",$user->time_created);
$content_menu .= '<br>';
$logged_in = 0;
$log = get_system_log($user->guid, "login", "", 'user', '', 1);
if ($log) {
$logged_in = $log[0]->time_created;
}
$content_menu .= elgg_echo('usersettings:statistics:label:lastlogin');
$content_menu .= ': ';
$content_menu .= date("F j, Y",$logged_in);

Details of statistics on Profile for Elgg 1.8

 

Under user name

Open the file

elgg\mod\profile\views\default\profile\details.php

After this code

echo "<h2>{$user->name}</h2>";

Add this code

$membersince = elgg_echo('usersettings:statistics:label:membersince');
$memberdate = date("F j, Y",$user->time_created);
$logged_in = 0;
$log = get_system_log($user->guid, "login", "", 'user', '', 1);
if ($log) {
$logged_in = $log[0]->time_created;
}
$lastlogin = elgg_echo('usersettings:statistics:label:lastlogin');
$lastlogindate = date("F j, Y",$logged_in);

echo "{$membersince}: {$memberdate}";
echo "<br>";
echo "{$lastlogin}: {$lastlogindate}";

Display the details of statistics on Profile for Elgg 1.8

Share on Facebook
Share on Twitter




4 Responses to “Display the statistics on Profile”

  1. Nudeler2 says:

    WOW! COOL!

    Thanks for fill in my birthdate (day, months) under member since! ;)

  2. Ste says:

    Any way to make it work with Profile Manager?
    Thanks!

Leave a Reply



Similar Elgg Hacks