-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrss.php
More file actions
executable file
·37 lines (30 loc) · 1.27 KB
/
rss.php
File metadata and controls
executable file
·37 lines (30 loc) · 1.27 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
<?php
/*
* LinkorCMS 1.4
* © 2011 LinkorCMS Development Group
*/
define('RSS_SCRIPT', true);
define('VALID_RUN', true);
require 'config/init.php'; // Êîíôèãóðàöèÿ è èíèöèàëèçàöèÿ
@header("Content-Type: text/xml");
@header("Cache-Control: no-cache");
@header("Pragma: no-cache");
$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();