Changeset 2095

Show
Ignore:
Timestamp:
02/02/08 00:03:53 (3 months ago)
Author:
anarcat
Message:

add trivial code to display an RSS feed on the home page of users, feed can be changed in the variables panel

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • alternc/trunk/bureau/admin/main.php

    r1952 r2095  
    4747$mem->resetlast(); 
    4848 
     49# use MagpieRSS to syndicate content from another site if available 
     50 
     51# this should work, since the debian package installs it in 
     52# /usr/share/php, which is in the include path 
     53if (include_once('magpierss/rss_fetch.inc')) { 
     54  $rss = fetch_rss( variable_get('rss_feed') ); 
     55 
     56  if ($rss) { 
     57   echo "<h2>" . _("Latest news") . "</h2>"; 
     58    foreach ($rss->items as $item) { 
     59      $href = $item['link']; 
     60      $title = $item['title']; 
     61      echo "<h3><a href=$href>$title</a></h3>"; 
     62      echo $item['summary']; 
     63    } 
     64    echo "</ul>"; 
     65  } 
     66} 
     67 
    4968if($admin->enabled) { 
    5069  $expiring = $admin->renew_get_expiring_accounts(); 
  • alternc/trunk/install/mysql.sql

    r1865 r2095  
    420420If this is set to 0 or a "false" string, it will be ignored.'); 
    421421 
     422INSERT IGNORE INTO `variable` (name, value, comment) VALUES ('rss_feed', 0, 
     423'This is an RSS feed that will be displayed on the users homepages when 
     424they log in. Set this to 0 or a "false" string to ignore.'); 
    422425-- 
    423426-- Table structure for table `dbusers`