mhmcr /inc/rss20/rss.php

Language PHP Lines 28
MD5 Hash 6ce022a4903789ee8817e1748ace6063 Estimated Cost $585 (why?)
Repository https://bitbucket.org/mhell/mhmcr.git View Raw File View Project SPDX
 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
<?php
	require_once('../../system.php');
	$title     = mgetOpt('site-name');
	$desc      = mgetOpt('site-slogan');
	$rss_doc   = '';
	$site_news = mgetOpt('url-base') . $config['mcsrv_dir'] . 'news.php';
	$num_news  = mysql_fetch_row(mysql_query("SELECT COUNT(*) FROM " . $db['tables']['news']));
	if (empty($num_news[0]))
		exit;
	define('DATE_FORMAT_RFC822', 'r');
	Header("content-type: application/rss+xml; charset=utf-8");
	$cur_date = mysql_fetch_row(mysql_query("SELECT DATE_FORMAT(NOW(),'%a, %d %b %Y %T')"));
	$cur_date = $cur_date[0];
	$result   = BD("SELECT * FROM " . $db['tables']['news'] . " ORDER by date DESC LIMIT 0,10");
	if (mysql_num_rows($result) != 0) {
		print '<?xml version="1.0" encoding="UTF-8"?>';
		include 'rss_header.html';
		while ($line = mysql_fetch_array($result)) {
			$name = $line['name'];
			$date = date("r", strtotime($line['date']));
			$link = $site_news . '?id=' . $line['id'];
			$post = strip_tags(html_entity_decode($line['content']));
			include 'rss.html';
		}
		include 'rss_footer.html';
	}
	echo $rss_doc;
?>
Back to Top