-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathe_rss.php
More file actions
74 lines (60 loc) · 1.82 KB
/
Copy pathe_rss.php
File metadata and controls
74 lines (60 loc) · 1.82 KB
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
62
63
64
65
66
67
68
69
70
71
72
73
74
<?php
if (!defined('e107_INIT'))
{
exit;
}
// v2.x Standard
class onthisday_rss // plugin-folder + '_rss'
{
/**
* Admin RSS Configuration
*/
function config()
{
$config = array();
$config[] = array(
'name' => 'On This Day',
'url' => 'onthisday',
'topic_id' => '',
'description' => 'this is the rss feed for the onthisday plugin', // that's 'description' not 'text'
'class' => '0',
'limit' => '9');
return $config;
}
/**
* Compile RSS Data
* @param array $parms
* @param string $parms['url']
* @param int $parms['limit']
* @param int $parms['id']
* @return array
*/
function data($parms = array())
{
$sql = e107::getDb();
$rss = array();
$i = 0;
$d = (int)date('d');
$m = (int)date('m');
if ($items = $sql->select('onthisday', "*", "otd_day=$d and otd_month=$m LIMIT 0," . $parms['limit']))
{
while ($row = $sql->fetch())
{
// $rss[$i]['author'] = $row['mib_user_id'];
// $rss[$i]['author_email'] = $row['mib_user_email'];
$rss[$i]['link'] = "onthisday/index.php?";
$rss[$i]['linkid'] = $row['otd_id'];
$rss[$i]['title'] = $row['otd_brief'];
$rss[$i]['description'] = $row['otd_full'];
// $rss[$i]['category_name'] = '';
// $rss[$i]['category_link'] = '';
$rss[$i]['datestamp'] = $row['otd_day'] . '-' . $row['otd_month'] . '-' . $row['otd_year'];
$rss[$i]['enc_url'] = "";
$rss[$i]['enc_leng'] = "";
$rss[$i]['enc_type'] = "";
$i++;
}
}
return $rss;
}
}