search_nodeapi

Хочешь помочь с переводом? Это очень просто и быстро. Лишь зарегистрируйся, и можешь тут же начать переводить.

modules/search/search.module, строка 630

Версии
6
search_nodeapi(&$node, $op, $teaser = NULL, $page = NULL)

Implementation of hook_nodeapi().

Код

<?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;
  }
}
?>
Войдите или зарегистрируйтесь, чтобы получить возможность отправлять комментарии

Вход в систему