htdocs/devinfo/index.php: fix error when there's no author info in Trac's rss item.

This commit is contained in:
XhmikosR 2013-10-12 18:36:07 +03:00
parent 2a2212043f
commit 5fa41f5873
1 changed files with 6 additions and 2 deletions

View File

@ -78,8 +78,12 @@ the latest sources in a zip or tgz archive</a> from the github website.</p>
$feed->init(); $feed->init();
print("<ul class=\"rssfeeditems\">\n"); print("<ul class=\"rssfeeditems\">\n");
foreach ($feed->get_items() as $item) { //for the last timeline items... foreach ($feed->get_items() as $item) { //for the last timeline items...
$author = $item->get_author(); if ($author = $item->get_author()) {
print(" <li><a href=\"".$item->get_link()."\">".$item->get_title()."</a> <em>by <strong>".$author->get_name()."</strong> on ".$item->get_date('Y-m-d')."</em></li>\n"); $author = trim($author->get_name());
} else {
$author = 'anonymous';
}
print(" <li><a href=\"".$item->get_link()."\">".$item->get_title()."</a> <em>by <strong>".$author."</strong> on ".$item->get_date('Y-m-d')."</em></li>\n");
} }
print("</ul>\n"); print("</ul>\n");
?> ?>