function template_preprocess_activity_username in Activity 7
File
- ./activity.module, line 773
- Records Activity across the site and surfaces that to Views.
Code
function template_preprocess_activity_username(&$variables) {
$account = $variables['account'];
$variables['extra'] = '';
if (empty($account->uid)) {
$variables['uid'] = 0;
}
else {
$variables['uid'] = (int) $account->uid;
}
$name = $variables['name_raw'] = format_username($account);
if (drupal_strlen($name) > 20) {
$name = drupal_substr($name, 0, 15) . '...';
}
$variables['name'] = check_plain($name);
$variables['profile_access'] = TRUE;
$variables['link_attributes'] = array();
if ($variables['uid'] && $variables['profile_access']) {
$variables['link_attributes'] = array(
'title' => t('View user profile.'),
);
$variables['link_path'] = 'user/' . $variables['uid'];
}
elseif (!empty($account->homepage)) {
$variables['link_attributes'] = array(
'rel' => array(
'nofollow',
),
);
$variables['link_path'] = $account->homepage;
$variables['homepage'] = $account->homepage;
}
$variables['link_options']['html'] = TRUE;
$variables['attributes_array'] = array(
'class' => array(
'username',
),
);
}