You are here

function closeblock_closing_info_set in Close Block 7

Same name and namespace in other branches
  1. 6 includes/closeblock.api.inc \closeblock_closing_info_set()

Set info.

1 call to closeblock_closing_info_set()
closeblock_ajax_callback in includes/closeblock.api.inc
Ajax callback function.

File

includes/closeblock.api.inc, line 119
Module settings functions.

Code

function closeblock_closing_info_set($params) {
  if (isset($params['uid']) && !empty($params['uid'])) {
    $info = closeblock_closing_info_get($params);
    $params['count'] = 1;
    $params['timestamp'] = time();
    if ($info) {
      $block_id = theme('closeblock_block_id', $params);
      $params['count'] = $info[$block_id]['count'] + 1;
      drupal_write_record('closeblock', $params, array(
        'module',
        'delta',
        'theme',
        'uid',
      ));
    }
    else {
      drupal_write_record('closeblock', $params);
    }
  }
  else {
    closeblock_closing_info_anonymous_set($params);
  }
}