/
linkhandler.php
61 lines (53 loc) · 1 KB
/
linkhandler.php
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
51
52
53
54
55
56
57
58
59
60
61
<?php
/**
* LinkHandler class
* Produces link specific RSS2 and Atom feeds
*
* @package Habari
*
* @version $Id$
* @copyright 2008
*/
class LinkHandler extends AtomHandler
{
public static $feeds= array(
'all',
'entries',
'links'
);
private $current_url = '';
/**
* Respond to requests for podcast feeds
*
*/
public function act_feed()
{
// Expecting: entire_match, name in handler_vars
$this->current_url = Site::get_url( 'habari' ) . '/' . $this->handler_vars['entire_match'];
$params= array();
switch($this->handler_vars['name']) {
case 'entries':
parent::act_collection();
exit;
case 'links':
$params['content_type']= array(
Post::type( 'link' ),
);
break;
case 'all':
$params['content_type']= array(
Post::type( 'link' ),
Post::type( 'entry' )
);
break;
default:
$params['content_type']= array(
Post::type( $this->handler_vars['name'] )
);
break;
}
parent::get_collection($params);
exit;
}
}
?>