The purpose of this pcp block is to encourage users to fill in their profiles. When pcp reaches 100% it completes its mission and therefore it shouldn't be displayed.

Comments

drupaloSa’s picture

I changed the implementation of hook_block as follows in order to hide the block when the percent is 100%:

/**
 * Implementation of hook_block()
 */
function pcp_block($op = 'list', $delta = 0, $edit = array()) {
  switch ($op) {
    case 'list':
      $blocks[0]['info'] = t('Profile Complete Percentage');
      return $blocks;
      break;
    case 'view':
      switch ($delta) {
        case 0:
          global $user;
          $complete_data = pcp_get_complete_percentage_data($user);
          if ($complete_data['percent'] != 100) {
            $block = array(
              'subject' => t('Profile Complete'),
              'content' => theme('pcp_profile_percent_complete', $complete_data),
              );
          }
          break;
      }
      return $block;
      break;
  }
}
therealwebguy’s picture

Status: Active » Closed (fixed)

Sounds great, thanks for the post. I am adding a settings option to allow the administer the ability to choose from a few options (this being one of them) that tells PCP what to do when the profile hits 100% complete. This will be available in release 2.0.