source: trunk/notification.php @ 2206

Last change on this file since 2206 was 2029, checked in by rub, 17 years ago

Resolved issue 0000697: with generic user a author name is necessary to comment picture.

+ Change way to determinate if user is a guest (use functions like is_admin)

  • Property svn:eol-style set to LF
  • Property svn:keywords set to Author Date Id Revision
File size: 3.9 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-2007 PhpWebGallery Team - http://phpwebgallery.net |
6// +-----------------------------------------------------------------------+
7// | file          : $Id: notification.php 2029 2007-06-05 22:01:15Z rub $
8// | last update   : $Date: 2007-06-05 22:01:15 +0000 (Tue, 05 Jun 2007) $
9// | last modifier : $Author: rub $
10// | revision      : $Revision: 2029 $
11// +-----------------------------------------------------------------------+
12// | This program is free software; you can redistribute it and/or modify  |
13// | it under the terms of the GNU General Public License as published by  |
14// | the Free Software Foundation                                          |
15// |                                                                       |
16// | This program is distributed in the hope that it will be useful, but   |
17// | WITHOUT ANY WARRANTY; without even the implied warranty of            |
18// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU      |
19// | General Public License for more details.                              |
20// |                                                                       |
21// | You should have received a copy of the GNU General Public License     |
22// | along with this program; if not, write to the Free Software           |
23// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
24// | USA.                                                                  |
25// +-----------------------------------------------------------------------+
26
27// +-----------------------------------------------------------------------+
28// |                           initialization                              |
29// +-----------------------------------------------------------------------+
30
31define('PHPWG_ROOT_PATH','./');
32include_once( PHPWG_ROOT_PATH.'include/common.inc.php' );
33
34// +-----------------------------------------------------------------------+
35// | Check Access and exit when user status is not ok                      |
36// +-----------------------------------------------------------------------+
37check_status(ACCESS_GUEST);
38
39// +-----------------------------------------------------------------------+
40// |                          new feed creation                            |
41// +-----------------------------------------------------------------------+
42
43$page['feed'] = find_available_feed_id();
44
45$query = '
46INSERT INTO '.USER_FEED_TABLE.'
47  (id, user_id, last_check)
48  VALUES
49  (\''.$page['feed'].'\', '.$user['id'].', NULL)
50;';
51pwg_query($query);
52
53
54$feed_url=PHPWG_ROOT_PATH.'feed.php';
55if (is_a_guest())
56{
57  $feed_image_only_url=$feed_url;
58  $feed_url .= '?feed='.$page['feed'];
59}
60else
61{
62  $feed_url .= '?feed='.$page['feed'];
63  $feed_image_only_url=$feed_url.'&amp;image_only';
64}
65
66// +-----------------------------------------------------------------------+
67// |                        template initialization                        |
68// +-----------------------------------------------------------------------+
69
70$title = l10n('Notification');
71$page['body_id'] = 'theNotificationPage';
72$page['meta_robots']=array('noindex'=>1, 'nofollow'=>1);
73
74$template->assign_block_vars('head_element',
75    array(
76      'CONTENT' => '<link rel="alternate" type="application/rss+xml" href="'.$feed_url.'">'
77      )
78  );
79
80include(PHPWG_ROOT_PATH.'include/page_header.php');
81$template->set_filenames(array('notification'=>'notification.tpl'));
82
83$template->assign_vars(
84  array(
85    'U_FEED' => $feed_url,
86    'U_FEED_IMAGE_ONLY' => $feed_image_only_url,
87    'U_HOME' => make_index_url(),
88    )
89  );
90
91// +-----------------------------------------------------------------------+
92// |                           html code display                           |
93// +-----------------------------------------------------------------------+
94
95$template->parse('notification');
96include(PHPWG_ROOT_PATH.'include/page_tail.php');
97
98?>
Note: See TracBrowser for help on using the repository browser.