You are here

function _disqus_migrate_import_now in Disqus 6

Submit handler for performing an on-demand import

1 string reference to '_disqus_migrate_import_now'
disqus_migrate_admin_import in include/disqus_migrate.import.inc
Menu callback for importing actions

File

include/disqus_migrate.import.inc, line 118

Code

function _disqus_migrate_import_now($form, &$form_state) {
  $since = $form_state['values']['since'];
  if (!empty($since)) {

    // Convert the user entered time to UTC UNIX timestamp
    $curr_tz = date_default_timezone_get();
    date_default_timezone_set("UTC");
    $since = strtotime($since);
    date_default_timezone_set($curr_tz);
  }
  else {
    if ($form_state['values']['since_last'] == 1) {
      $since = _disqus_migrate_last_synced_time() + 1;

      // add one second so we don't reimport comments
    }
  }
  _disqus_migrate_import($since);
}