You are here

commons_blog.install in Drupal Commons 6.2

File

modules/features/commons_blog/commons_blog.install
View source
<?php

/**
 * Implementation of hook_install()
 */
function commons_blog_install() {
  commons_blog_add_flag();
  commons_blog_add_taxonomy();
}

/**
 * Add the bookmark flag to blog nodes
 */
function commons_blog_add_flag() {
  $fid = db_result(db_query("SELECT fid FROM {flags} WHERE name = '%s'", 'bookmarks'));
  if ($fid) {
    $check_sql = "SELECT fid FROM {flag_types} WHERE type = 'blog' AND fid = %d";
    if (!db_result(db_query($check_sql, $fid))) {
      $flag = new stdClass();
      $flag->fid = $fid;
      $flag->type = 'blog';
      drupal_write_record('flag_types', $flag);
    }
  }
}

/**
 * Add taxonomy to blog nodes
 */
function commons_blog_add_taxonomy() {
  $taxonomy = new stdClass();
  $taxonomy->vid = variable_get('commons_tags_vid', 1);
  $taxonomy->type = 'blog';
  drupal_write_record('vocabulary_node_types', $taxonomy);
}

Functions

Namesort descending Description
commons_blog_add_flag Add the bookmark flag to blog nodes
commons_blog_add_taxonomy Add taxonomy to blog nodes
commons_blog_install Implementation of hook_install()