You are here

function _views_xhtml_format_author in Views Datasource 7

Same name and namespace in other branches
  1. 6 views_xhtml.module \_views_xhtml_format_author()

Creates an author object to use in the headers of OPML and Atom documents

Parameters

$username:

Return value

unknown_type

2 calls to _views_xhtml_format_author()
template_preprocess_views_views_xhtml_style_hcalendar in views/theme/views_views_xhtml_style.theme.inc
template_preprocess_views_views_xhtml_style_hcard in views/theme/views_views_xhtml_style.theme.inc
@file View template to render view fields as xhtml.

File

./views_xhtml.module, line 207
Module definition for views_xhtml

Code

function _views_xhtml_format_author($username) {
  $author = array();
  if (!$username) {
    $author["name"] = variable_get('anonymous', 'Anonymous');
    $author["email"] = variable_get('site_mail', 'none@none.info');
    return $author;
  }
  if (is_numeric($username)) {
    $user = user_load($username);
  }
  else {
    $user = user_load_by_name($username);
  }
  if (!$user) {

    //$author["name"] = variable_get('anonymous', ('Anonymous'));

    //$author["name"] = variable_get('anonymous', ('Anonymous'));
    $author["name"] = $username;
    $author["email"] = variable_get('site_mail', 'none@none.info');
    return $author;
  }
  if (!module_exists("profile")) {
    $author["name"] = $username;
    $author["email"] = check_plain($user->mail);
    return $author;
  }
  else {
    profile_load_profile($user);
    $author["name"] = check_plain($user->profile_name ? $user->profile_name : $username);
    $author["email"] = check_plain($user->mail);
    if (user_access('access user profiles')) {
      $author['uri'] = url('user/' . $user->uid, array(
        'absolute' => TRUE,
      ));
    }
    return $author;
  }
}