source: trunk/nbm.php @ 2004

Last change on this file since 2004 was 1912, checked in by rub, 18 years ago

Update svn properties (svn:eol-style and svn:keywords)

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