source: branches/2.4/nbm.php @ 18333

Revision 15578, 3.9 KB checked in by mistic100, 7 years ago (diff)

feature:2538 little rework of messages system, now can be used on 'loc_end_index' and 'loc_end_picture'

  • Property svn:eol-style set to LF
Line 
1<?php
2// +-----------------------------------------------------------------------+
3// | Piwigo - a PHP based photo gallery                                    |
4// +-----------------------------------------------------------------------+
5// | Copyright(C) 2008-2012 Piwigo Team                  http://piwigo.org |
6// | Copyright(C) 2003-2008 PhpWebGallery Team    http://phpwebgallery.net |
7// | Copyright(C) 2002-2003 Pierrick LE GALL   http://le-gall.net/pierrick |
8// +-----------------------------------------------------------------------+
9// | This program is free software; you can redistribute it and/or modify  |
10// | it under the terms of the GNU General Public License as published by  |
11// | the Free Software Foundation                                          |
12// |                                                                       |
13// | This program is distributed in the hope that it will be useful, but   |
14// | WITHOUT ANY WARRANTY; without even the implied warranty of            |
15// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU      |
16// | General Public License for more details.                              |
17// |                                                                       |
18// | You should have received a copy of the GNU General Public License     |
19// | along with this program; if not, write to the Free Software           |
20// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
21// | USA.                                                                  |
22// +-----------------------------------------------------------------------+
23
24
25//--------------------------------------------------------------------- include
26define('PHPWG_ROOT_PATH','./');
27include_once(PHPWG_ROOT_PATH.'include/common.inc.php');
28check_status(ACCESS_FREE);
29include_once(PHPWG_ROOT_PATH.'include/functions_notification.inc.php');
30include_once(PHPWG_ROOT_PATH.'include/functions_mail.inc.php');
31include_once(PHPWG_ROOT_PATH.'admin/include/functions.php');
32include_once(PHPWG_ROOT_PATH.'admin/include/functions_notification_by_mail.inc.php');
33// Translations are in admin file too
34load_language('admin.lang');
35// Need to update a second time
36trigger_action('loading_lang');
37load_language('lang', PHPWG_ROOT_PATH.PWG_LOCAL_DIR, array('no_fallback'=>true, 'local'=>true) );
38
39
40// +-----------------------------------------------------------------------+
41// | Main                                                                  |
42// +-----------------------------------------------------------------------+
43if (isset($_GET['subscribe'])
44    and preg_match('/^[A-Za-z0-9]{16}$/', $_GET['subscribe']))
45{
46  subscribe_notification_by_mail(false, array($_GET['subscribe']));
47}
48else
49if (isset($_GET['unsubscribe'])
50    and preg_match('/^[A-Za-z0-9]{16}$/', $_GET['unsubscribe']))
51{
52  unsubscribe_notification_by_mail(false, array($_GET['unsubscribe']));
53}
54else
55{
56  array_push($page['errors'], l10n('Unknown identifier'));
57}
58
59// +-----------------------------------------------------------------------+
60// | template initialization                                               |
61// +-----------------------------------------------------------------------+
62$title = l10n('Notification');
63$page['body_id'] = 'theNBMPage';
64
65$template->set_filenames(array('nbm'=>'nbm.tpl'));
66
67
68// include menubar
69$themeconf = $template->get_template_vars('themeconf');
70if (!isset($themeconf['hide_menu_on']) OR !in_array('theNBMPage', $themeconf['hide_menu_on']))
71{
72  include( PHPWG_ROOT_PATH.'include/menubar.inc.php');
73}
74
75// +-----------------------------------------------------------------------+
76// | html code display                                                     |
77// +-----------------------------------------------------------------------+
78include(PHPWG_ROOT_PATH.'include/page_header.php');
79include(PHPWG_ROOT_PATH.'include/page_messages.php');
80$template->parse('nbm');
81include(PHPWG_ROOT_PATH.'include/page_tail.php');
82?>
Note: See TracBrowser for help on using the repository browser.