[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 | |
---|
| 6 | // | Copyright (C) 2006-2007 Ruben ARNAUD - team@phpwebgallery.net | |
---|
[1116] | 7 | // +-----------------------------------------------------------------------+ |
---|
| 8 | // | branch : BSF (Best So Far) |
---|
| 9 | // | file : $RCSfile$ |
---|
| 10 | // | last update : $Date: 2006-03-23 02:49:04 +0100 (jeu., 23 mars 2006) $ |
---|
| 11 | // | last modifier : $Author: rvelices $ |
---|
| 12 | // | revision : $Revision: 1094 $ |
---|
| 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 | |
---|
[1851] | 30 | //--------------------------------------------------------------------- include |
---|
[1116] | 31 | define('PHPWG_ROOT_PATH','./'); |
---|
| 32 | include_once(PHPWG_ROOT_PATH.'include/common.inc.php'); |
---|
[1851] | 33 | check_status(ACCESS_NONE); |
---|
[1116] | 34 | include_once(PHPWG_ROOT_PATH.'include/functions_notification.inc.php'); |
---|
| 35 | include_once(PHPWG_ROOT_PATH.'include/functions_mail.inc.php'); |
---|
| 36 | include_once(PHPWG_ROOT_PATH.'admin/include/functions.php'); |
---|
| 37 | include_once(PHPWG_ROOT_PATH.'admin/include/functions_notification_by_mail.inc.php'); |
---|
| 38 | // Translations are in admin file too |
---|
| 39 | include(get_language_filepath('admin.lang.php')); |
---|
[1699] | 40 | // Need to update a second time |
---|
| 41 | trigger_action('loading_lang'); |
---|
| 42 | @include(get_language_filepath('local.lang.php')); |
---|
[1116] | 43 | |
---|
[1699] | 44 | |
---|
[1116] | 45 | // +-----------------------------------------------------------------------+ |
---|
| 46 | // | Main | |
---|
| 47 | // +-----------------------------------------------------------------------+ |
---|
| 48 | $page['errors'] = array(); |
---|
| 49 | $page['infos'] = array(); |
---|
| 50 | |
---|
| 51 | if (isset($_GET['subscribe']) |
---|
| 52 | and preg_match('/^[A-Za-z0-9]{16}$/', $_GET['subscribe'])) |
---|
| 53 | { |
---|
[1806] | 54 | subscribe_notification_by_mail(false, array($_GET['subscribe'])); |
---|
[1116] | 55 | } |
---|
| 56 | else |
---|
| 57 | if (isset($_GET['unsubscribe']) |
---|
| 58 | and preg_match('/^[A-Za-z0-9]{16}$/', $_GET['unsubscribe'])) |
---|
| 59 | { |
---|
[1806] | 60 | unsubscribe_notification_by_mail(false, array($_GET['unsubscribe'])); |
---|
[1116] | 61 | } |
---|
| 62 | else |
---|
| 63 | { |
---|
[1118] | 64 | /* echo l10n('nbm_unknown_identifier'); |
---|
| 65 | exit();*/ |
---|
| 66 | array_push($page['errors'], l10n('nbm_unknown_identifier')); |
---|
[1116] | 67 | } |
---|
| 68 | |
---|
| 69 | // +-----------------------------------------------------------------------+ |
---|
[1118] | 70 | // | template initialization | |
---|
[1116] | 71 | // +-----------------------------------------------------------------------+ |
---|
[1118] | 72 | $title = $lang['nbm_item_notification']; |
---|
| 73 | $page['body_id'] = 'theNBMPage'; |
---|
| 74 | include(PHPWG_ROOT_PATH.'include/page_header.php'); |
---|
[1116] | 75 | |
---|
[1118] | 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 | // +-----------------------------------------------------------------------+ |
---|
[1116] | 83 | if (count($page['errors']) != 0) |
---|
| 84 | { |
---|
[1118] | 85 | $template->assign_block_vars('errors',array()); |
---|
[1116] | 86 | foreach ($page['errors'] as $error) |
---|
| 87 | { |
---|
[1118] | 88 | $template->assign_block_vars('errors.error',array('ERROR'=>$error)); |
---|
[1116] | 89 | } |
---|
| 90 | } |
---|
| 91 | |
---|
| 92 | if (count($page['infos']) != 0) |
---|
| 93 | { |
---|
[1118] | 94 | $template->assign_block_vars('infos',array()); |
---|
[1116] | 95 | foreach ($page['infos'] as $info) |
---|
| 96 | { |
---|
[1118] | 97 | $template->assign_block_vars('infos.info',array('INFO'=>$info)); |
---|
[1116] | 98 | } |
---|
| 99 | } |
---|
| 100 | |
---|
[1118] | 101 | // +-----------------------------------------------------------------------+ |
---|
| 102 | // | html code display | |
---|
| 103 | // +-----------------------------------------------------------------------+ |
---|
| 104 | $template->parse('nbm'); |
---|
| 105 | include(PHPWG_ROOT_PATH.'include/page_tail.php'); |
---|
[1116] | 106 | ?> |
---|