[1116] | 1 | <?php |
---|
| 2 | // +-----------------------------------------------------------------------+ |
---|
| 3 | // | PhpWebGallery - a PHP based picture gallery | |
---|
| 4 | // | Copyright (C) 2002-2003 Pierrick LE GALL - pierrick@phpwebgallery.net | |
---|
[1806] | 5 | // | Copyright (C) 2003-2007 PhpWebGallery Team - http://phpwebgallery.net | |
---|
[1116] | 6 | // +-----------------------------------------------------------------------+ |
---|
[2014] | 7 | // | file : $Id: nbm.php 2126 2007-10-08 23:46:09Z rvelices $ |
---|
[1912] | 8 | // | last update : $Date: 2007-10-08 23:46:09 +0000 (Mon, 08 Oct 2007) $ |
---|
| 9 | // | last modifier : $Author: rvelices $ |
---|
| 10 | // | revision : $Revision: 2126 $ |
---|
[1116] | 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 | |
---|
[1851] | 28 | //--------------------------------------------------------------------- include |
---|
[1116] | 29 | define('PHPWG_ROOT_PATH','./'); |
---|
| 30 | include_once(PHPWG_ROOT_PATH.'include/common.inc.php'); |
---|
[1851] | 31 | check_status(ACCESS_NONE); |
---|
[1116] | 32 | include_once(PHPWG_ROOT_PATH.'include/functions_notification.inc.php'); |
---|
| 33 | include_once(PHPWG_ROOT_PATH.'include/functions_mail.inc.php'); |
---|
| 34 | include_once(PHPWG_ROOT_PATH.'admin/include/functions.php'); |
---|
| 35 | include_once(PHPWG_ROOT_PATH.'admin/include/functions_notification_by_mail.inc.php'); |
---|
| 36 | // Translations are in admin file too |
---|
[2126] | 37 | load_language('admin.lang'); |
---|
[1699] | 38 | // Need to update a second time |
---|
| 39 | trigger_action('loading_lang'); |
---|
[2126] | 40 | load_language('local.lang'); |
---|
[1116] | 41 | |
---|
[1699] | 42 | |
---|
[2126] | 43 | |
---|
[1116] | 44 | // +-----------------------------------------------------------------------+ |
---|
| 45 | // | Main | |
---|
| 46 | // +-----------------------------------------------------------------------+ |
---|
| 47 | $page['errors'] = array(); |
---|
| 48 | $page['infos'] = array(); |
---|
| 49 | |
---|
| 50 | if (isset($_GET['subscribe']) |
---|
| 51 | and preg_match('/^[A-Za-z0-9]{16}$/', $_GET['subscribe'])) |
---|
| 52 | { |
---|
[1806] | 53 | subscribe_notification_by_mail(false, array($_GET['subscribe'])); |
---|
[1116] | 54 | } |
---|
| 55 | else |
---|
| 56 | if (isset($_GET['unsubscribe']) |
---|
| 57 | and preg_match('/^[A-Za-z0-9]{16}$/', $_GET['unsubscribe'])) |
---|
| 58 | { |
---|
[1806] | 59 | unsubscribe_notification_by_mail(false, array($_GET['unsubscribe'])); |
---|
[1116] | 60 | } |
---|
| 61 | else |
---|
| 62 | { |
---|
[1118] | 63 | array_push($page['errors'], l10n('nbm_unknown_identifier')); |
---|
[1116] | 64 | } |
---|
| 65 | |
---|
| 66 | // +-----------------------------------------------------------------------+ |
---|
[1118] | 67 | // | template initialization | |
---|
[1116] | 68 | // +-----------------------------------------------------------------------+ |
---|
[2014] | 69 | $title = l10n('nbm_item_notification'); |
---|
[1118] | 70 | $page['body_id'] = 'theNBMPage'; |
---|
| 71 | include(PHPWG_ROOT_PATH.'include/page_header.php'); |
---|
[1116] | 72 | |
---|
[1118] | 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 | // +-----------------------------------------------------------------------+ |
---|
[1116] | 80 | if (count($page['errors']) != 0) |
---|
| 81 | { |
---|
[1118] | 82 | $template->assign_block_vars('errors',array()); |
---|
[1116] | 83 | foreach ($page['errors'] as $error) |
---|
| 84 | { |
---|
[1118] | 85 | $template->assign_block_vars('errors.error',array('ERROR'=>$error)); |
---|
[1116] | 86 | } |
---|
| 87 | } |
---|
| 88 | |
---|
| 89 | if (count($page['infos']) != 0) |
---|
| 90 | { |
---|
[1118] | 91 | $template->assign_block_vars('infos',array()); |
---|
[1116] | 92 | foreach ($page['infos'] as $info) |
---|
| 93 | { |
---|
[1118] | 94 | $template->assign_block_vars('infos.info',array('INFO'=>$info)); |
---|
[1116] | 95 | } |
---|
| 96 | } |
---|
| 97 | |
---|
[1118] | 98 | // +-----------------------------------------------------------------------+ |
---|
| 99 | // | html code display | |
---|
| 100 | // +-----------------------------------------------------------------------+ |
---|
| 101 | $template->parse('nbm'); |
---|
| 102 | include(PHPWG_ROOT_PATH.'include/page_tail.php'); |
---|
[1116] | 103 | ?> |
---|