-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrss.php
More file actions
48 lines (38 loc) · 1.8 KB
/
Copy pathrss.php
File metadata and controls
48 lines (38 loc) · 1.8 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
<?php
# LinkorCMS
# © 2006-2009 Ãàëèöêèé Àëåêñàíäð Íèêîëàåâè÷ (galitsky@pochta.ru)
# Ôàéë: rss.php
# Íàçíà÷åíèå: Ãåíåðàòîð RSS
define('RSS_SCRIPT', true);
define('VALID_RUN', true);
@header("Content-Type: text/xml");
@header("Cache-Control: no-cache");
@header("Pragma: no-cache");
include_once ('config/init.php'); // Êîíôèãóðàöèÿ è èíèöèàëèçàöèÿ
include_once ($config['inc_dir'].'system_plugins.inc.php'); // Ïëàãèíû
include_once ($config['inc_dir'].'system.php'); // Ôóíêöèè
include_once ($config['db_dir'].'database.php'); // Íàñòðîéêè áàçû äàííûõ è êëàññ äëÿ ðàáîòû ñ áàçîé äàííûõ
LoadSiteConfig($config); // Çàãðóçêà êîíôèãóðàöèè ñàéòà
LoadSiteConfig($plug_config, 'plugins_config', 'plugins_config_groups'); // Çàãðóçêà êîíôèãóðàöèè ïëàãèíîâ
include_once ($config['inc_dir'].'plugins.inc.php'); // Ïëàãèíû
include_once ($config['inc_dir'].'rss.class.php');
$rss_title = 'Íîâîñòè íà '.$config['general']['site_url'];
$rss_link = $config['general']['site_url'];
$rss_description = 'RSS êàíàë ñàéòà '.$config['general']['site_url'].'.';
$rss = new RssChannel($rss_title, $rss_link, $rss_description);
$rss->pubDate = gmdate('D, d M Y H:i:s').' GMT';
$rss->generator = CMS_NAME.' '.CMS_VERSION;
$rss->managingEditor = 'support@linkorcms.ru';
$rss->webMaster = $config['general']['site_email'];
$num = 10; // Ïîêà ìàêñèìóì 10 çàãîëîâêîâ ïî óìîë÷àíèþ
$news = $db->Select('news', "`enabled`='1'");
SortArray($news, 'date', true);
foreach($news as $s){
$title = SafeDB($s['title'], 255, str);
$description = SafeDB($s['start_text'], 4048, str);
$link = htmlspecialchars(GetSiteUrl().Ufu('index.php?name=news&op=readfull&news='.$s['id'].'&topic='.$s['topic_id'], 'news/{topic}/{news}/'));
$pubDate = gmdate('D, d M Y H:i:s', $s['date']).' GMT';
$rss->AddItem($title, $description, $link, $pubDate, $link);
}
echo $rss->Generate();
?>