You are here

function advanced_help_get_sids in Advanced Help 7

Same name and namespace in other branches
  1. 5 advanced_help.module \advanced_help_get_sids()
  2. 6 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 1070
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 = :language", array(
    ':language' => $language->language,
  ));
  foreach ($result as $sid) {
    if (empty($topics[$sid->module][$sid->topic])) {
      db_query("DELETE FROM {advanced_help_index} WHERE sid = :sid", array(
        ':sid' => $sid->sid,
      ));
    }
    else {
      $topics[$sid->module][$sid->topic]['sid'] = $sid->sid;
    }
  }
}