$gallery_vid, 'name' => $library_word, 'description' => t('Default image gallery for images uploaded via imagex'), 'weight' => 100); taxonomy_save_term($form_values); } // We should now have our Library image gallery, lets get its tid (this is // ugly) $tid = array_pop(db_fetch_array(db_query(db_rewrite_sql("SELECT t.tid FROM {term_data} t WHERE t.name = '%s'", 't', 'tid'), $library_word))); // Set the imagex_gallery_tid variable variable_set('imagex_gallery_tid', $tid); } else { drupal_set_message(t('Imagex will work with the Image Gallery module to add all uploaded images to a default gallery called "Library". Reinstalling this module, after installing "Image Gallery" will help users locate images uploaded using Imagex'), 'error'); } } /** * hook_uninstall */ function imagex_uninstall(){ db_query("DELETE FROM {variable} WHERE name = 'imagex_gallery_tid'"); }