When using content profile with imagefield, there is no way to have the image link to the user's profile instead of to the content profile node. This will make the image field in views link to the right place.

This is very useful, specially when you want to have the content profile node link to the user's profile page instead.

Once the patch in #661572: Option to redirect content profile page to user profile page or vice versa gets applied, this feature could be adjusted to automatically link to the correct place using:

if (content_profile_get_settings($node->type, 'page_redirect') == 1) {
  // redirect to the user profile page
  $path = empty($item['uid']) ? '' : 'user/'. $item['uid'];
}
else {
  // redirect to the user profile node
  ... // Do some more code determining the correct profile node.
  $path = empty($item['nid']) ? '' : 'node/'. $item['nid'];
}

Comments

drewish’s picture

Speaking as the imagecache maintainer I'd say it looks good though I wonder about:

+  $style = 'unserlink';

Typo?

moonray’s picture

oops. yes typo.
will re-roll tomorrow.

moonray’s picture

Fixed typo. Re-rolled patch.

drewish’s picture

Status: Needs review » Reviewed & tested by the community

Very nice.

fago’s picture

Status: Reviewed & tested by the community » Fixed

Indeed, very nice + patch looks good! Committed, thanks.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.