View file rss.php

File size: 2.27Kb
<?php
/********************************
* Mobile Blog v3.1.e Script     *
* Fully modified by er.o        *
* http://www.errorisme.com      *
* http://errorisme.co.tv        *
* Copyright (c) 2010            *
* Original Script created by    *
* Huteri Manza                  *
* http://huteri.net             *
********************************/
require("config.php");
require("func.php");

$tt=mysql_query("select date_format(uptime, '%a, %d %b %Y %H:%i:%s') as 'uptime', uptime as 'timeorder' from blog order by timeorder desc limit 1") or die(mysql_error());
$ma=mysql_fetch_array($tt);

echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?";
echo ">
<rss version=\"2.0\">
<channel>
<title>RSS Feed {$ur["blog_name"]}</title>
<link>http://{$_SERVER['HTTP_HOST']}{$ur["blog_dir"]}</link>
<description>RSS 2 feed {$ur["blog_name"]}</description>
<lastBuildDate>{$ma["uptime"]} +0700</lastBuildDate>
<language>en-us</language>";
//ganti <link>http://{$_SERVER['SERVER_NAME']}{$ur["blog_dir"]}</link> dg <link>http://site.kamu</link> jika nama server name yang muncul beda dengan nama domainmu.
$show=$ur["blogperpage"]; //Jumlah feed manual: $show=10;
$a=mysql_query("select id, bloglink, title, text, cat_id, date_format(uptime, '%a, %d %b %Y %H:%i:%s') as 'uptime', uptime as 'timeorder', hit, hittoday, user_id from blog order by timeorder desc limit $show") or die(mysql_error());
while($b=mysql_fetch_array($a))
{
$b["text"]=stripslashes($b["text"]);
if(strstr($b['text'],"[more]")) $ur['idx_textperblog']=strpos($b['text'],"[more]");
$maxtext=$ur['idx_textperblog'];
if (strlen($b["text"]) > $maxtext) $more=" [...]";
$b["title"]=stripslashes($b["title"]);
$b["text"]=substr($b["text"], 0, $maxtext);
$b["text"]=preg_replace('/[^(\x20-\x7F)]*/','',$b["text"]);
$b["text"]=str_replace('[more]','',$b["text"]);
$b["text"]=str_replace("=\"/","=\"http://{$_SERVER['HTTP_HOST']}{$ur["blog_dir"]}",smiley($ur,bbcodes($b["text"])));
$b["text"]=htmlentities(nl2br($b["text"]));
$b["title"]=str_replace($ur["idx_updatenot"], "", $b["title"]);
echo "<item>
<title>{$b["title"]}</title>
<link>http://{$_SERVER['SERVER_NAME']}{$ur["blog_dir"]}".catlink(blogcatid($b["bloglink"]))."/{$b["bloglink"]}</link>
<pubDate>{$b["uptime"]} +0700</pubDate>
<description>{$b["text"]}$more</description>
</item>
";
}
echo "</channel>
</rss>";
?>