You are here

function blog_link in Drupal 6

Same name and namespace in other branches
  1. 4 modules/blog.module \blog_link()
  2. 5 modules/blog/blog.module \blog_link()

Implementation of hook_link().

File

modules/blog/blog.module, line 116
Enables keeping an easily and regularly updated web page or a blog.

Code

function blog_link($type, $node = NULL, $teaser = FALSE) {
  $links = array();
  if ($type == 'node' && $node->type == 'blog') {
    if (arg(0) != 'blog' || arg(1) != $node->uid) {

      // This goes to l() and therefore escapes !username in both the title and attributes.
      $links['blog_usernames_blog'] = array(
        'title' => t("!username's blog", array(
          '!username' => $node->name,
        )),
        'href' => "blog/{$node->uid}",
        'attributes' => array(
          'title' => t("Read !username's latest blog entries.", array(
            '!username' => $node->name,
          )),
        ),
      );
    }
  }
  return $links;
}