Thank you for this module, first...
I'm trying to use it in forum topic and in comments together.
i' ve found two differents function to add to the template,php
The first one is in the README :

switch ($hook) {
    case 'node':
    case 'comment':
      if (module_exists('user_titles')) {
        $vars['user_title'] = user_titles_get_user_title($vars['node']->uid);
      }
  }
  return $vars;
}

if i use this i have the "title" in node and not in comments

if i use the other one, found following the "documentation" link here on the drupal website:

  switch ($hook) {
    case 'node':
      if (module_exists('user_titles')) {
        $vars['user_title'] = user_titles_get_user_title($vars['node']->uid);
      }
    case 'comment':
      if (module_exists('user_titles')) {
        $vars['user_title'] = user_titles_get_user_title($vars['comment']->uid);
      }
  }
  return $vars;
}

it works in comments but not in the node
Solution?
Thank you,
Da.

Comments

off’s picture

function _phptemplate_variables($hook, $vars = array()) {
  switch ($hook) {
    case 'node':
      if (module_exists('user_titles')) {
        $vars['user_title'] = user_titles_get_user_title($vars['node']->uid);
      }
    case 'comment':
      if (module_exists('user_titles')) {
        $vars['user_titlec'] = user_titles_get_user_title($vars['comment']->uid);
      }
  }
  return $vars;
}

and in comment.tpl.php use this code

<?php if ($user_titlec): ?><div class="user-title"><?php print $user_titlec; ?></div><?php endif; ?>

agileware’s picture

Did OFF's comment solve your problem?

planctus’s picture

I think i've never tried that and i still have that problem, if i'm remembering well...
As soon as i can i will try it
Da.

off’s picture

yes! this 100% vorking, but i have new problem.. 6.x version missing

agileware’s picture

Status: Active » Fixed

If you are referring to there only being a 6.x-1.x-dev version, there is now a beta1 release you can use.

Status: Fixed » Closed (fixed)

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