Nicer RSS feed
parent
5184069b5f
commit
ce6e59d2ef
|
|
@ -95,10 +95,10 @@ class gelato extends Conexion_Mysql {
|
|||
function getVideoPlayer($url) {
|
||||
if (isYoutubeVideo($url)) {
|
||||
$id_video = getYoutubeVideoUrl($url);
|
||||
return "\t\t\t<div class=\"enlacevideo\"><object type=\"application/x-shockwave-flash\" style=\"width:500px;height:393px\" data=\"http://www.youtube.com/v/".$id_video."\"><param name=\"movie\" value=\"http://www.youtube.com/v/".$id_video."\" /></object></div>\n";
|
||||
return "\t\t\t<object type=\"application/x-shockwave-flash\" style=\"width:500px;height:393px\" data=\"http://www.youtube.com/v/".$id_video."\"><param name=\"movie\" value=\"http://www.youtube.com/v/".$id_video."\" /></object>\n";
|
||||
} elseif (isVimeoVideo($url)) {
|
||||
$id_video = getVimeoVideoUrl($url);
|
||||
return "\t\t\t<div class=\"enlacevideo\"><object type=\"application/x-shockwave-flash\" style=\"width:500px;height:393px\" data=\"http://www.vimeo.com/moogaloop.swf?clip_id=".$id_video."\"><param name=\"movie\" value=\"http://www.vimeo.com/moogaloop.swf?clip_id=".$id_video."\" /></object></div>\n";
|
||||
return "\t\t\t<object type=\"application/x-shockwave-flash\" style=\"width:500px;height:393px\" data=\"http://www.vimeo.com/moogaloop.swf?clip_id=".$id_video."\"><param name=\"movie\" value=\"http://www.vimeo.com/moogaloop.swf?clip_id=".$id_video."\" /></object>\n";
|
||||
} else {
|
||||
return "This URL is not a supported video (YouTube or Vimeo)";
|
||||
}
|
||||
|
|
@ -107,7 +107,7 @@ class gelato extends Conexion_Mysql {
|
|||
function getMp3Player($url) {
|
||||
if (isMP3($url)) {
|
||||
$playerUrl = $this->conf->urlGelato."/admin/scripts/player.swf?soundFile=".$url;
|
||||
return "\t\t\t<div class=\"enlacemp3\"><object type=\"application/x-shockwave-flash\" data=\"" . $playerUrl . "\" width=\"290\" height=\"24\"><param name=\"movie\" value=\"" . $playerUrl . "\" /><param name=\"quality\" value=\"high\" /><param name=\"menu\" value=\"false\" /><param name=\"wmode\" value=\"transparent\" /></object></div>\n";
|
||||
return "\t\t\t<object type=\"application/x-shockwave-flash\" data=\"" . $playerUrl . "\" width=\"290\" height=\"24\"><param name=\"movie\" value=\"" . $playerUrl . "\" /><param name=\"quality\" value=\"high\" /><param name=\"menu\" value=\"false\" /><param name=\"wmode\" value=\"transparent\" /></object>\n";
|
||||
} else {
|
||||
return "This URL is not a supported video (YouTube or Vimeo)";
|
||||
}
|
||||
|
|
|
|||
60
rss.php
60
rss.php
|
|
@ -27,8 +27,6 @@
|
|||
<title><?=htmlspecialchars(replaceAccents($conf->title));?></title>
|
||||
<link><?=$conf->urlGelato;?></link>
|
||||
<description><?=htmlspecialchars(replaceAccents($conf->description));?></description>
|
||||
<language>EN</language>
|
||||
<docs>http://blogs.law.harvard.edu/tech/rss</docs>
|
||||
<generator>gelato CMS</generator>
|
||||
<image>
|
||||
<url><?=$conf->urlGelato;?>/images/information.png</url>
|
||||
|
|
@ -37,19 +35,50 @@
|
|||
</image>
|
||||
<?
|
||||
while($register = mysql_fetch_array($rs)) {
|
||||
$tit = ($register["title"]=="") ? htmlspecialchars($register["url"]) : htmlspecialchars($register["title"]);
|
||||
$desc = htmlspecialchars($register["description"]);
|
||||
switch ($register["type"]) {
|
||||
case "1":
|
||||
$tit = ($register["title"]=="") ? htmlspecialchars(strip_tags($register["description"])) : htmlspecialchars($register["title"]);
|
||||
$desc = htmlspecialchars($register["description"]);
|
||||
break;
|
||||
case "2":
|
||||
$tit = ($register["description"]=="") ? "Photo" : htmlspecialchars(strip_tags($register["description"]));
|
||||
$desc = "<img src=\"".$register["url"]."\"/>";
|
||||
break;
|
||||
case "3":
|
||||
$tit = "\"".htmlspecialchars(strip_tags($register["description"]))."\"";
|
||||
$tmpStr = ($register["title"]!="") ? "<br /><br /> - <em>".htmlspecialchars($register["title"])."</em>" : "";
|
||||
$desc = "\"".htmlspecialchars($register["description"])."\"".$tmpStr;
|
||||
break;
|
||||
case "4":
|
||||
$tit = ($register["title"]=="") ? htmlspecialchars($register["url"]) : htmlspecialchars($register["title"]);
|
||||
$tmpStr = ($register["description"]!="") ? "<br /><br /> - <em>".htmlspecialchars($register["description"])."</em>" : "";
|
||||
$desc = "<a href=\"".htmlspecialchars($register["url"])."\">".$tit."</a>".$tmpStr;
|
||||
break;
|
||||
case "5":
|
||||
$lines = explode("\n", $register["description"]);
|
||||
$line = htmlspecialchars($lines[0]);
|
||||
$tit = ($register["title"]=="") ? $line : htmlspecialchars($register["title"]);
|
||||
$desc = $tumble->formatConversation(htmlspecialchars($register["description"]));
|
||||
break;
|
||||
case "6":
|
||||
$tit = ($register["description"]=="") ? "Video" : htmlspecialchars(strip_tags($register["description"]));
|
||||
$desc = $tumble->getVideoPlayer(htmlspecialchars($register["url"]));
|
||||
break;
|
||||
case "7":
|
||||
$tit = ($register["description"]=="") ? "MP3" : htmlspecialchars(strip_tags($register["description"]));
|
||||
$desc = $tumble->getMp3Player(htmlspecialchars($register["url"]));
|
||||
break;
|
||||
}
|
||||
$url = htmlspecialchars($conf->urlGelato."/index.php/post/".$register["id_post"]."/");
|
||||
$formatedDate = gmdate("D, d M Y H:i:s \G\M\T", strtotime($register["date"]));
|
||||
?>
|
||||
|
||||
<item>
|
||||
<title><?=$tit;?></title>
|
||||
<title><?=replaceAccentsWithAmp($tit);?></title>
|
||||
<description><![CDATA[<?=replaceAccentsWithAmp($desc);?>]]></description>
|
||||
<link><?=$url;?></link>
|
||||
<description><?=$desc;?></description>
|
||||
<pubDate><?=$formatedDate;?></pubDate>
|
||||
<category>system:unfiled</category>
|
||||
<guid isPermaLink="true"><?=$conf->urlGelato."/index.php/post/".$register["id_post"]."/";?></guid>
|
||||
<pubDate><?=$formatedDate;?></pubDate>
|
||||
</item>
|
||||
|
||||
<?
|
||||
|
|
@ -73,4 +102,19 @@
|
|||
$texto = str_replace("ú","u", $texto);
|
||||
return $texto;
|
||||
}
|
||||
|
||||
function replaceAccentsWithAmp($texto="") {
|
||||
$texto = str_replace("&Aacute;","A", $texto);
|
||||
$texto = str_replace("&Eacute;","E", $texto);
|
||||
$texto = str_replace("&Iacute;","I", $texto);
|
||||
$texto = str_replace("&Oacute;","O", $texto);
|
||||
$texto = str_replace("&Uacute;","U", $texto);
|
||||
$texto = str_replace("&aacute;","a", $texto);
|
||||
$texto = str_replace("&eacute;","e", $texto);
|
||||
$texto = str_replace("&iacute;","i", $texto);
|
||||
$texto = str_replace("&oacute;","o", $texto);
|
||||
$texto = str_replace("&uacute;","u", $texto);
|
||||
$texto = str_replace("&#39;"," ", $texto);
|
||||
return $texto;
|
||||
}
|
||||
?>
|
||||
Loading…
Reference in New Issue