source: branches/1.6/nbm.php @ 26010

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

[NBM] Step 8: Change info plain-text to html-text (pwg designed)

File size: 4.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  array_push($page['errors'], l10n('nbm_unknown_identifier'));
61}
62
63// +-----------------------------------------------------------------------+
64// | template initialization                                               |
65// +-----------------------------------------------------------------------+
66$title = $lang['nbm_item_notification'];
67$page['body_id'] = 'theNBMPage';
68include(PHPWG_ROOT_PATH.'include/page_header.php');
69
70$template->set_filenames(array('nbm'=>'nbm.tpl'));
71
72$template->assign_vars(array('U_HOME' => make_index_url()));
73
74// +-----------------------------------------------------------------------+
75// | errors & infos                                                        |
76// +-----------------------------------------------------------------------+
77if (count($page['errors']) != 0)
78{
79  $template->assign_block_vars('errors',array());
80  foreach ($page['errors'] as $error)
81  {
82    $template->assign_block_vars('errors.error',array('ERROR'=>$error));
83  }
84}
85
86if (count($page['infos']) != 0)
87{
88  $template->assign_block_vars('infos',array());
89  foreach ($page['infos'] as $info)
90  {
91    $template->assign_block_vars('infos.info',array('INFO'=>$info));
92  }
93}
94
95// +-----------------------------------------------------------------------+
96// | html code display                                                     |
97// +-----------------------------------------------------------------------+
98$template->parse('nbm');
99include(PHPWG_ROOT_PATH.'include/page_tail.php');
100?>
Note: See TracBrowser for help on using the repository browser.