Support Joomla!

Joomla! 1.5 Documentation

Packages

Package: Unknown

Developer Network License

The Joomla! Developer Network content is © copyright 2006 by the individual contributors and can be used in accordance with the Creative Commons License, Attribution- NonCommercial- ShareAlike 2.5
Source code for file /simplepie/demo/minimalistic.php

Documentation is available at minimalistic.php

  1. <?php
  2.  
  3. function microtime_float()
  4. {
  5.     if (version_compare(phpversion()'5.0.0''>='))
  6.     {
  7.         return microtime(true);
  8.     }
  9.     else
  10.     {
  11.         list($usec$secexplode(' 'microtime());
  12.         return ((float) $usec + (float) $sec);
  13.     }
  14. }
  15.  
  16. $start microtime_float();
  17.  
  18. include('../simplepie.inc');
  19.  
  20. // Parse it
  21. $feed new SimplePie();
  22. if (!empty($_GET['feed'])) {
  23.     if (get_magic_quotes_gpc())
  24.     {
  25.         $_GET['feed'stripslashes($_GET['feed']);
  26.     }
  27.     $feed->feed_url($_GET['feed']);
  28.     $feed->init();
  29. }
  30. $feed->handle_content_type();
  31.  
  32. ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  33.  
  34. <html xmlns="http://www.w3.org/1999/xhtml">
  35. <head>
  36. <title><?php echo (empty($_GET['feed'])) 'SimplePie' 'SimplePie: ' $feed->get_feed_title()?></title>
  37.  
  38. <!-- META HTTP-EQUIV -->
  39. <meta http-equiv="content-type" content="text/html; charset=<?php echo ($feed->get_encoding()) $feed->get_encoding('UTF-8'?>" />
  40. <meta http-equiv="imagetoolbar" content="false" />
  41.  
  42. <style type="text/css">
  43. html, body {
  44.     height:100%;
  45.     margin:0;
  46.     padding:0;
  47. }
  48.  
  49. h1 {
  50.     background-color:#333;
  51.     color:#fff;
  52.     font-size:3em;
  53.     margin:0;
  54.     padding:5px 15px;
  55.     text-align:center;
  56. }
  57.  
  58. div#footer {
  59.     padding:5px 0;
  60. }
  61.  
  62. div#footer,
  63. div#footer a {
  64.     text-align:center;
  65.     font-size:0.7em;
  66. }
  67.  
  68. div#footer a {
  69.     text-decoration:underline;
  70. }
  71.  
  72. code {
  73.     background-color:#f3f3ff;
  74.     color:#000;
  75. }
  76.  
  77. pre {
  78.     background-color:#f3f3ff;
  79.     color:#000080;
  80.     border:1px dotted #000080;
  81.     padding:3px 5px;
  82. }
  83.  
  84. form {
  85.     margin:0;
  86.     padding:0;
  87. }
  88.  
  89. div.chunk {
  90.     border-bottom:1px solid #ccc;
  91. }
  92.  
  93. form#sp_form {
  94.     text-align:center;
  95.     margin:0;
  96.     padding:0;
  97. }
  98.  
  99. form#sp_form input.text {
  100.     width:85%;
  101. }
  102. </style>
  103.  
  104. </head>
  105.  
  106. <body>
  107.     <h1><?php echo (empty($_GET['feed'])) 'SimplePie' 'SimplePie: ' $feed->get_feed_title()?></h1>
  108.  
  109.     <form action="" method="get" name="sp_form" id="sp_form">
  110.         <p><input type="text" name="feed" value="<?php echo ($feed->subscribe_url()) htmlspecialchars($feed->subscribe_url()) 'http://'?>" class="text" id="feed_input" />&nbsp;<input type="submit" value="Read" class="button" /></p>
  111.     </form>
  112.  
  113.     <div id="sp_results">
  114.         <?php if ($feed->data)?>
  115.             <?php $items $feed->get_items()?>
  116.             <p align="center"><span style="background-color:#ffc;">Displaying <?php echo $feed->get_item_quantity()?> most recent entries.</span></p>
  117.             <?php foreach($items as $item)?>
  118.                 <div class="chunk" style="padding:0 5px;">
  119.                     <h4><a href="<?php echo $item->get_permalink()?>"><?php echo $item->get_title()?></a> <?php echo $item->get_date('j M Y')?></h4>
  120.                     <?php echo $item->get_description()?>
  121.                     <?php
  122.                     if ($enclosure $item->get_enclosure(0))
  123.                         echo '<p><a href="' $enclosure->get_link('" class="download"><img src="./for_the_demo/mini_podcast.png" alt="Podcast" title="Download the Podcast" border="0" /></a></p>';
  124.                     ?>
  125.                 </div>
  126.             <?php endforeach?>
  127.             </div>
  128.         <?php endif?>
  129.     </div>
  130.  
  131.     <div id="footer">
  132.         Powered by <?php echo $feed->linkback?>, a product of <a href="http://www.skyzyx.com">Skyzyx Technologies</a>.<br />
  133.         Page created in <?php echo round(microtime_float()-$start3)?> seconds.
  134.     </div>
  135. </body>
  136. </html>

Documentation generated on Mon, 05 Mar 2007 21:10:45 +0000 by phpDocumentor 1.3.1