[ Index ]
 

Code source de MagpieRSS 0.72

Accédez au Source d'autres logiciels libres

Classes | Fonctions | Variables | Constantes | Tables | Statistiques

title

Body

[fermer]

/scripts/ -> magpie_slashbox.php (source)

   1  <?php
   2  
   3  define('MAGPIE_DIR', '../');
   4  require_once (MAGPIE_DIR.'rss_fetch.inc');
   5      
   6  $url = $_GET['rss_url'];
   7  
   8  ?>
   9  
  10  <html
  11  <body LINK="#999999" VLINK="#000000">
  12  
  13  <form>
  14  <input type="text" name="rss_url" size="40" value="<?php echo $url ?>"><input type="Submit">
  15  </form>
  16  
  17  <?php
  18  
  19  if ( $url ) {
  20      echo "displaying: $url<p>";
  21      $rss = fetch_rss( $url );
  22      echo slashbox ($rss);
  23  }
  24  
  25  echo "<pre>";
  26  print_r($rss);
  27  echo "</pre>";
  28  ?>
  29  
  30  </body>
  31  </html>
  32  
  33  <?php
  34  
  35  # just some quick and ugly php to generate html
  36  #
  37  #
  38  function slashbox ($rss) {
  39      echo "<table cellpadding=2 cellspacing=0><tr>";
  40      echo "<td bgcolor=#006666>";
  41      
  42      # get the channel title and link properties off of the rss object
  43      #
  44      $title = $rss->channel['title'];
  45      $link = $rss->channel['link'];
  46      
  47      echo "<a href=$link><font color=#FFFFFF><b>$title</b></font></a>";
  48      echo "</td></tr>";
  49      
  50      # foreach over each item in the array.
  51      # displaying simple links
  52      #
  53      # we could be doing all sorts of neat things with the dublin core
  54      # info, or the event info, or what not, but keeping it simple for now.
  55      #
  56      foreach ($rss->items as $item ) {
  57          echo "<tr><td bgcolor=#cccccc>";
  58          echo "<a href=$item[link]>";
  59          echo $item['title'];
  60          echo "</a></td></tr>";
  61      }        
  62      
  63      echo "</table>";
  64  }
  65  
  66  ?>


Généré le : Fri Nov 30 19:16:52 2007 par Balluche grâce à PHPXref 0.7
  Clicky Web Analytics