2005-09-10 19:25:43 +02:00
|
|
|
<?php
|
|
|
|
$title = "Kommentare zu den News";
|
|
|
|
$header = "Kommentar";
|
2010-11-10 21:03:28 +01:00
|
|
|
include ("../../../27c3/includes/header.php");
|
2005-09-10 19:25:43 +02:00
|
|
|
|
|
|
|
|
2005-11-09 18:36:32 +01:00
|
|
|
if( IsSet( $_GET["nid"]))
|
|
|
|
{
|
2005-09-10 19:25:43 +02:00
|
|
|
|
|
|
|
|
2005-11-09 18:36:32 +01:00
|
|
|
if( IsSet( $_GET["text"]))
|
|
|
|
{
|
2006-12-04 20:54:51 +01:00
|
|
|
$ch_sql="INSERT INTO `news_comments` (`Refid`, `Datum`, `Text`, `UID`) ".
|
|
|
|
"VALUES ('". $_GET["nid"]. "', '". date("Y-m-d H:i:s"). "', '". $_GET["text"]. "', '". $_SESSION["UID"]. "')";
|
2005-09-10 19:25:43 +02:00
|
|
|
$Erg = mysql_query($ch_sql, $con);
|
2005-11-09 18:36:32 +01:00
|
|
|
if ($Erg == 1)
|
2005-11-21 22:45:45 +01:00
|
|
|
{
|
2005-11-09 18:36:32 +01:00
|
|
|
echo "Eintrag wurde gespeichert<br><br>";
|
2005-11-21 22:45:45 +01:00
|
|
|
SetHeaderGo2Back();
|
|
|
|
}
|
2005-09-10 19:25:43 +02:00
|
|
|
}
|
|
|
|
|
2006-12-04 20:54:51 +01:00
|
|
|
$SQL = "SELECT * FROM `news_comments` WHERE `Refid`='". $_GET["nid"]. "' ORDER BY 'ID'";
|
2005-09-10 19:25:43 +02:00
|
|
|
$Erg = mysql_query($SQL, $con);
|
2005-11-09 18:36:32 +01:00
|
|
|
echo mysql_error( $con);
|
2005-09-10 19:25:43 +02:00
|
|
|
// anzahl zeilen
|
|
|
|
$news_rows = mysql_num_rows($Erg);
|
|
|
|
|
|
|
|
?>
|
|
|
|
<table border="0" width="100%" class="border" cellpadding="2" cellspacing="1">
|
|
|
|
<tr class="contenttopic">
|
|
|
|
<th width=100 align="left">Datum</th>
|
|
|
|
<th align="left">Nick</th>
|
|
|
|
</tr>
|
|
|
|
<tr class="contenttopic">
|
|
|
|
<th align="left" colspan=2>Kommentar</th>
|
|
|
|
</tr>
|
|
|
|
|
2005-11-30 23:13:38 +01:00
|
|
|
<?PHP
|
2005-09-10 19:25:43 +02:00
|
|
|
for ($n = 0 ; $n < $news_rows ; $n++) {
|
|
|
|
echo "\t<tr class=\"content\">";
|
|
|
|
echo "\t\t<td width=100>";
|
|
|
|
echo mysql_result($Erg, $n, "Datum");
|
|
|
|
echo "\t\t</td>";
|
|
|
|
echo "\t\t<td>";
|
|
|
|
echo UID2Nick(mysql_result($Erg, $n, "UID"));
|
|
|
|
// avatar anzeigen?
|
|
|
|
echo DisplayAvatar (mysql_result($Erg, $n, "UID"));
|
|
|
|
echo "\t\t</td>";
|
|
|
|
echo "</tr>";
|
|
|
|
echo "\t<tr class=\"content\">";
|
|
|
|
echo "\t\t<td colspan=\"2\">";
|
|
|
|
echo nl2br(mysql_result($Erg, $n, "Text"))."\n";
|
|
|
|
echo "\t\t</td>";
|
|
|
|
echo "</tr>";
|
|
|
|
}
|
|
|
|
|
|
|
|
echo "</table>";
|
|
|
|
|
|
|
|
?>
|
|
|
|
|
|
|
|
<br>
|
|
|
|
<hr>
|
|
|
|
<h4>Neuer Kommentar:</h4>
|
|
|
|
<a name="Neu"> </a>
|
|
|
|
|
2005-11-09 18:36:32 +01:00
|
|
|
<form action="./news_comments.php" method="GET">
|
2005-11-30 23:13:38 +01:00
|
|
|
<input type="hidden" name="nid" value="<?PHP echo $_GET["nid"]; ?>">
|
2005-09-10 19:25:43 +02:00
|
|
|
<table>
|
|
|
|
<tr>
|
|
|
|
<td align="right" valign="top">Text:</td>
|
|
|
|
<td><textarea name="text" cols="50" rows="10"></textarea></td>
|
|
|
|
</tr>
|
|
|
|
</table>
|
|
|
|
<br>
|
|
|
|
<input type="submit" value="sichern...">
|
|
|
|
</form>
|
|
|
|
|
2005-11-30 23:13:38 +01:00
|
|
|
<?PHP
|
2005-09-10 19:25:43 +02:00
|
|
|
|
|
|
|
|
2005-11-09 18:36:32 +01:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2005-09-10 19:25:43 +02:00
|
|
|
echo "Fehlerhafter Aufruf!";
|
|
|
|
}
|
2005-11-09 18:36:32 +01:00
|
|
|
|
2010-11-10 21:03:28 +01:00
|
|
|
include ("../../../27c3/includes/footer.php");
|
2005-09-10 19:25:43 +02:00
|
|
|
?>
|