root/trunk/subscribe.php

Revision 395, 2.7 kB (checked in by bobe, 2 years ago)

Localisation manquante pour le titre du formulaire par défaut

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
Line 
1 <?php
2 /**
3  * Copyright (c) 2002-2006 Aurélien Maille
4  *
5  * This file is part of Wanewsletter.
6  *
7  * Wanewsletter is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License
9  * as published by the Free Software Foundation; either version 2
10  * of the License, or (at your option) any later version.
11  *
12  * Wanewsletter is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with Wanewsletter; if not, write to the Free Software
19  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
20  *
21  * @package Wanewsletter
22  * @author  Bobe <wascripts@phpcodeur.net>
23  * @link    http://phpcodeur.net/wascripts/wanewsletter/
24  * @license http://www.gnu.org/copyleft/gpl.html  GNU General Public License
25  * @version $Id$
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 &amp; 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 // On réactive le gestionnaire d'erreur précédent
101 //
102 @restore_error_handler();
103
104 ?>
105
Note: See TracBrowser for help on using the browser.