Commit 4db35f75 authored by Dries's avatar Dries

- Patch #1184472 by Ralt, kathyh, Rob Loach, jcnventura, oriol_e9g, bleen18:...

- Patch #1184472 by Ralt, kathyh, Rob Loach, jcnventura, oriol_e9g, bleen18: Added rel='author' to 'Submitted by' link.
parent 09c01a7c
......@@ -1490,7 +1490,10 @@ function template_preprocess_node(&$variables) {
$node = $variables['node'];
$variables['date'] = format_date($node->created);
$variables['name'] = theme('username', array('account' => $node));
$variables['name'] = theme('username', array(
'account' => $node,
'link_attributes' => array('rel' => 'author'),
));
$uri = entity_uri('node', $node);
$variables['node_url'] = url($uri['path'], $uri['options']);
......
......@@ -1457,20 +1457,19 @@ function template_preprocess_username(&$variables) {
$name = drupal_substr($name, 0, 15) . '...';
}
$variables['name'] = check_plain($name);
$variables['profile_access'] = user_access('access user profiles');
$variables['link_attributes'] = array();
// Populate link path and attributes if appropriate.
if ($variables['uid'] && $variables['profile_access']) {
// We are linking to a local user.
$variables['link_attributes'] = array('title' => t('View user profile.'));
$variables['link_attributes']['title'] = t('View user profile.');
$variables['link_path'] = 'user/' . $variables['uid'];
}
elseif (!empty($account->homepage)) {
// Like the 'class' attribute, the 'rel' attribute can hold a
// space-separated set of values, so initialize it as an array to make it
// easier for other preprocess functions to append to it.
$variables['link_attributes'] = array('rel' => array('nofollow'));
$variables['link_attributes']['rel'] = 'nofollow';
$variables['link_path'] = $account->homepage;
$variables['homepage'] = $account->homepage;
}
......
File mode changed from 100644 to 100755
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment