function _views_xhtml_format_author in Views Datasource 6
Same name and namespace in other branches
- 7 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 theme/
views_views_xhtml_style.theme.inc - template_preprocess_views_views_xhtml_style_hcard in theme/
views_views_xhtml_style.theme.inc - @file View template to render view fields as xhtml.
File
- ./
views_xhtml.module, line 199 - 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(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["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;
}
}