Changeset 1267
- Timestamp:
- Aug 22, 2010, 5:13:19 PM (11 years ago)
- Location:
- cpc/trunk/project/plugins/sfFeed2Plugin
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
cpc/trunk/project/plugins/sfFeed2Plugin/README
r367 r1267 36 36 == Installation == 37 37 38 * Install the plugin 38 Installation of the plugin differs on the version of symfony you are using. 39 40 * Install the plugin (symfony 1.0): 39 41 {{{ 40 42 $ symfony plugin-install http://plugins.symfony-project.com/sfFeed2Plugin 43 }}} 44 45 * Install the plugin (symfony 1.1+): 46 {{{ 47 $ symfony plugin:install sfFeed2Plugin 41 48 }}} 42 49 … … 197 204 {{{ 198 205 <?php decorate_with(false) ?> 199 <?php echo $feed->asXml( ) ?>206 <?php echo $feed->asXml(ESC_RAW) ?> 200 207 }}} 201 208 … … 453 460 } 454 461 }}} 462 463 By default, the aggregator sorts all items in reverse chronological order. If you wish to sort them in chronological order instead, add 'sort' => 'chronological' to the parameters array. 464 465 === Adding an image to the feed === 466 467 To add an image to the feed, use the sfFeedImage class 468 469 {{{ 470 $feed = new sfRss201Feed(); 471 472 $feedImage = new sfFeedImage(); 473 $feedImage->setLink('http://www.example.org/images/feed-image.png'); 474 $feedImage->setTitle('My Title'); 475 $feed->setImage($feedImage) 476 }}}} 455 477 456 478 == TODO == -
cpc/trunk/project/plugins/sfFeed2Plugin/lib/sfAtom1Feed.class.php
r367 r1267 294 294 if ($item->getContent()) 295 295 { 296 $xml[] = sprintf(' <content type=" text/html"><![CDATA[%s]]></content>', $item->getContent());296 $xml[] = sprintf(' <content type="html"><![CDATA[%s]]></content>', $item->getContent()); 297 297 } 298 298 -
cpc/trunk/project/plugins/sfFeed2Plugin/lib/sfFeedPeer.class.php
r367 r1267 141 141 foreach($feed->getItems() as $item) 142 142 { 143 $index = is_integer($item->getPubDate()) ? $item->getPubDate() : 0;143 $index = is_integer($item->getPubDate()) || ctype_digit($item->getPubDate()) ? $item->getPubDate() : 0; 144 144 while(isset($feed_items[$index])) 145 145 { … … 150 150 } 151 151 152 // sort in reverse chronological order 153 krsort($feed_items); 154 152 // when specified, sort items chronologically instead of reverse 153 if (isset($parameters['sort']) && 'chronological' == $parameters['sort']) 154 { 155 ksort($feed_items); 156 } 157 else 158 { 159 // default behaviour: sort in reverse chronological order 160 krsort($feed_items); 161 } 162 155 163 // limit the number of feed items to be added 156 164 if(isset($parameters['limit'])) … … 293 301 $routes = sfContext::getInstance()->getRouting()->getRoutes(); 294 302 $route = $routes[substr($routeName, 1)]; 295 $url = $route[0]; 296 $paramNames = array_keys($route[2]); 297 $defaults = $route[3]; 303 if($route instanceof sfRoute) 304 { 305 $url = $route->getPattern(); 306 $paramNames = array_keys($route->getVariables()); 307 $defaults = $route->getDefaults(); 308 } 309 else 310 { 311 $url = $route[0]; 312 $paramNames = array_keys($route[2]); 313 $defaults = $route[3]; 314 } 298 315 } 299 316
Note: See TracChangeset
for help on using the changeset viewer.