You are here

function _service_links_show in Service links 5

Same name and namespace in other branches
  1. 6 service_links.module \_service_links_show()

Check if the service links should be displayed for the node type/category.

3 calls to _service_links_show()
service_links_block in ./service_links.module
Implementation of hook_block().
service_links_link in ./service_links.module
Implementation of hook_link().
service_links_nodeapi in ./service_links.module
Implementation of hook_nodeapi().

File

./service_links.module, line 499
Mantainer: Fabio Mucciante aka TheCrow Original Author: Fredrik Jonsson fredrik at combonet dot se A module that adds Digg, del.icio.us, reddit, Technorati etc. links to nodes.

Code

function _service_links_show($type, $nid) {
  $links_show = FALSE;
  $node_type = in_array($type, variable_get('service_links_node_types', array()), TRUE);
  if (module_exists('taxonomy')) {
    $terms = taxonomy_node_get_terms($nid);
    foreach ($terms as $term) {
      $category_type = in_array($term->tid, variable_get('service_links_category_types', array()), FALSE);
    }
  }
  if ($node_type || $category_type) {
    $links_show = TRUE;
  }
  return $links_show;
}