source: trunk/notification.php @ 2240

Last change on this file since 2240 was 2240, checked in by rvelices, 16 years ago

header.tpl goes smart

  • 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 2240 2008-03-02 00:29:27Z rvelices $
8// | last update   : $Date: 2008-03-02 00:29:27 +0000 (Sun, 02 Mar 2008) $
9// | last modifier : $Author: rvelices $
10// | revision      : $Revision: 2240 $
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->append('head_elements',
75    '<link rel="alternate" type="application/rss+xml" href="'.$feed_url.'">'
76  );
77
78include(PHPWG_ROOT_PATH.'include/page_header.php');
79$template->set_filenames(array('notification'=>'notification.tpl'));
80
81$template->assign_vars(
82  array(
83    'U_FEED' => $feed_url,
84    'U_FEED_IMAGE_ONLY' => $feed_image_only_url,
85    'U_HOME' => make_index_url(),
86    )
87  );
88
89// +-----------------------------------------------------------------------+
90// |                           html code display                           |
91// +-----------------------------------------------------------------------+
92
93$template->parse('notification');
94include(PHPWG_ROOT_PATH.'include/page_tail.php');
95
96?>
Note: See TracBrowser for help on using the repository browser.