--- profile_csv.module_cvs 2007-03-24 04:02:14.000000000 +0000 +++ profile_csv.module 2008-08-07 12:25:39.000000000 +0100 @@ -79,6 +79,12 @@ function profile_csv_admin_settings() { '#return_value' => 1, '#default_value' => variable_get(PROFILE_CSV_PARAM . 'mail', 0), ); + $form[$set][PROFILE_CSV_PARAM . 'created'] = array( + '#type' => 'checkbox', + '#title' => t('User Join Date'), + '#return_value' => 1, + '#default_value' => variable_get(PROFILE_CSV_PARAM . 'created', 0), + ); $set = 'profile'; $form[$set] = array( @@ -176,10 +182,11 @@ function profile_csv_page() { } } } - header("Content-type: text/plain; charset=UTF-8"); - header("Content-Disposition: attachment; filename=userlist.csv"); - header("Pragma: no-cache"); - header("Expires: 0"); + drupal_set_header("Content-type: text/plain; charset=UTF-8"); + drupal_set_header("Content-Disposition: attachment; filename=userlist.csv"); + drupal_set_header("Pragma: no-cache"); + drupal_set_header("Cache-Control: no-store, no-cache, must-revalidate"); + drupal_set_header("Expires: 0"); print $data; exit(); } @@ -220,7 +227,7 @@ function _profile_csv_format_user($uid = function _profile_csv_get_user($uid = 0) { $users = array(); - $result = db_query('SELECT u.uid, u.name, u.mail, u.data FROM {users} u WHERE u.uid = %d', $uid); + $result = db_query('SELECT u.uid, u.name, u.mail, u.data, u.created, u.status FROM {users} u WHERE u.uid = %d', $uid); while ($row = db_fetch_object($result)) { if (variable_get(PROFILE_CSV_PARAM . 'uid', 0)) $users[] = $row->uid; @@ -228,9 +235,15 @@ function _profile_csv_get_user($uid = 0) if (variable_get(PROFILE_CSV_PARAM . 'name', 0)) $users[] = $row->name; + if (variable_get(PROFILE_CSV_PARAM . 'created', 0)) + $users[] = format_date($row->created, 'small'); + if (variable_get(PROFILE_CSV_PARAM . 'mail', 0)) $users[] = $row->mail; $users['data'] = unserialize($row->data); + + if (variable_get(PROFILE_CSV_STATUS,2) == 2) + $users[] = $row->status == 1 ? t('active') : t('blocked'); } return $users; } @@ -270,9 +283,15 @@ function _profile_csv_header() { if (variable_get(PROFILE_CSV_PARAM . 'name', 0)) $row[] = '"name"'; + if (variable_get(PROFILE_CSV_PARAM . 'created', 0)) + $row[] = '"joined"'; + if (variable_get(PROFILE_CSV_PARAM . 'mail', 0)) $row[] = '"mail"'; + if (variable_get(PROFILE_CSV_STATUS,2) == 2) + $row[] = '"status"'; + foreach(_profile_csv_get_profile_fields() as $field) { $row[] = '"'. $field['title'] .'"'; }