1 | <?php |
---|
2 | // +-----------------------------------------------------------------------+ |
---|
3 | // | Piwigo - a PHP based photo gallery | |
---|
4 | // +-----------------------------------------------------------------------+ |
---|
5 | // | Copyright(C) 2008-2012 Piwigo Team http://piwigo.org | |
---|
6 | // | Copyright(C) 2003-2008 PhpWebGallery Team http://phpwebgallery.net | |
---|
7 | // | Copyright(C) 2002-2003 Pierrick LE GALL http://le-gall.net/pierrick | |
---|
8 | // +-----------------------------------------------------------------------+ |
---|
9 | // | This program is free software; you can redistribute it and/or modify | |
---|
10 | // | it under the terms of the GNU General Public License as published by | |
---|
11 | // | the Free Software Foundation | |
---|
12 | // | | |
---|
13 | // | This program is distributed in the hope that it will be useful, but | |
---|
14 | // | WITHOUT ANY WARRANTY; without even the implied warranty of | |
---|
15 | // | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
---|
16 | // | General Public License for more details. | |
---|
17 | // | | |
---|
18 | // | You should have received a copy of the GNU General Public License | |
---|
19 | // | along with this program; if not, write to the Free Software | |
---|
20 | // | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, | |
---|
21 | // | USA. | |
---|
22 | // +-----------------------------------------------------------------------+ |
---|
23 | |
---|
24 | // +-----------------------------------------------------------------------+ |
---|
25 | // | initialization | |
---|
26 | // +-----------------------------------------------------------------------+ |
---|
27 | |
---|
28 | define('PHPWG_ROOT_PATH','./'); |
---|
29 | include_once( PHPWG_ROOT_PATH.'include/common.inc.php' ); |
---|
30 | |
---|
31 | // +-----------------------------------------------------------------------+ |
---|
32 | // | Check Access and exit when user status is not ok | |
---|
33 | // +-----------------------------------------------------------------------+ |
---|
34 | check_status(ACCESS_GUEST); |
---|
35 | |
---|
36 | // +-----------------------------------------------------------------------+ |
---|
37 | // | new feed creation | |
---|
38 | // +-----------------------------------------------------------------------+ |
---|
39 | |
---|
40 | $page['feed'] = find_available_feed_id(); |
---|
41 | |
---|
42 | $query = ' |
---|
43 | INSERT INTO '.USER_FEED_TABLE.' |
---|
44 | (id, user_id, last_check) |
---|
45 | VALUES |
---|
46 | (\''.$page['feed'].'\', '.$user['id'].', NULL) |
---|
47 | ;'; |
---|
48 | pwg_query($query); |
---|
49 | |
---|
50 | |
---|
51 | $feed_url=PHPWG_ROOT_PATH.'feed.php'; |
---|
52 | if (is_a_guest()) |
---|
53 | { |
---|
54 | $feed_image_only_url=$feed_url; |
---|
55 | $feed_url .= '?feed='.$page['feed']; |
---|
56 | } |
---|
57 | else |
---|
58 | { |
---|
59 | $feed_url .= '?feed='.$page['feed']; |
---|
60 | $feed_image_only_url=$feed_url.'&image_only'; |
---|
61 | } |
---|
62 | |
---|
63 | // +-----------------------------------------------------------------------+ |
---|
64 | // | template initialization | |
---|
65 | // +-----------------------------------------------------------------------+ |
---|
66 | |
---|
67 | $title = l10n('Notification'); |
---|
68 | $page['body_id'] = 'theNotificationPage'; |
---|
69 | $page['meta_robots']=array('noindex'=>1, 'nofollow'=>1); |
---|
70 | |
---|
71 | |
---|
72 | $template->set_filenames(array('notification'=>'notification.tpl')); |
---|
73 | |
---|
74 | $template->assign( |
---|
75 | array( |
---|
76 | 'U_FEED' => $feed_url, |
---|
77 | 'U_FEED_IMAGE_ONLY' => $feed_image_only_url, |
---|
78 | ) |
---|
79 | ); |
---|
80 | |
---|
81 | // include menubar |
---|
82 | $themeconf = $template->get_template_vars('themeconf'); |
---|
83 | if (!isset($themeconf['hide_menu_on']) OR !in_array('theNotificationPage', $themeconf['hide_menu_on'])) |
---|
84 | { |
---|
85 | include( PHPWG_ROOT_PATH.'include/menubar.inc.php'); |
---|
86 | } |
---|
87 | |
---|
88 | // +-----------------------------------------------------------------------+ |
---|
89 | // | html code display | |
---|
90 | // +-----------------------------------------------------------------------+ |
---|
91 | include(PHPWG_ROOT_PATH.'include/page_header.php'); |
---|
92 | $template->pparse('notification'); |
---|
93 | include(PHPWG_ROOT_PATH.'include/page_tail.php'); |
---|
94 | |
---|
95 | ?> |
---|