From cb3022eb0014459cbbe24064630c9430cad3f7ec Mon Sep 17 00:00:00 2001 From: Bjørn Lindeijer Date: Sat, 21 Apr 2007 13:19:18 +0000 Subject: Switched to our SF RSS feed for the news on the front page. --- includes/common.php | 6 +++--- includes/news.php | 53 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 56 insertions(+), 3 deletions(-) create mode 100644 includes/news.php (limited to 'includes') diff --git a/includes/common.php b/includes/common.php index 085a566..ae189b9 100644 --- a/includes/common.php +++ b/includes/common.php @@ -9,8 +9,8 @@ function placeHeader($page_title) { echo "\n"; ?> - + The Mana World @@ -55,7 +55,7 @@ function placeHeader($page_title)
+
  • News
  • About
  • Downloads
  • Wiki
  • Forums
  • Bug tracker
  • Links
  • diff --git a/includes/news.php b/includes/news.php new file mode 100644 index 0000000..52ad91e --- /dev/null +++ b/includes/news.php @@ -0,0 +1,53 @@ +document_element(); +$rootchilds = $root->child_nodes(); + +foreach ($rootchilds as $rootchild) +{ + if ($rootchild->tagname == "channel") + { + $channelchilds = $rootchild->child_nodes(); + + foreach ($channelchilds as $channelchild) + { + if ($channelchild->tagname == "item") + { + $itemchilds = $channelchild->child_nodes(); + $newsdata = array(); + + foreach ($itemchilds as $itemchild) + { + if (strlen($itemchild->tagname) > 0) + { + $newsdata[$itemchild->tagname] = + $itemchild->get_content(); + } + } + + print_news_item($newsdata); + } + } + } +} + +function print_news_item($newsdata) +{ + echo '
    '; + echo '
    ' . $newsdata['pubDate'] . '
    '; + echo '

    ' . $newsdata['title'] . '

    '; + echo '

    ' . $newsdata['description'] . '

    '; + echo '
    '; +} +?> -- cgit v1.2.3-70-g09d2