2005-09-10 19:25:43 +02:00
|
|
|
<?php
|
|
|
|
|
2005-11-17 01:08:10 +01:00
|
|
|
if( isset( $_POST["text"]) && isset( $_POST["betreff"]) && IsSet( $_POST["date"]) )
|
|
|
|
{
|
2005-11-09 18:22:45 +01:00
|
|
|
if( !isset( $_POST["treffen"]))
|
2011-06-01 12:13:39 +02:00
|
|
|
$_POST["treffen"] = 0;
|
2006-12-04 20:54:51 +01:00
|
|
|
$SQL = "INSERT INTO `News` (`Datum`, `Betreff`, `Text`, `UID`, `Treffen`) ".
|
2011-06-01 12:13:39 +02:00
|
|
|
"VALUES ('". $_POST["date"]. "', '". $_POST["betreff"]. "', '". $_POST["text"]. "', '".$_SESSION['UID'].
|
|
|
|
"', '". $_POST["treffen"]. "');";
|
2005-09-10 19:25:43 +02:00
|
|
|
$Erg = mysql_query($SQL, $con);
|
2005-11-09 18:22:45 +01:00
|
|
|
if ($Erg == 1)
|
2011-06-01 12:13:39 +02:00
|
|
|
Print_Text(4);
|
2005-09-10 19:25:43 +02:00
|
|
|
}
|
|
|
|
|
2005-11-09 18:22:45 +01:00
|
|
|
if( !IsSet( $_GET["news_begin"]))
|
2011-06-01 12:13:39 +02:00
|
|
|
$_GET["news_begin"]=0;
|
|
|
|
|
2005-11-09 18:22:45 +01:00
|
|
|
if( !IsSet( $_GET["DISPLAY_NEWS"]))
|
2011-06-01 12:13:39 +02:00
|
|
|
$_GET["DISPLAY_NEWS"] = 5;
|
2005-09-10 19:25:43 +02:00
|
|
|
|
2007-08-11 15:33:59 +02:00
|
|
|
$SQL = "SELECT * FROM `News` ORDER BY `ID` DESC LIMIT ". intval($_GET["news_begin"]). ", ". intval($_GET["DISPLAY_NEWS"]);
|
2005-09-10 19:25:43 +02:00
|
|
|
$Erg = mysql_query($SQL, $con);
|
|
|
|
|
|
|
|
// anzahl zeilen
|
|
|
|
$news_rows = mysql_num_rows($Erg);
|
|
|
|
|
2006-11-30 11:49:24 +01:00
|
|
|
for ($n = 0 ; $n < $news_rows ; $n++)
|
|
|
|
{
|
2005-09-10 19:25:43 +02:00
|
|
|
|
2006-11-30 11:49:24 +01:00
|
|
|
if (mysql_result($Erg, $n, "Treffen") == 0)
|
2011-06-01 12:13:39 +02:00
|
|
|
echo "<p class='question'>";
|
2006-11-30 11:49:24 +01:00
|
|
|
else
|
2011-06-01 12:13:39 +02:00
|
|
|
echo "<p class='engeltreffen'>";
|
2006-11-30 11:49:24 +01:00
|
|
|
|
2010-08-31 21:16:16 +02:00
|
|
|
echo "<u>". ReplaceSmilies(mysql_result($Erg, $n, "Betreff")) ."</u>\n";
|
2005-09-10 19:25:43 +02:00
|
|
|
|
2006-11-30 11:49:24 +01:00
|
|
|
// Schow Admin Page
|
|
|
|
if( $_SESSION['CVS'][ "admin/news.php" ] == "Y" )
|
2011-06-01 12:13:39 +02:00
|
|
|
echo " <a href=\"./../admin/news.php?action=change&date=". mysql_result($Erg, $n, "Datum"). "\">[edit]</a><br />\n\t\t";
|
2005-09-10 19:25:43 +02:00
|
|
|
|
2011-06-01 12:13:39 +02:00
|
|
|
echo "<br /> <font size=1>".mysql_result($Erg, $n, "Datum").", ";
|
2005-09-10 19:25:43 +02:00
|
|
|
echo UID2Nick(mysql_result($Erg, $n, "UID"))."</font>";
|
|
|
|
// avatar anzeigen?
|
|
|
|
echo DisplayAvatar (mysql_result($Erg, $n, "UID"));
|
|
|
|
echo "</p>\n";
|
2005-11-21 01:13:51 +01:00
|
|
|
echo "<p class='answer'>". ReplaceSmilies(nl2br(mysql_result($Erg, $n, "Text"))) ."</p>\n";
|
2005-09-10 19:25:43 +02:00
|
|
|
$RefID=mysql_result($Erg, $n, "ID");
|
2006-12-04 20:54:51 +01:00
|
|
|
$countSQL="SELECT COUNT(*) FROM `news_comments` WHERE `Refid`='$RefID'";
|
2005-09-10 19:25:43 +02:00
|
|
|
$countErg = mysql_query($countSQL, $con);
|
|
|
|
$countcom = mysql_result($countErg, 0, "COUNT(*)");
|
|
|
|
echo "<p class='comment' align='right'><a href=\"./news_comments.php?nid=$RefID\">$countcom comments</a></p>\n\n";
|
|
|
|
}
|
|
|
|
|
|
|
|
echo "<div align=\"center\">\n\n";
|
2006-12-04 20:54:51 +01:00
|
|
|
$rowerg = mysql_query("SELECT * FROM `News`", $con);
|
2005-09-10 19:25:43 +02:00
|
|
|
$rows = mysql_num_rows($rowerg);
|
|
|
|
$dis_rows = round (($rows / $DISPLAY_NEWS)+0.5);
|
|
|
|
|
|
|
|
Print_Text(5);
|
|
|
|
|
|
|
|
for ($i=1; $i <= $dis_rows; $i++) {
|
2011-06-01 12:13:39 +02:00
|
|
|
if (!((($i * $DISPLAY_NEWS) - $_GET["news_begin"]) == $DISPLAY_NEWS)) {
|
|
|
|
echo "<a href=\"./news.php?news_begin=".(($i*$DISPLAY_NEWS) - $DISPLAY_NEWS - 1)."\">$i</a> ";
|
|
|
|
} else {
|
|
|
|
echo "$i ";
|
|
|
|
}
|
2005-09-10 19:25:43 +02:00
|
|
|
}
|
|
|
|
echo "</div>";
|
|
|
|
|
|
|
|
?>
|
|
|
|
|
2011-06-01 12:13:39 +02:00
|
|
|
<br />
|
2005-09-10 19:25:43 +02:00
|
|
|
<hr>
|
|
|
|
<h4><?PHP Print_Text(6); ?></h4>
|
|
|
|
<a name="Neu"> </a>
|
|
|
|
|
2005-12-19 00:18:24 +01:00
|
|
|
<form action="<?PHP echo $ENGEL_ROOT ?>nonpublic/news.php" method="post">
|
2005-11-30 23:13:38 +01:00
|
|
|
<?PHP
|
2005-09-10 19:25:43 +02:00
|
|
|
// Datum mit uebergeben, um doppelte Eintraege zu verhindern
|
|
|
|
// (Reload nach dem Eintragen!)
|
|
|
|
?>
|
2005-11-30 23:13:38 +01:00
|
|
|
<input type="hidden" name="date" value="<?PHP echo date("Y-m-d H:i:s"); ?>">
|
2005-09-10 19:25:43 +02:00
|
|
|
<table>
|
|
|
|
<tr>
|
|
|
|
<td align="right"><?PHP Print_Text(7); ?></td>
|
|
|
|
<td><input type="text" name="betreff" size="60"></td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td align="right"><?PHP Print_Text(8); ?></td>
|
|
|
|
<td><textarea name="text" cols="50" rows="10"></textarea></td>
|
|
|
|
</tr>
|
|
|
|
|
2005-11-30 23:13:38 +01:00
|
|
|
<?PHP
|
2005-09-10 19:25:43 +02:00
|
|
|
if ($_SESSION['CVS']["nonpublic/newsAddMeting"] == "Y") {
|
|
|
|
?>
|
|
|
|
<tr>
|
|
|
|
<td align="right"><?PHP Print_Text(9); ?></td>
|
|
|
|
<td><input type="checkbox" name="treffen" size="1" value="1"></td>
|
|
|
|
</tr>
|
2005-11-30 23:13:38 +01:00
|
|
|
<?PHP
|
2005-09-10 19:25:43 +02:00
|
|
|
}
|
|
|
|
?>
|
|
|
|
</table>
|
2011-06-01 12:13:39 +02:00
|
|
|
<br />
|
2005-11-17 01:08:10 +01:00
|
|
|
<input type="submit" value="<?PHP Print_Text("save"); ?>">
|
2005-09-10 19:25:43 +02:00
|
|
|
</form>
|