-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathe_rss.php
More file actions
81 lines (75 loc) · 2.72 KB
/
e_rss.php
File metadata and controls
81 lines (75 loc) · 2.72 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
75
76
77
78
79
80
81
<?php
if (!defined('e107_INIT'))
{
exit;
}
require_once(e_PLUGIN . "kbase/includes/kbase_class.php");
if (!is_object($kbase_obj))
{
$kbase_obj = new kbase;
}
if (!is_object($kbase_gen))
{
$kbase_gen = new convert;
}
global $e107;
// ##### e_rss.php ---------------------------------------------
// get all the categories
$feed['name'] = KBASELAN_RSS01;
$feed['url'] = "kbase";
$feed['topic_id'] = '';
$feed['path'] = 'kbase';
$feed['text'] = KBASELAN_RSS02 ;
$feed['class'] = '0';
$feed['limit'] = '9';
$eplug_rss_feed[] = $feed;
// ##### --------------------------------------------------------
// ##### create rss data, return as array $eplug_rss_data -------
$rss = array();
global $KBASE_PREF, $sql, $tp;
// if ($kbase_obj->articulate_reader)
{
// get kbases which are approved and are visible to this class viz everybody
$kbase_args = "
select s.*,c.kbase_info_title from #kbase as s
left join #kbase_info as c on s.kbase_parent=c.kbase_info_id
where s.kbase_approved>0 and find_in_set(kbase_info_class,'" . USERCLASS_LIST . "')
order by s.kbase_datestamp desc LIMIT 0," . $this->limit;
if ($items = $sql->db_Select_gen($kbase_args, false))
{
$i = 0;
while ($rowrss = $sql->db_Fetch())
{
$rss[$i]['author'] = $tp->toRss(substr($rowrss['kbase_author'], strpos($rowrss['kbase_author'], ".") + 1), false);
$rss[$i]['author_email'] = '';
$rss[$i]['link'] = $e107->base_path . $PLUGINS_DIRECTORY . "kbase/kbase.php?0.cat." . $rowrss['kbase_parent'] . "." . $rowrss['kbase_id'] ;
$rss[$i]['linkid'] = $tp->toRss($rowrss['kbase_id'], false);
$rss[$i]['title'] = $tp->toRss($rowrss['kbase_question'], false);;
$rss[$i]['description'] = $tp->toRss($rowrss['kbase_answer'], false);
$rss[$i]['category_name'] = $tp->toRss($rowrss['kbase_info_title'], false);
$rss[$i]['category_link'] = $e107->base_path . $PLUGINS_DIRECTORY . "kbase/kbase.php?0.cat." . $rowrss['kbase_parent'] ;
$rss[$i]['datestamp'] = $rowrss['kbase_datestamp'];
$rss[$i]['enc_url'] = "";
$rss[$i]['enc_leng'] = "";
$rss[$i]['enc_type'] = "";
$i++;
}
}
else
{
$rss[$i]['author'] = "" ;
$rss[$i]['author_email'] = '';
$rss[$i]['link'] = $e107->base_path . $PLUGINS_DIRECTORY . "kbase/kbase.php";
$rss[$i]['linkid'] = '';
$rss[$i]['title'] = "";
$rss[$i]['description'] = "none";
$rss[$i]['category_name'] = "";
$rss[$i]['category_link'] = '';
$rss[$i]['datestamp'] = "";
$rss[$i]['enc_url'] = "";
$rss[$i]['enc_leng'] = "";
$rss[$i]['enc_type'] = "";
}
}
$eplug_rss_data[] = $rss;
?>