source: trunk/nbm.php @ 1726

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

Feature Issue ID 0000496: Integrate MOD add_index on PWG with plugin.lang.php

Add some plugin triggers:

o for help
o for language
o for site manager
o for advanced features

Allow to launch directly plugin page (without section key)

Add add_index plugin, available on site manager and advanced features

Configuration page and best help must be coming soon.

File size: 4.5 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// Need to update a second time
39trigger_action('loading_lang');
40@include(get_language_filepath('local.lang.php'));
41
42
43// +-----------------------------------------------------------------------+
44// | Main                                                                  |
45// +-----------------------------------------------------------------------+
46$page['errors'] = array();
47$page['infos'] = array();
48
49if (isset($_GET['subscribe'])
50    and preg_match('/^[A-Za-z0-9]{16}$/', $_GET['subscribe']))
51{
52  subcribe_notification_by_mail(false, array($_GET['subscribe']));
53}
54else
55if (isset($_GET['unsubscribe'])
56    and preg_match('/^[A-Za-z0-9]{16}$/', $_GET['unsubscribe']))
57{
58  unsubcribe_notification_by_mail(false, array($_GET['unsubscribe']));
59}
60else
61{
62/*  echo l10n('nbm_unknown_identifier');
63  exit();*/
64  array_push($page['errors'], l10n('nbm_unknown_identifier'));
65}
66
67// +-----------------------------------------------------------------------+
68// | template initialization                                               |
69// +-----------------------------------------------------------------------+
70$title = $lang['nbm_item_notification'];
71$page['body_id'] = 'theNBMPage';
72include(PHPWG_ROOT_PATH.'include/page_header.php');
73
74$template->set_filenames(array('nbm'=>'nbm.tpl'));
75
76$template->assign_vars(array('U_HOME' => make_index_url()));
77
78// +-----------------------------------------------------------------------+
79// | errors & infos                                                        |
80// +-----------------------------------------------------------------------+
81if (count($page['errors']) != 0)
82{
83  $template->assign_block_vars('errors',array());
84  foreach ($page['errors'] as $error)
85  {
86    $template->assign_block_vars('errors.error',array('ERROR'=>$error));
87  }
88}
89
90if (count($page['infos']) != 0)
91{
92  $template->assign_block_vars('infos',array());
93  foreach ($page['infos'] as $info)
94  {
95    $template->assign_block_vars('infos.info',array('INFO'=>$info));
96  }
97}
98
99// +-----------------------------------------------------------------------+
100// | html code display                                                     |
101// +-----------------------------------------------------------------------+
102$template->parse('nbm');
103include(PHPWG_ROOT_PATH.'include/page_tail.php');
104?>
Note: See TracBrowser for help on using the repository browser.