search_nodeapi

  1. drupal
    1. drupal6
Versionen
drupal6 search_nodeapi(&$node, $op, $teaser = NULL, $page = NULL)

Implementation of hook_nodeapi().

Code

modules/search/search.module, line 631

<?php
function search_nodeapi(&$node, $op, $teaser = NULL, $page = NULL) {
  switch ($op) {
    // Transplant links to a node into the target node.
    case 'update index':
      $result = db_query("SELECT caption FROM {search_node_links} WHERE nid = %d", $node->nid);
      $output = array();
      while ($link = db_fetch_object($result)) {
        $output[] = $link->caption;
      }
      if (count($output)) {
        return '<a>(' . implode(', ', $output) . ')</a>';
      }
      break;
      // Reindex the node when it is updated.  The node is automatically indexed
      // when it is added, simply by being added to the node table.
    case 'update':
      search_touch_node($node->nid);
      break;
  }
}
?>

Kommentare

Kommentar hinzufügen

Der Inhalt dieses Feldes wird nicht öffentlich zugänglich angezeigt.
  • Internet- und E-Mail-Adressen werden automatisch umgewandelt.
  • Zulässige HTML-Tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Zeilen und Absätze werden automatisch erzeugt.

Weitere Informationen über Formatierungsoptionen

Kommentar hinzufügen

Der Inhalt dieses Feldes wird nicht öffentlich zugänglich angezeigt.
  • Internet- und E-Mail-Adressen werden automatisch umgewandelt.
  • Zulässige HTML-Tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Zeilen und Absätze werden automatisch erzeugt.

Weitere Informationen über Formatierungsoptionen