46
Preséntate en SMF Simple / Re:Me presento : Wekind
« on: December 07, 2012 - 07:20 19:20 »
Hola que tal amigo Bienvenido, cualquier cosa aqui estamos para ayudarte! Ya me he registrado a tu foro ^^
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
[html] contenido [/html]
Item 1 | Item 2 | Item 3 |
Item 4 | Item 5 | Item 6 |
[table]
[tr]
[td]Item 1[/td]
[td]Item 2[/td]
[td]Item 3[/td]
[/tr]
[tr]
[td]Item 4[/td]
[td]Item 5[/td]
[td]Item 6[/td]
[/tr]
[/table]
<?php
//$RSS = new LectorRSS ("http://www.tublogenwordpress.com/blog/feed/rss/";
$RSS = new LectorRSS ("http://www.taringa.net/rss/ultimos-post/";
class LectorRSS {
var $url;
var $data;
function LectorRSS ($url){
$this->url;
$this->data = implode ("", file ($url));
}
function obtener_items (){
preg_match_all ("/<item .*>.*<\/item>/xsmUi", $this->data, $matches);
$items = array ();
foreach ($matches[0] as $match){
$items[] = new RssItem ($match);
}
return $items;
}
}
class RssItem {
var $title, $url;
function RssItem ($xml){
$this->populate ($xml);
}
function populate ($xml){
preg_match ("/<title> (.*) <\/title>/xsmUi", $xml, $matches);
$this->title = $matches[1];
preg_match ("/<link> (.*) <\/link>/xsmUi", $xml, $matches);
$this->url = $matches[1];
}
function obtener_titulo (){
return $this->title;
}
function obtener_url (){
return $this->url;
}
}
foreach ($RSS->obtener_items () as $item){
printf ('<a target="_BLANK" href="%s">%s</a><br />',
$item->obtener_url (), $item->obtener_titulo ());
}
?>
<?php
$long_descripcion=400;
$num_noticias=4;
$n=0;
$noticias = simplexml_load_file('http://urldetuweb.sadas/rss.xml');
foreach ($noticias as $noticia) {
foreach($noticia as $reg){
if($reg->title!=NULL && $reg->title!='' && $reg->description!=NULL && $reg->description!='' && $n<$num_noticias){
echo '<b><a href="'.$reg->link.'" target="_blank">'.$reg->title.'</a></b><br>';
if(strlen($reg->description)>$long_descripcion)
echo '<p>'.substr($reg->description,0,$long_descripcion).'...</a></p><br>';
else
echo '<p>'.$reg->description.'</p><br>';
echo 'Publicado: '.$reg->pubDate.'<br><br>';
$n++;
}
}
}
?>
<?
class FeedBlock extends Block{
const SYSKEY = 'FeedBlock';
function __construct()
{
}
public function show()
{
$long_descripcion=400;
$num_noticias=4;
$n=0;
$noticias = simplexml_load_file('http://www.breackerz.com//feeds/posts/default');
foreach ($noticias as $noticia) {
foreach($noticia as $reg){
if($reg->title!=NULL && $reg->title!='' && $reg->description!=NULL && $reg->description!='' && $n<$num_noticias){
echo '<b><a href="'.$reg->link.'" target="_blank">'.$reg->title.'</a></b><br>';
if(strlen($reg->description)>$long_descripcion)
echo '<p>'.substr($reg->description,0,$long_descripcion).'...</a></p><br>';
else
echo '<p>'.$reg->description.'</p><br>';
echo 'Publicado: '.$reg->pubDate.'<br><br>';
$n++;
}
}
}