The User Activity Module [1] is a module for the great and flexible Drupal Web Content Management System [2]. It calculates and displays a user's activity index.
The calculation is currently based on 4 factors:
So we have four percentage values, we sum them up and divide it by 4.
The result is a user's activity index.
The generated activity index will be displayed on the user's profile page per default.

Many people customize the user profile layout [3] with a technique described on drupal.org.
With a simple function call you may display a given user's activity-o-meter wherever you want, just do
<?php
print theme('user_activity_o_meter', $user->user_activity_index);
?>And if you additionally want to modify the presentation of the activity-o-meter, you simply add the following code to your theme's template.php (if it doesn't exist, simply create it) and modify it as you like.
<?php
function phptemplate_user_activity_o_meter($index) {
$output = '
<div class="user_activity_o_meter" style="width:100%;height:20px;background-color:#C3D9FF;">
<div style="width:'. $index .'%;height:20px;background-color:#6BBA70;color:white;text-align:center;"></div>
<div style="margin-top:-20px;text-align:center;">'. $index .'%</div>
</div>';
return $output;
}
?>[1] http://drupal.org/project/user_activity
[2] http://drupal.org
[3] http://drupal.org/node/35728
Post new comment