<?php
//*****************************
//**** NEWS SITE INDEX ****
//*****************************
$rootdir="../";
$section="news";
// Layout laden #1
include("../layout/include/header.inc.php");
//Kontakt zu Datenbank
$db = mysql_connect ("localhost","asterisk-2a","q3a") or die ("Verbindung fehlgeschlagen");
mysql_select_db ("team-ashlen",$db);
$news_SQL = "SELECT * FROM news WHERE news_ID=$news_ID";
$news_result = mysql_query ($news_SQL);
$news = mysql_fetch_array($news_result);
//Konvertiere Zeilenumbrüche in HTML-<br>-Umbrüche
$news['news_main'] = nl2br($news['news_main']);
//Formatierung des Datums
$ts=$news['news_datetime'];
$unixtime = mktime(substr($ts,11,12),substr($ts,14,15),substr($ts,17,18),substr($ts,5,6),substr($ts,8,9),substr($ts,0,4));
?>
<br>
<table width="420" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="420" height="40" valign="top">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="50" valign="top" rowspan="2">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="50" height="40"></td>
</tr>
</table>
</td>
<td width="1" height="31" valign="top">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="1" height="31"></td>
</tr>
</table>
</td>
<td width="369" valign="top" align="left"><b><font face="Arial, Helvetica, sans-serif" size="2"><?php echo $news['news_head'] ?></font></b>
<br>
<font face="Arial, Helvetica, sans-serif" size="1"><b><?php echo $news['news_author'] ?></b> am <?php echo date("d-m-Y H:i",$unixtime) ?></font></td>
</tr>
<tr>
<td height="9"></td>
<td></td>
</tr>
</table>
</td>
</tr>
<tr>
<td valign="top" height="60">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="420" height="60" valign="top"><font face="Arial, Helvetica, sans-serif" size="2"><?php echo $news['news_main'] ?></font></td>
</tr>
</table>
</td>
</tr>
<tr>
<td height="35" valign="top">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td height="35" width="420" valign="top" align="right"></td>
</tr>
</table>
</td>
</tr>
</table>
<br>
<br>
<?php
// COMMENTS
mysql_select_db ("team-ashlen",$db);
$comments_SQL = "SELECT * FROM `news-comments` WHERE news_ID=$news_ID";
$comments_result = mysql_query ($comments_SQL);
//Ausgabe NEWS
while ($comments = mysql_fetch_array($comments_result)) {
//Konvertiere Zeilenumbrüche in HTML-<br>-Umbrüche
$comments['comments_text'] = nl2br($comments['comments_text']);
//Formatierung des Datums
$ts=$comments['comments_datetime'];
$unixtime = mktime(substr($ts,11,12),substr($ts,14,15),substr($ts,17,18),substr($ts,5,6),substr($ts,8,9),substr($ts,0,4));
?>
<table width="420" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="40" height="20" valign="top">
<table width="98%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="39" height="20" valign="middle" align="center" bgcolor="#68676B"><font face="Arial, Helvetica, sans-serif" size="2"><b>1</b></font></td>
</tr>
</table>
</td>
<td width="280" valign="top">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="280" height="20" bgcolor="#68676B"> <font face="Arial, Helvetica, sans-serif" size="2">by <b><?php echo $comments['comment_name'] ?></b></font></td>
</tr>
</table>
</td>
<td width="100" valign="top">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="100" height="20" valign="middle" align="center" bgcolor="#68676B"><font face="Arial, Helvetica, sans-serif" size="1"><?php echo date("d-m-Y H:i",$unixtime) ?></font></td>
</tr>
</table>
</td>
</tr>
<tr>
<td valign="top" height="20">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="40" height="20"></td>
</tr>
</table>
</td>
<td colspan="2" valign="top">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="380" height="20" valign="top" align="left"><font face="Arial, Helvetica, sans-serif" size="2"><?php echo $comments['comment_text'] ?></font></td>
</tr>
</table>
</td>
</tr>
</table>
<?php
//While-Schleife ZU
}
//Datenbankverbindung ZU
mysql_close();
// Layout laden #2
include("../layout/include/footer.inc.php");
?>