Active
Project:
Content Profile
Version:
6.x-1.0-beta4
Component:
Base module
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
29 May 2011 at 16:25 UTC
Updated:
29 May 2011 at 16:25 UTC
When using $profile = content_profile_load('profile', $account->uid); I get the profile in the source translation.
Is there a way to directly load the content profile in the actual interface language.
I achieved it by
$profile = content_profile_load('profile', $account->uid);
if ($profile->language != $GLOBALS['language']->language and !empty($profile->tnid)) {
$translations = translation_node_get_translations($creator->tnid);
if (!empty($translations[$GLOBALS['language']->language])) {
$profile = node_load($translations[$GLOBALS['language']->language]->nid);
};};
But that way it needs two node loads and the profile is not cached, if I understand well.
Is there a better way to do it?
Right now I need the data in user-profile.tpl.php. But I might need it in node.tpl.php aswell.