5
jimmyx,
below is the full code :
// ===================== Profile completeness hack =============================== //
$uid = $thisUser->getVar('uid');
$query_c = "SELECT * FROM " . $xoopsDB -> prefix( "profile_profile" ) . " WHERE profile_id = '$uid'";
$result_c = $xoopsDB -> query ($query_c );
$all_rows = $xoopsDB -> fetchArray( $result_c );
$num_rows = count( $all_rows );
$full_rows = array_diff($all_rows,array(NULL));
$num_full_rows = count ( $full_rows );
$perc = floor($num_full_rows*100/$num_rows);
$xoopsTpl->assign('compl', $perc);
// Colors
if ( $perc < 25 ) {
$class = 'warning';
} elseif ( $perc >= 25 && $perc < 50 ) {
$class = 'danger';
} elseif ( $perc >= 50 && $perc < 75 ) {
$class = 'info';
} else {
$class = 'success';
}
$xoopsTpl->assign('class', $class);
// ==================== End of profile completeness hack ===================================== //
where warning, info, success, and danger are my css classes for the progress bar. You must put this code in userinfo.php before the
include dirname(__FILE__) . DIRECTORY_SEPARATOR . 'footer.php';
?>
Deka