You are here

function advanced_help_get_sids in Advanced Help 6

Same name and namespace in other branches
  1. 5 advanced_help.module \advanced_help_get_sids()
  2. 7 advanced_help.module \advanced_help_get_sids()

Gets search id for each topic.

Get or create an sid (search id) that correlates to each topic for the search system.

1 call to advanced_help_get_sids()
advanced_help_update_index in ./advanced_help.module
Implements hook_update_index().

File

./advanced_help.module, line 831
Pluggable system to provide advanced help facilities for Drupal and modules.

Code

function advanced_help_get_sids(&$topics) {
  global $language;
  $result = db_query("SELECT * FROM {advanced_help_index} WHERE language = '%s'", $language->language);
  while ($sid = db_fetch_object($result)) {
    if (empty($topics[$sid->module][$sid->topic])) {
      db_query("DELETE FROM {advanced_help_index} WHERE sid = %d", $sid->sid);
    }
    else {
      $topics[$sid->module][$sid->topic]['sid'] = $sid->sid;
    }
  }
}