function blog_node_view

blog_node_view($node, $view_mode)

Implements hook_node_view().

File

modules/blog/blog.module, line 80
Enables multi-user blogs.

Code

function blog_node_view($node, $view_mode) {
  if ($view_mode != 'rss') {
    if ($node->type == 'blog' && (arg(0) != 'blog' || arg(1) != $node->uid)) {
      // This goes to l(), which escapes !username in both title and attributes.
      $links['blog_usernames_blog'] = array(
        'title' => t("!username's blog", array('!username' => format_username($node))),
        'href' => "blog/$node->uid",
        'attributes' => array('title' => t("Read !username's latest blog entries.", array('!username' => format_username($node)))),
      );
      $node->content['links']['blog'] = array(
        '#theme' => 'links__node__blog',
        '#links' => $links,
        '#attributes' => array('class' => array('links', 'inline')),
      );
    }
  }
}

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/modules!blog!blog.module/function/blog_node_view/7.x