summaryrefslogtreecommitdiff
path: root/website/about/news.php
blob: fff54db5d9897f9f8653da0f2f3e5d2760c68276 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<?php
/*
 * Copyright 2004 Matt Brubeck
 * This file is licensed under a Creative Commons license:
 * http://creativecommons.org/licenses/by/2.0/
 */
  require_once "main.inc.php";
  require_once "../include/news.inc.php";
  $pageId = "news";

  $itemId = $_REQUEST["id"];

  if ($itemId != "") {
    $news_item = $news_items[$itemId];
    $pageTitle = $news_item->title;
    include "../include/header.inc.php";

    $dateStr = $news_item->dateStr();
    echo "<h2>$dateStr: $pageTitle</h2>";
    echo $news_item->body;
    echo '<hr><p><a href="news">'._("More news items...").'</a></p>';
  }
  else {
    // List news items in reverse chronological order.
    $pageTitle = _("News");
    include "../include/header.inc.php";

    echo "<h2>$pageTitle</h2>";
    echo "<ul>";
    foreach ($news_items as $key => $news_item) {
      echo '<li>'.$news_item->dateStr().": <a href=\"news?id=$key\">".$news_item->title.'</a></li>';
    }
    echo "</ul>";
  }

  include "../include/footer.inc.php";
?>