You are here

function hook_nodewords_type_id in Nodewords: D6 Meta Tags 6

Same name and namespace in other branches
  1. 6.2 nodewords.api.php \hook_nodewords_type_id()

The hook is used from the module to determinate the type of the object associated with the currently viewed page (node, user, taxonomy term), and the ID of the object.

Parameters

&$result: the array used to write the result.

$arg: the array as obtained from arg().

7 functions implement hook_nodewords_type_id()

Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.

forum_nodewords_type_id in includes/forum.inc
Implements hook_nodewords_type_id().
image_nodewords_type_id in includes/image.inc
Implements hook_nodewords_type_id().
node_nodewords_type_id in includes/node.inc
Implements hook_nodewords_type_id().
taxonomy_menu_nodewords_type_id in includes/taxonomy_menu.inc
Implements hook_nodewords_type_id().
taxonomy_nodewords_type_id in includes/taxonomy.inc
Implements hook_nodewords_type_id().

... See full list

2 invocations of hook_nodewords_type_id()
_nodewords_detect_type_and_id in ./nodewords.module
Try to guess the $type and $id by looking at $_GET['q'].
_nodewords_load_all_includes in ./nodewords.module
Load the files in the directory "includes" basing on the enabled modules.

File

./nodewords.api.php, line 138
. Nodewords hooks.

Code

function hook_nodewords_type_id(&$result, $arg) {
  if ($arg[0] == 'user') {

    // User page paths: user/$uid.
    if (isset($arg[1]) && is_numeric($arg[1])) {
      $result['type'] = NODEWORDS_TYPE_USER;
      $result['id'] = $arg[1];
    }
  }
}