source: trunk/nbm.php @ 6267

Last change on this file since 6267 was 5208, checked in by patdenice, 15 years ago

feature 1522: Move local css local files and local language files to local directory.
Add $conftemplate_force_compile to help developpers.

File size: 4.0 KB
RevLine 
[1116]1<?php
2// +-----------------------------------------------------------------------+
[2297]3// | Piwigo - a PHP based picture gallery                                  |
4// +-----------------------------------------------------------------------+
[5196]5// | Copyright(C) 2008-2010 Piwigo Team                  http://piwigo.org |
[2297]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// +-----------------------------------------------------------------------+
[1116]23
24
[1851]25//--------------------------------------------------------------------- include
[1116]26define('PHPWG_ROOT_PATH','./');
27include_once(PHPWG_ROOT_PATH.'include/common.inc.php');
[2325]28check_status(ACCESS_FREE);
[1116]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
[2126]34load_language('admin.lang');
[1699]35// Need to update a second time
36trigger_action('loading_lang');
[5208]37load_language('lang', PHPWG_ROOT_PATH.'local/', array('no_fallback'=>true, 'local'=>true) );
[1116]38
[1699]39
[2126]40
[1116]41// +-----------------------------------------------------------------------+
42// | Main                                                                  |
43// +-----------------------------------------------------------------------+
44$page['errors'] = array();
45$page['infos'] = array();
46
47if (isset($_GET['subscribe'])
48    and preg_match('/^[A-Za-z0-9]{16}$/', $_GET['subscribe']))
49{
[1806]50  subscribe_notification_by_mail(false, array($_GET['subscribe']));
[1116]51}
52else
53if (isset($_GET['unsubscribe'])
54    and preg_match('/^[A-Za-z0-9]{16}$/', $_GET['unsubscribe']))
55{
[1806]56  unsubscribe_notification_by_mail(false, array($_GET['unsubscribe']));
[1116]57}
58else
59{
[5021]60  array_push($page['errors'], l10n('Unknown identifier'));
[1116]61}
62
63// +-----------------------------------------------------------------------+
[1118]64// | template initialization                                               |
[1116]65// +-----------------------------------------------------------------------+
[5021]66$title = l10n('Notification');
[1118]67$page['body_id'] = 'theNBMPage';
68include(PHPWG_ROOT_PATH.'include/page_header.php');
[1116]69
[1118]70$template->set_filenames(array('nbm'=>'nbm.tpl'));
71
72// +-----------------------------------------------------------------------+
73// | errors & infos                                                        |
74// +-----------------------------------------------------------------------+
[2278]75$template->assign(
76    array(
77      'errors' => $page['errors'],
78      'infos' => $page['infos'],
79    )
80  );
[1116]81
[1118]82// +-----------------------------------------------------------------------+
83// | html code display                                                     |
84// +-----------------------------------------------------------------------+
85$template->parse('nbm');
86include(PHPWG_ROOT_PATH.'include/page_tail.php');
[2278]87?>
Note: See TracBrowser for help on using the repository browser.