You are here

function tweet_link in Tweet 6.3

Same name and namespace in other branches
  1. 5.2 tweet.module \tweet_link()
  2. 5 tweet.module \tweet_link()
  3. 6.4 tweet.module \tweet_link()
  4. 6 tweet.module \tweet_link()
  5. 6.2 tweet.module \tweet_link()

Implementation of hook_link().

File

./tweet.module, line 24
Builds links to post pages to twitter.

Code

function tweet_link($type, $node = NULL, $teaser = FALSE) {
  if ($type == 'node' && in_array($node->type, variable_get('tweet_types', _tweet_node_types())) && !_tweet_exclude($node->nid)) {
    $title = variable_get('tweet_title', 1);
    if (!$teaser) {
      $link_type = variable_get('tweet_node', 'icon');
      if ($link_type != 'none') {
        $links['tweet'] = _tweet_to_twitter($link_type, '', $node->nid);
        return $links;
      }
    }
    else {
      $link_type = variable_get('tweet_teaser', 'none');
      if ($link_type != 'none') {
        $links['tweet'] = _tweet_to_twitter($link_type, '', $node->nid);
        return $links;
      }
    }
  }
}