summaryrefslogtreecommitdiff
path: root/www-ssl/nonpublic/news_comments.php
diff options
context:
space:
mode:
authorMoritz helios Rudert <helios@planetcyborg.de>2011-06-01 12:13:39 +0200
committerMoritz helios Rudert <helios@planetcyborg.de>2011-06-01 12:13:39 +0200
commit75448045cfe70054c8f4bae1bcfaf9bb0f70d330 (patch)
tree6a4d3d35019cdf933c1816e8522dc5d2557f5238 /www-ssl/nonpublic/news_comments.php
parent12e0b0d809c29d435a247798d7318cc9835980ea (diff)
fixes
Diffstat (limited to 'www-ssl/nonpublic/news_comments.php')
-rw-r--r--[-rwxr-xr-x]www-ssl/nonpublic/news_comments.php70
1 files changed, 33 insertions, 37 deletions
diff --git a/www-ssl/nonpublic/news_comments.php b/www-ssl/nonpublic/news_comments.php
index 826733c1..b90d5a82 100755..100644
--- a/www-ssl/nonpublic/news_comments.php
+++ b/www-ssl/nonpublic/news_comments.php
@@ -3,54 +3,50 @@ $title = "Kommentare zu den News";
$header = "Kommentar";
include ("../../../camp2011/includes/header.php");
+if(isset($_GET["nid"])) {
+ if(isset( $_GET["text"])) {
+ $ch_sql = "INSERT INTO `news_comments` (`Refid`, `Datum`, `Text`, `UID`) ".
+ "VALUES ('". $_GET["nid"]. "', '". date("Y-m-d H:i:s"). "', '". $_GET["text"]. "', '". $_SESSION["UID"]. "')";
+ $Erg = mysql_query($ch_sql, $con);
-if( IsSet( $_GET["nid"]))
-{
-
-
-if( IsSet( $_GET["text"]))
-{
- $ch_sql="INSERT INTO `news_comments` (`Refid`, `Datum`, `Text`, `UID`) ".
- "VALUES ('". $_GET["nid"]. "', '". date("Y-m-d H:i:s"). "', '". $_GET["text"]. "', '". $_SESSION["UID"]. "')";
- $Erg = mysql_query($ch_sql, $con);
- if ($Erg == 1)
- {
- echo "Eintrag wurde gespeichert<br><br>";
- SetHeaderGo2Back();
- }
-}
+ if ($Erg == 1) {
+ echo "Eintrag wurde gespeichert<br /><br />";
+ SetHeaderGo2Back();
+ }
+ }
-$SQL = "SELECT * FROM `news_comments` WHERE `Refid`='". $_GET["nid"]. "' ORDER BY 'ID'";
-$Erg = mysql_query($SQL, $con);
-echo mysql_error( $con);
-// anzahl zeilen
-$news_rows = mysql_num_rows($Erg);
+ $SQL = "SELECT * FROM `news_comments` WHERE `Refid`='". $_GET["nid"]. "' ORDER BY 'ID'";
+ $Erg = mysql_query($SQL, $con);
+ echo mysql_error( $con);
+ // 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>
+ <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>
-<?PHP
+<?php
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 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 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 nl2br(mysql_result($Erg, $n, "Text"))."\n";
echo "\t\t</td>";
echo "</tr>";
}
@@ -59,24 +55,24 @@ echo "</table>";
?>
-<br>
+<br />
<hr>
<h4>Neuer Kommentar:</h4>
<a name="Neu">&nbsp;</a>
<form action="./news_comments.php" method="GET">
-<input type="hidden" name="nid" value="<?PHP echo $_GET["nid"]; ?>">
+<input type="hidden" name="nid" value="<?php echo $_GET["nid"]; ?>">
<table>
<tr>
<td align="right" valign="top">Text:</td>
<td><textarea name="text" cols="50" rows="10"></textarea></td>
</tr>
</table>
-<br>
+<br />
<input type="submit" value="sichern...">
</form>
-<?PHP
+<?php
}