You are here

function advpoll_convert_form_submit in Advanced Poll 5

Same name and namespace in other branches
  1. 6.3 advpoll_convert.module \advpoll_convert_form_submit()
  2. 6 advpoll_convert.module \advpoll_convert_form_submit()
  3. 6.2 advpoll_convert.module \advpoll_convert_form_submit()

File

./advpoll_convert.module, line 52

Code

function advpoll_convert_form_submit($form_id, $form_values) {
  $count = 0;
  $result = db_query("SELECT n.nid, n.created, p.runtime, p.active FROM {node} n JOIN {poll} p ON n.nid = p.nid WHERE type = 'poll'");
  while ($poll = db_fetch_object($result)) {
    _advpoll_convert_node($poll);
    $count++;
  }
  drupal_set_message(format_plural($count, '@count poll successfully converted.', '@count polls successfully converted.'));
}