45 lines
1.3 KiB
PHP
45 lines
1.3 KiB
PHP
<? /*
|
|
Copyright (C) 2004 by Duane Groth <duane_at_CAcert_dot_org>
|
|
|
|
This file is part of CAcert.
|
|
|
|
CAcert has been released under the CAcert Source License
|
|
which can be found included with these source files or can
|
|
be downloaded from the internet from the following address:
|
|
http://www.cacert.org/src-lic.php
|
|
|
|
CAcert is distributed WITHOUT ANY WARRANTY; without even
|
|
the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
|
PARTICULAR PURPOSE. See the License for more details.
|
|
*/ ?>
|
|
<?
|
|
loadem("index");
|
|
|
|
$id = intval($id);
|
|
|
|
showheader(_("Welcome to CAcert.org"));
|
|
|
|
if($id > 0)
|
|
{
|
|
$query = "select * from `news` where `id`='$id'";
|
|
$row = mysql_fetch_assoc(mysql_query($query));
|
|
|
|
echo "<h3>".$row['short']."</h3>\n";
|
|
echo "<p>Posted by ".$row['who']." at ".$row['when']."</p>\n";
|
|
|
|
echo "<p>".str_replace("\n", "<br>\n", $row['story'])."</p>\n";
|
|
} else {
|
|
$query = "select *, UNIX_TIMESTAMP(`when`) as `TS` from news order by `when` desc";
|
|
$res = mysql_query($query);
|
|
while($row = mysql_fetch_assoc($res))
|
|
{
|
|
echo "<p><b>".date("Y-m-d", $row['TS'])."</b> - ".$row['short']."</p>\n";
|
|
if($row['story'] != "")
|
|
echo "<p>[ <a href='news.php?id=".$row['id']."'>Full Story</a> ]</p>\n";
|
|
}
|
|
}
|
|
|
|
echo "<p>[ <a href='javascript:history.go(-1)'>Go Back</a> ]</p>\n";
|
|
|
|
showfooter();
|
|
?>
|