You are here

function _views_rdf_format_author in Views Datasource 6

Same name and namespace in other branches
  1. 7 views_rdf.module \_views_rdf_format_author()

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

Parameters

$username:

Return value

unknown_type

3 calls to _views_rdf_format_author()
template_preprocess_views_views_rdf_style_doap in theme/views_views_rdf_style.theme.inc
Template preprocess for the DOAP vocabulary
template_preprocess_views_views_rdf_style_foaf in theme/views_views_rdf_style.theme.inc
Template preprocess for the FOAF vocabulary
template_preprocess_views_views_rdf_style_sioc in theme/views_views_rdf_style.theme.inc
Template preprocess for the SIOC vocabulary

File

./views_rdf.module, line 198
Module definition for views_rdf

Code

function _views_rdf_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(array(
      'uid' => $username,
    ));
  }
  else {
    $user = user_load(array(
      'name' => $username,
    ));
  }
  if (!$user) {

    //$author["name"] = variable_get('anonymous', ('Anonymous'));
    $author["name"] = variable_get('anonymous', 'Anonymous');
    $author["email"] = variable_get('site_mail', 'none@none.info');
    return $author;
  }
}