-
Notifications
You must be signed in to change notification settings - Fork 8
/
rss.php
55 lines (49 loc) · 1.75 KB
/
rss.php
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
<?php
// íà÷àëî ïðîãðàììû
include "rss.class.php"; // ýòî ñîáñòâåííî êëàññ
include "setup.php";
function maxsite_str_word($text, $counttext = 5, $sep = ' ') {
$words = split($sep, $text);
if ( count($words) > $counttext )
$text = join($sep, array_slice($words, 0, $counttext));
if (($pos=strpos($text, "<br>")) == 0) {
$pos = strpos($text, "<br>", 4);
}
if ($pos !== false) {
return substr($text, 0, $pos);
} else {
return $text;
}
}
function return_date($date) {
$date = explode(".", $date);
return date("r",strtotime($date[0].".".$date[1].".20".$date[2]));
}
$Rss = new CRss();
$Rss->Title="Íîâîñòè êàçèíî";
$Rss->Link="http://azartsoft.co.cc/";
$Rss->Copyright="© 2009 azartsoft.co.cc";
$Rss->Description="Íîâîñòíàÿ RSS ðàññûëêà êàçèíî";
$Rss->Category = "Àçàðòíûå èãðû îíëàéí";
$Rss->Language="ru";
$Rss->ManagingEditor="admin@azartsoft.co.cc";
$Rss->WebMaster="admin@azartsoft.co.cc";
$Rss->LastBuildDate=date("r");
$line = mysql_fetch_row(mysql_query("select data FROM news ORDER by data
desc Limit 0,1"));
$Rss->LastBuildDate=return_date($line[0]);
$Rss->PubDate=$Rss->LastBuildDate;
$Rss->PrintHeader();
$result=mysql_query("select * from news ORDER BY `id` DESC ", $full_base);
while ($row = mysql_fetch_array($result))
{ // äëÿ êàæäîé çàïèñè âûâåäåì
$Title = maxsite_str_word($row['news']);
$Description = str_replace("<br>", "\r\n",
$row['news']);
$Link="http://azartsoft.co.cc/";
$PubDate=return_date($row['data']);
$Category="Íîâîñòè ñàéòà";
$Rss->PrintBody($Title,$Link,$Description,$Category,$PubDate);
}
$Rss->PrintFooter();
?>