| 1 |
<?php |
|---|
| 2 |
|
|---|
| 3 |
|
|---|
| 4 |
|
|---|
| 5 |
|
|---|
| 6 |
|
|---|
| 7 |
|
|---|
| 8 |
|
|---|
| 9 |
|
|---|
| 10 |
|
|---|
| 11 |
|
|---|
| 12 |
|
|---|
| 13 |
|
|---|
| 14 |
|
|---|
| 15 |
|
|---|
| 16 |
|
|---|
| 17 |
|
|---|
| 18 |
|
|---|
| 19 |
|
|---|
| 20 |
|
|---|
| 21 |
|
|---|
| 22 |
|
|---|
| 23 |
|
|---|
| 24 |
|
|---|
| 25 |
|
|---|
| 26 |
|
|---|
| 27 |
|
|---|
| 28 |
define('IN_SUBSCRIBE', true); |
|---|
| 29 |
define('WA_ROOTDIR', '.'); |
|---|
| 30 |
|
|---|
| 31 |
require WA_ROOTDIR . '/newsletter.php'; |
|---|
| 32 |
|
|---|
| 33 |
$list_box = ''; |
|---|
| 34 |
|
|---|
| 35 |
$sql = "SELECT liste_id, liste_name, liste_format |
|---|
| 36 |
FROM " . LISTE_TABLE . " |
|---|
| 37 |
WHERE liste_public = " . TRUE; |
|---|
| 38 |
if( !($result = $db->query($sql)) ) |
|---|
| 39 |
{ |
|---|
| 40 |
trigger_error('Impossible d\'obtenir la liste des listes de diffusion', ERROR); |
|---|
| 41 |
} |
|---|
| 42 |
else |
|---|
| 43 |
{ |
|---|
| 44 |
$list_box = '<select id="liste" name="liste">'; |
|---|
| 45 |
|
|---|
| 46 |
if( $row = $result->fetch() ) |
|---|
| 47 |
{ |
|---|
| 48 |
do |
|---|
| 49 |
{ |
|---|
| 50 |
if( $row['liste_format'] == FORMAT_TEXTE ) |
|---|
| 51 |
{ |
|---|
| 52 |
$f = 'txt'; |
|---|
| 53 |
} |
|---|
| 54 |
else if( $row['liste_format'] == FORMAT_HTML ) |
|---|
| 55 |
{ |
|---|
| 56 |
$f = 'html'; |
|---|
| 57 |
} |
|---|
| 58 |
else |
|---|
| 59 |
{ |
|---|
| 60 |
$f = 'txt & html'; |
|---|
| 61 |
} |
|---|
| 62 |
|
|---|
| 63 |
$list_box .= '<option value="' . $row['liste_id'] . '"> ' . $row['liste_name'] . ' (' . $f . ') </option>'; |
|---|
| 64 |
} |
|---|
| 65 |
while( $row = $result->fetch() ); |
|---|
| 66 |
} |
|---|
| 67 |
else |
|---|
| 68 |
{ |
|---|
| 69 |
$message = 'No list found'; |
|---|
| 70 |
} |
|---|
| 71 |
|
|---|
| 72 |
$list_box .= '</select>'; |
|---|
| 73 |
} |
|---|
| 74 |
|
|---|
| 75 |
$output->send_headers(true); |
|---|
| 76 |
|
|---|
| 77 |
$output->set_filenames(array( |
|---|
| 78 |
'body' => 'subscribe_body.tpl' |
|---|
| 79 |
)); |
|---|
| 80 |
|
|---|
| 81 |
$output->assign_vars(array( |
|---|
| 82 |
'PAGE_TITLE' => $lang['Title']['form'], |
|---|
| 83 |
'L_INVALID_EMAIL' => str_replace('\'', '\\\'', $lang['Message']['Invalid_email']), |
|---|
| 84 |
'L_PAGE_LOADING' => str_replace('\'', '\\\'', $lang['Page_loading']), |
|---|
| 85 |
'L_EMAIL' => $lang['Email_address'], |
|---|
| 86 |
'L_FORMAT' => $lang['Format'], |
|---|
| 87 |
'L_DIFF_LIST' => $lang['Diff_list'], |
|---|
| 88 |
'L_SUBSCRIBE' => $lang['Subscribe'], |
|---|
| 89 |
'L_SETFORMAT' => $lang['Setformat'], |
|---|
| 90 |
'L_UNSUBSCRIBE' => $lang['Unsubscribe'], |
|---|
| 91 |
'L_VALID_BUTTON' => $lang['Button']['valid'], |
|---|
| 92 |
|
|---|
| 93 |
'LIST_BOX' => $list_box, |
|---|
| 94 |
'MESSAGE' => $message |
|---|
| 95 |
)); |
|---|
| 96 |
|
|---|
| 97 |
$output->pparse('body'); |
|---|
| 98 |
|
|---|
| 99 |
|
|---|
| 100 |
|
|---|
| 101 |
|
|---|
| 102 |
@restore_error_handler(); |
|---|
| 103 |
|
|---|
| 104 |
?> |
|---|
| 105 |
|
|---|