summaryrefslogtreecommitdiff
path: root/watches.php
blob: 80be4c869a8257f3722eaca8487bfc323f84209f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
<?php
/**
 * $Header: /cvsroot/bitweaver/_bit_users/watches.php,v 1.9 2009/10/01 14:17:06 wjames5 Exp $
 *
 * Copyright (c) 2004 bitweaver.org
 * Copyright (c) 2003 tikwiki.org
 * Copyright (c) 2002-2003, Luis Argerich, Garland Foster, Eduardo Polidor, et. al.
 * All Rights Reserved. See below for details and a complete list of authors.
 * Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See http://www.gnu.org/copyleft/lesser.html for details
 *
 * $Id: watches.php,v 1.9 2009/10/01 14:17:06 wjames5 Exp $
 * @package users
 * @subpackage functions
 */

/**
 * required setup
 */
include_once( '../bit_setup_inc.php' );
$user = $gBitUser->mUserId;
if (!$user) {
	$gBitSmarty->assign('msg', tra("You must log in to use this feature"));
	$gBitSystem->display( 'error.tpl' , NULL, array( 'display_mode' => 'display' ));
	die;
}

$gBitSystem->verifyFeature( 'users_watches' );

if (isset($_REQUEST['hash'])) {
	
	$gBitUser->remove_user_watch_by_hash($_REQUEST['hash']);
}
if (isset($_REQUEST['watch'])) {
	
	foreach (array_keys($_REQUEST["watch"])as $item) {
		$gBitUser->remove_user_watch_by_hash($item);
	}
}
// Get watch events and put them in watch_events
$events = $gBitUser->get_watches_events();
$gBitSmarty->assign('events', $events);
// if not set event type then all
if (!isset($_REQUEST['event']))
	$_REQUEST['event'] = '';
// get all the information for the event
$watches = $gBitUser->getWatches( $_REQUEST['event'] );
$gBitSmarty->assign('watches', $watches);

$gBitSystem->display( 'bitpackage:users/user_watches.tpl', NULL, array( 'display_mode' => 'display' ));
?>