| <?php | |
| function labsFeed($file_name, $count=7) { | |
| $rss = simplexml_load_file($file_name); | |
| $inc = 0; | |
| ob_start(); | |
| ?><ul><?php | |
| try { | |
| foreach ($rss->entry as $entry) { | |
| $inc++; | |
| if ($inc > $count) { break; } | |
| $now = strtotime("now"); | |
| $then = strtotime($entry->updated); | |
| $date = date("Y/m/d", $then); | |
| $title = str_replace('eclipselabs.org ', '', $entry->title); | |
| ?> <li class="new"><a class="link" href="http://code.google.com/a/eclipselabs.org/p/<?php print $title;?>"><?php print $title;?></a></li> | |
| <?php | |
| } | |
| } | |
| catch (Exception $e){ | |
| echo '<!-- Error in NewsFeed - $file_name - '. $e->getMessage() . " -->"; | |
| } | |
| ?></ul><?php | |
| return ob_get_clean(); | |
| } | |
| ?> |