plugins/RSS.php
changeset 4 308a696fce01
parent 3 f71442e3a95f
equal deleted inserted replaced
3:f71442e3a95f 4:308a696fce01
    90    */
    90    */
    91   
    91   
    92   function __construct($title = false, $desc = false, $link = false, $gen = false, $email = false)
    92   function __construct($title = false, $desc = false, $link = false, $gen = false, $email = false)
    93   {
    93   {
    94     $this->create_channel($title, $desc, $link, $gen, $email);
    94     $this->create_channel($title, $desc, $link, $gen, $email);
    95   }
       
    96   
       
    97   /**
       
    98    * PHP 4 constructor.
       
    99    */
       
   100   
       
   101   function RSS($title = false, $desc = false, $link = false, $gen = false, $email = false)
       
   102   {
       
   103     $this->__construct($title, $desc, $link, $gen, $email);
       
   104   }
    95   }
   105   
    96   
   106   /** 
    97   /** 
   107    * Creates a new channel.
    98    * Creates a new channel.
   108    */
    99    */
   172   function add_item($title, $link, $desc, $pubdate, $guid = false)
   163   function add_item($title, $link, $desc, $pubdate, $guid = false)
   173   {
   164   {
   174     $title = htmlspecialchars($title);
   165     $title = htmlspecialchars($title);
   175     $link = htmlspecialchars($link);
   166     $link = htmlspecialchars($link);
   176     $desc = '<![CDATA[ ' . str_replace(']]>', ']]&gt;', $desc) . ']]>';
   167     $desc = '<![CDATA[ ' . str_replace(']]>', ']]&gt;', $desc) . ']]>';
   177     if ( is_int($pubdate) || ( !is_int($pub_date) && preg_match('/^([0-9]+)$/', $pubdate) ) )
   168     if ( is_int($pubdate) || ( !is_int($pubdate) && preg_match('/^([0-9]+)$/', $pubdate) ) )
   178     {
   169     {
   179       $pubdate = date('D, d M Y H:i:s T', intval($pubdate));
   170       $pubdate = date('D, d M Y H:i:s T', intval($pubdate));
   180     }
   171     }
   181     if ( !$guid )
   172     if ( !$guid )
   182     {
   173     {
   266       else
   257       else
   267       {
   258       {
   268         while($row = $db->fetchrow())
   259         while($row = $db->fetchrow())
   269         {
   260         {
   270           $link = makeUrlComplete($row['namespace'], $row['page_id'], "oldid={$row['time_id']}"); // makeUrlComplete($row['namespace'], $row['page_id']);
   261           $link = makeUrlComplete($row['namespace'], $row['page_id'], "oldid={$row['time_id']}"); // makeUrlComplete($row['namespace'], $row['page_id']);
   271           $title = $paths->pages[$paths->nslist[$row['namespace']].$row['page_id']]['name'];
   262           $title = get_page_title_ns($row['page_id'], $row['namespace']); // $paths->pages[$paths->nslist[$row['namespace']].$row['page_id']]['name'];
   272           $desc = "Change by {$row['author']}:<br />";
   263           $desc = "Change by {$row['author']}:<br />";
   273           $desc .= ( $row['edit_summary'] != '' ) ? $row['edit_summary'] : 'No edit summary given.';
   264           $desc .= ( $row['edit_summary'] != '' ) ? $row['edit_summary'] : 'No edit summary given.';
   274           $date = $row['time_id'];
   265           $date = $row['time_id'];
   275           $guid = false;
   266           $guid = false;
   276           
   267