Thanks for this excellent module. I've configured content profile content type and trying to print CCK field values through author-pane.tpl.php but it doesn't seems to work. I'm not sure what I'm doing wrong or whether it supports. This is code I added in my tpl file:

global $user;
$myuid=$user->uid;
$node=content_profile_load(profile, $myuid);
print 'node id:'.$node->nid; //it prints the node id from node object
   
/* following code doesn't print values from node cck fields */ 

print $node->field_name[0]['view'];	  
print $node->content['field_name']['#value'];

Thanks,

Comments

NX’s picture

subscribe

Michelle’s picture

Project: Author Pane » Content Profile
Version: 6.x-2.x-dev » 6.x-1.x-dev

This is something in CP and I don't really remember how it works... Moving over there.

Michelle

capellic’s picture

kevinquillen’s picture

I found that content_profile_load does not return the correct data from a node, even when cache is completely empty.

I had to create a workaround:


$profile = content_profile_load('profile', $uid, '', TRUE); // returns bad/old/wrong data

$profile = mymodule_profile_load($uid);

function mymodule_profile_load($uid) {
  $result = db_fetch_object(db_query('SELECT nid FROM {node} WHERE uid = %d', $uid));
  $profile = node_load($result->nid, '', TRUE);
  return $profile;
}

I thought that specifying reset as TRUE would not use cache or reset the cache.. I know I have drush cc'd a few dozen times and this function still returns data from who knows what. I am also using memcache on top of this and not sure if that plays a part in it, but my stripped down function definitely returns the data that is in the content_profile table(s).