source: cpc/trunk/project/apps/frontend/modules/solr/templates/rssSuccess.php @ 1485

Last change on this file since 1485 was 1485, checked in by teymour, 10 years ago

RSS avec des titres plus compréhensibles que des query

File size: 644 bytes
Line 
1<?php
2
3if ($title)
4  $feed->setTitle("NosDeputes.fr : $title");
5 else
6   $feed->setTitle("NosDeputes.fr : Recherche sur $query");
7$feed->setLink('http://'.$_SERVER['HTTP_HOST'].url_for('@recherche_solr?query='.$query));
8
9foreach ($results['docs'] as $record)
10{
11  $item = new sfFeedItem();
12  $item->setTitle($record['titre']);
13  $item->setLink('http://'.$_SERVER['HTTP_HOST'].$record['link']);
14  $item->setAuthorName($record['personne']);
15  $item->setPubdate(strtotime($record['date']));
16  $item->setUniqueId($record['id']);
17  $item->setDescription($record['highlighting']);
18  $feed->addItem($item);
19}
20decorate_with(false);
21echo $feed->asXml();
Note: See TracBrowser for help on using the repository browser.