function theme_apachesolr_multisitesearch_username in Apache Solr Multisite Search 6
Same name and namespace in other branches
- 6.2 apachesolr_multisitesearch.module \theme_apachesolr_multisitesearch_username()
Modified username theme function.
See also
1 theme call to theme_apachesolr_multisitesearch_username()
File
- ./
apachesolr_multisitesearch.module, line 433 - Provides a multi-site search implementation for use with the Apache Solr module
Code
function theme_apachesolr_multisitesearch_username($doc) {
if ($doc->name) {
// Shorten the name when it is too long or it will break many tables.
if (drupal_strlen($doc->name) > 20) {
$name = drupal_substr($doc->name, 0, 15) . '...';
}
else {
$name = $doc->name;
}
// Only make links for local users.
if ($doc->uid && apachesolr_site_hash() == $doc->hash && user_access('access user profiles')) {
$output = l($name, 'user/' . $doc->uid, array(
'attributes' => array(
'title' => t('View user profile.'),
),
));
}
else {
$output = check_plain($name);
}
}
else {
$output = check_plain(variable_get('anonymous', t('Anonymous')));
}
return $output;
}