| 1 |
<?php // $Id: mlm.inc,v 1.10 2009/08/10 01:57:46 vauxia Exp $ |
<?php // $Id: mlm.inc,v 1.11 2009/08/23 23:06:28 vauxia Exp $ |
| 2 |
|
|
| 3 |
class mlm { |
class mlm { |
| 4 |
// The supported list types ( announcement, discussion, etc. ). |
// The supported list types ( announcement, discussion, etc. ). |
| 339 |
drupal_set_header('Content-Type: text/csv'); |
drupal_set_header('Content-Type: text/csv'); |
| 340 |
drupal_set_header('Content-Disposition: attachment; filename='. urlencode($this->title) .'-'. date('Y-m-d') .'.csv'); |
drupal_set_header('Content-Disposition: attachment; filename='. urlencode($this->title) .'-'. date('Y-m-d') .'.csv'); |
| 341 |
$res = $this->subscribers(); |
$res = $this->subscribers(); |
| 342 |
|
|
| 343 |
|
$header = array(); |
| 344 |
|
foreach ($values['fields'] as $field) { |
| 345 |
|
if ($field) $header[] = strtoupper($field); |
| 346 |
|
} |
| 347 |
|
echo join(',', $header) ."\n"; |
| 348 |
|
|
| 349 |
while ($row = db_fetch_object($res)) { |
while ($row = db_fetch_object($res)) { |
|
if (!isset($header)) { |
|
|
$header = array(); |
|
|
foreach ($values['fields'] as $field) { |
|
|
if ($field) $header[] = strtoupper($field); |
|
|
} |
|
|
echo join(',', $header) ."\n"; |
|
|
} |
|
| 350 |
$return = array(); |
$return = array(); |
| 351 |
foreach ($values['fields'] as $field) { |
foreach ($values['fields'] as $field => $status) { |
| 352 |
if ($field) $return[] = $row->$field; |
if ($status) $return[] = $row->$field; |
| 353 |
} |
} |
| 354 |
echo join(',', $return) ."\n"; |
echo join(',', $return) ."\n"; |
| 355 |
} |
} |
| 356 |
|
die; |
| 357 |
} |
} |
| 358 |
|
|
| 359 |
function _edit_form(&$form_state) { |
function _edit_form(&$form_state) { |