source: trunk/nbm.php @ 1116

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

[NBM] Step 7: Add functionalities subscribe/unsubscribe:

o reduce length of check_key
o fix bugs
o send mail on subscribe/unsubscribe
o add and used $conf parameters
o review keyword of languages
o improve selection/check
o can subscribe/unsubscribe with a link include on mail
o fix bug mass_update collate

File size: 3.4 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-2006 PhpWebGallery Team - http://phpwebgallery.net |
6// | Copyright (C) 2006 Ruben ARNAUD - team@phpwebgallery.net              |
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
30define('PHPWG_ROOT_PATH','./');
31include_once(PHPWG_ROOT_PATH.'include/common.inc.php');
32include_once(PHPWG_ROOT_PATH.'include/functions_notification.inc.php');
33include_once(PHPWG_ROOT_PATH.'include/functions_mail.inc.php');
34include_once(PHPWG_ROOT_PATH.'admin/include/functions.php');
35include_once(PHPWG_ROOT_PATH.'admin/include/functions_notification_by_mail.inc.php');
36// Translations are in admin file too
37include(get_language_filepath('admin.lang.php'));
38
39// +-----------------------------------------------------------------------+
40// | Main                                                                  |
41// +-----------------------------------------------------------------------+
42$page['errors'] = array();
43$page['infos'] = array();
44
45if (isset($_GET['subscribe'])
46    and preg_match('/^[A-Za-z0-9]{16}$/', $_GET['subscribe']))
47{
48  subcribe_notification_by_mail(false, array($_GET['subscribe']));
49}
50else
51if (isset($_GET['unsubscribe'])
52    and preg_match('/^[A-Za-z0-9]{16}$/', $_GET['unsubscribe']))
53{
54  unsubcribe_notification_by_mail(false, array($_GET['unsubscribe']));
55}
56else
57{
58  echo l10n('nbm_unknown_identifier');
59  exit();
60}
61
62// +-----------------------------------------------------------------------+
63// |                        infos & errors display                         |
64// +-----------------------------------------------------------------------+
65echo '<pre>';
66
67if (count($page['errors']) != 0)
68{
69  echo "\n\nErrors:\n";
70  foreach ($page['errors'] as $error)
71  {
72    echo $error."\n";
73  }
74}
75
76if (count($page['infos']) != 0)
77{
78  echo "\n\nInformations:\n";
79  foreach ($page['infos'] as $info)
80  {
81    echo $info."\n";
82  }
83}
84
85echo '</pre>';
86
87
88?>
Note: See TracBrowser for help on using the repository browser.