Hi,

Hope this message finds you very well.

I would like to have an author's company information below a press releases (content type = 'article') if they are 'platinum members'.

In my node-article.tpl.php I had this previously for the nodeprofile.module 5.x ... but have since moved onto your wonderful content_profile.module in 6.x.

<?php

// Load the nodeprofile node for the user that is the author of the current node
$nodeprofilenode = nodeprofile_load('platinum', $node->uid);

// Print the company field from the nodeprofile node
print $nodeprofilenode->field_companyname[0]['value']

?><?php

// Load the nodeprofile node for the user that is the author of the current node
$nodeprofilenode = nodeprofile_load('platinum', $node->uid);

// Print the company field from the nodeprofile node
print $nodeprofilenode->field_introduction[0]['value']

?>
<?php
print l('read more about ' . $nodeprofilenode->field_company[0]['value'],'user/' . $nodeprofilenode->uid)
?>

Please, would you be so kind to show me how to alter this and now call content profile ..

Looking so forward to any reply, and thank you.
Lilian

Comments

liliplanet’s picture

Hi, *bump" sorry,

What I got to work is:

<?php
$account = user_load(array('uid' => $node->uid));
if (in_array('Platinum Member', $account->roles)) : 
?>
<?php
$listlength="10";
$nodetype="article";
$output = node_title_list(db_query_range(db_rewrite_sql("SELECT n.nid, n.title, n.created FROM {node} n WHERE n.type = '%s' AND n.status = 1 AND n.uid = %d ORDER BY n.created DESC"), $nodetype, $node->uid, 0, $listlength));
print $output;
?><?php endif; ?>

which is the latest articles by the author of the article (which is great) ... but I don't want that, what I'm trying achieve is :

Author is : Company Name: <?php echo $node->field_company[0]['view'];?> at the bottom of an article they (the author) has submitted.

Look so forward to any suggestions and thank you.
Lilian