Вы здесь

User Interests

Интересы пользователя.

Модуль User Interests выводит на страницу профиля пользователя термины таксономии которые связаны с его документами и комментариями.

Сниппеты

Вы можете самостоятельно выводить информацию об интересах пользователей используя этот сниппет в .tpl.php-файлах:

<?php
 
print theme('user_interests', $user->user_interests);
?>

Для переопределения оформления выводимой информации, в файле template.php можно использовать этот сниппет:

<?php
function phptemplate_user_interests($items = array(), $title = NULL, $type = 'ul', $attributes = NULL, $limit = 10) {
 
$i = 0;
 
$output = '<div class="user-interests">';
  if (isset(
$title)) {
   
$output .= '<h3>'. $title .'</h3>';
  }

  if (!empty(
$items)) {
   
$output .= "<$type" . drupal_attributes($attributes) . '>';
    foreach (
$items as $item) {
     
$i++;
     
$attributes = array();
     
$children = array();
      if (
is_array($item)) {
        foreach (
$item as $key => $value) {
          if (
$key == 'data') {
           
$data = $value;
          }
          elseif (
$key == 'children') {
           
$children = $value;
          }
          else {
           
$attributes[$key] = $value;
          }
        }
      }
      else {
       
$data = $item;
      }
      if (
count($children) > 0) {
       
$data .= theme_item_list($children, NULL, $type, $attributes); // Render nested list
     
}
     
$output .= '<li' . drupal_attributes($attributes) . '>'. $data .'</li>';
      if (
$i >= $limit) break;
    }
   
$output .= "</$type>";
  }
 
$output .= '</div>';
  return
$output;
}
?>

Комментарии

Изображение пользователя givchik

А как для чайников про сниппеты, можно по подробней?
И есть ли версия модуля, все таки, для 6.х?