You are here

function uc_catalog_add_node_type in Ubercart 6.2

Same name and namespace in other branches
  1. 8.4 uc_catalog/uc_catalog.module \uc_catalog_add_node_type()
  2. 7.3 uc_catalog/uc_catalog.module \uc_catalog_add_node_type()

Adds a node type to the catalog taxonomy term.

1 call to uc_catalog_add_node_type()
uc_catalog_enable in uc_catalog/uc_catalog.module
Implements hook_enable().

File

uc_catalog/uc_catalog.module, line 1014
Ubercart Catalog module.

Code

function uc_catalog_add_node_type($type) {
  if (!($vid = variable_get('uc_catalog_vid', 0))) {
    return;
  }
  if (!db_result(db_query("SELECT vid FROM {vocabulary_node_types} WHERE vid = %d and type = '%s'", $vid, $type))) {
    db_query("INSERT INTO {vocabulary_node_types} (vid, type) VALUES (%d, '%s')", $vid, $type);
  }
}