You are here

function popup_onload_statistics_log in Popup On Load 7

Same name and namespace in other branches
  1. 8 modules/popup_onload_statistics/popup_onload_statistics.module \popup_onload_statistics_log()

AJAX gate for popup statistics logging.

1 string reference to 'popup_onload_statistics_log'
popup_onload_statistics_menu in popup_onload_statistics/popup_onload_statistics.module
Implements hook_menu().

File

popup_onload_statistics/popup_onload_statistics.module, line 78
Main popup on loadvertisement statistics functions.

Code

function popup_onload_statistics_log() {
  $post = drupal_get_query_parameters($_POST);
  array_map('check_plain', $post);
  $action_type = $post['atype'];
  $popup_id = $post['popup_id'];
  $record = new stdClass();
  $record->type = $action_type;
  $record->popup_id = $popup_id;
  $record->atime = time();
  drupal_write_record('popup_onload_statistics', $record);
  drupal_json_output([
    'status' => 1,
  ]);
}