source: branches/1.7/nbm.php @ 19048

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

Change headers with team email

Merge BSF 2058:2059 into branch-1_7

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