@@ -47,7 +47,12 @@ function pcp_block($op = 'list', $delta $block = array(); switch ($delta) { case 0: - global $user; + if ((arg(0) == 'user') && is_numeric(arg(1)) && (arg(2) == NULL)) { + $user = user_load(arg(1)); + } + else { + global $user; + } $complete_data = pcp_get_complete_percentage_data($user); $block = array( 'subject' => t('Profile Complete'), @@ -329,8 +334,11 @@ function theme_pcp_profile_percent_compl $output .= ''; $output .= ''; - if ($complete_data['nextfield'] && $complete_data['nextpercent']) { - $output .= t('Filling out ') . ' ' . l($complete_data['nextfield'], 'user/'. $complete_data['uid'] .'/edit/'. $complete_data['nextcategory'], array('query' => 'fieldname='. $complete_data['nextname'])) .' ' . t('will bring your profile to') . ' ' . t('!complete% Complete', array('!complete' => $complete_data['nextpercent'])); + global $user; + if (arg(0) == 'user' && $user->uid == arg(1)){ + if ($complete_data['nextfield'] && $complete_data['nextpercent']) { + $output .= t('Filling out ') . ' ' . l($complete_data['nextfield'], 'user/'. $complete_data['uid'] .'/edit/'. $complete_data['nextcategory'], array('query' => 'fieldname='. $complete_data['nextname'])) .' ' . t('will bring your profile to') . ' ' . t('!complete% Complete', array('!complete' => $complete_data['nextpercent'])); + } } return $output;