Hi,

I'd like to show the Role below the commentor's name

For Example

Submitted by Joe, Teacher, School Name
How can this be done? I want to edit the current text below each comment such as
"Submitted by Joe on Mon, 12/08/2008 - 09:24"
This should instead be
"Dec, 08: Joe, Teacher, School Name "

Please help.
Thanks
Navs

Comments

Cayhn’s picture

I assume you have custom profile fields added for the title. You will then have to modify the comment.tpl.php and get the information from the custom fields. This is the code you could use:

<?php 
//Load the info
$owner = user_load(array('uid'=>$node->uid)); 

//Print the info (Profile_title change depending on what you have named your custom field of course)
if($owner->profile_title) { print t('<b> Title:</b> '.$owner->profile_titel); }

?>

Then you want to find this code in the comment.tpl.php:

<?php if ($submitted): ?>
    <span class="submitted"><?php print $submitted; ?></span>
  <?php endif; ?>

Remove the print $submitted part and replace it with this:

<?php
$owner = user_load(array('uid'=>$node->uid)); 
$my_month = date("M", $node->created);
$my_year = date("y", $node->created);
 print t($my_month); print t($my_year); if($owner->profile_title) { print t(': '.$owner->profile_titel); }
?>

That should do the trick.