source: trunk/nbm.php @ 2014

Last change on this file since 2014 was 2014, checked in by rub, 17 years ago

Replace some $lang by l10n

  • Property svn:eol-style set to LF
  • Property svn:keywords set to Author Date Id Revision
File size: 4.4 KB
Line 
1<?php
2// +-----------------------------------------------------------------------+
3// | PhpWebGallery - a PHP based picture gallery                           |
4// | Copyright (C) 2002-2003 Pierrick LE GALL - pierrick@phpwebgallery.net |
5// | Copyright (C) 2003-2007 PhpWebGallery Team - http://phpwebgallery.net |
6// | Copyright (C) 2006-2007   Ruben ARNAUD - team@phpwebgallery.net       |
7// +-----------------------------------------------------------------------+
8// | file          : $Id: nbm.php 2014 2007-05-15 20:23:09Z rub $
9// | last update   : $Date: 2007-05-15 20:23:09 +0000 (Tue, 15 May 2007) $
10// | last modifier : $Author: rub $
11// | revision      : $Revision: 2014 $
12// +-----------------------------------------------------------------------+
13// | This program is free software; you can redistribute it and/or modify  |
14// | it under the terms of the GNU General Public License as published by  |
15// | the Free Software Foundation                                          |
16// |                                                                       |
17// | This program is distributed in the hope that it will be useful, but   |
18// | WITHOUT ANY WARRANTY; without even the implied warranty of            |
19// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU      |
20// | General Public License for more details.                              |
21// |                                                                       |
22// | You should have received a copy of the GNU General Public License     |
23// | along with this program; if not, write to the Free Software           |
24// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
25// | USA.                                                                  |
26// +-----------------------------------------------------------------------+
27
28
29//--------------------------------------------------------------------- include
30define('PHPWG_ROOT_PATH','./');
31include_once(PHPWG_ROOT_PATH.'include/common.inc.php');
32check_status(ACCESS_NONE);
33include_once(PHPWG_ROOT_PATH.'include/functions_notification.inc.php');
34include_once(PHPWG_ROOT_PATH.'include/functions_mail.inc.php');
35include_once(PHPWG_ROOT_PATH.'admin/include/functions.php');
36include_once(PHPWG_ROOT_PATH.'admin/include/functions_notification_by_mail.inc.php');
37// Translations are in admin file too
38include(get_language_filepath('admin.lang.php'));
39// Need to update a second time
40trigger_action('loading_lang');
41@include(get_language_filepath('local.lang.php'));
42
43
44// +-----------------------------------------------------------------------+
45// | Main                                                                  |
46// +-----------------------------------------------------------------------+
47$page['errors'] = array();
48$page['infos'] = array();
49
50if (isset($_GET['subscribe'])
51    and preg_match('/^[A-Za-z0-9]{16}$/', $_GET['subscribe']))
52{
53  subscribe_notification_by_mail(false, array($_GET['subscribe']));
54}
55else
56if (isset($_GET['unsubscribe'])
57    and preg_match('/^[A-Za-z0-9]{16}$/', $_GET['unsubscribe']))
58{
59  unsubscribe_notification_by_mail(false, array($_GET['unsubscribe']));
60}
61else
62{
63  array_push($page['errors'], l10n('nbm_unknown_identifier'));
64}
65
66// +-----------------------------------------------------------------------+
67// | template initialization                                               |
68// +-----------------------------------------------------------------------+
69$title = l10n('nbm_item_notification');
70$page['body_id'] = 'theNBMPage';
71include(PHPWG_ROOT_PATH.'include/page_header.php');
72
73$template->set_filenames(array('nbm'=>'nbm.tpl'));
74
75$template->assign_vars(array('U_HOME' => make_index_url()));
76
77// +-----------------------------------------------------------------------+
78// | errors & infos                                                        |
79// +-----------------------------------------------------------------------+
80if (count($page['errors']) != 0)
81{
82  $template->assign_block_vars('errors',array());
83  foreach ($page['errors'] as $error)
84  {
85    $template->assign_block_vars('errors.error',array('ERROR'=>$error));
86  }
87}
88
89if (count($page['infos']) != 0)
90{
91  $template->assign_block_vars('infos',array());
92  foreach ($page['infos'] as $info)
93  {
94    $template->assign_block_vars('infos.info',array('INFO'=>$info));
95  }
96}
97
98// +-----------------------------------------------------------------------+
99// | html code display                                                     |
100// +-----------------------------------------------------------------------+
101$template->parse('nbm');
102include(PHPWG_ROOT_PATH.'include/page_tail.php');
103?>
Note: See TracBrowser for help on using the repository browser.