Jump to content

cliv

Members
  • Posts

    2
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

cliv's Achievements

Newbie

Newbie (1/14)

  • Week One Done Rare
  • One Month Later Rare
  • One Year In Rare

Recent Badges

10

Reputation

  1. Nu sunt programator de php...insa acum ceva timp am incropit un script cu care preluam feed-ul RSS de pe agerpress de la adresa: Agerpress RSS ... acum s-a schimbat ceva si nu mai functioneaza. Poate ma ajuta cineva. Codul este urmatorul: <?php setlocale(LC_ALL, array('ro_RO.ISO8859-1', 'ro_RO.ISO-8859-1', 'ro', 'ro_RO', 'rom', 'romanian')); $xml=simplexml_load_file("https://www.agerpres.ro/home.rss"); $cnt = count($xml->channel->item); $count = 10; //Numarul de stiri afisate for($i=0; $i<$cnt; $i++) { $url = $xml->channel->item[$i]->link; $titlu = $xml->channel->item[$i]->title; $data = $xml->channel->item[$i]->pubDate; $imagine = $xml->channel->item[$i]->description->img->_src; $content = $xml->channel->item[$i]->description->__text; if($count > 0){ $date = date('d.m.Y - H:i', strtotime($data)); echo '<div>'; echo '<div>'; echo '<img src='.$imagine.' alt="">'; echo '</div>'; echo '<h4><a>'.$titlu.'</a></h4>'; echo '<div>'; echo '<span>publicat la '.$date.'</span>'; echo '</div>'; echo '<p>'.$content.'</p>'; echo '<a href="'.$url.'" >Citeşte</a>'; echo '</div>'; } $count--; } ?> Multumesc...
×
×
  • Create New...