This commit is contained in:
Philip Häusler 2011-06-02 01:45:19 +02:00
parent 06497b3a53
commit 134272dd93
4 changed files with 3 additions and 231 deletions

View File

@ -1,111 +0,0 @@
<?php
function UID2Nick($UID) {
global $con;
if($UID > 0)
$SQL = "SELECT Nick FROM `User` WHERE UID='$UID'";
else
$SQL = "SELECT Name FROM `UserGroups` WHERE UID='$UID'";
$Erg = mysql_query($SQL, $con);
if(mysql_num_rows($Erg)) {
if($UID > 0)
return mysql_result($Erg, 0);
else
return "Group-".mysql_result($Erg, 0);
} else {
if($UID == -1)
return "logout User";
else
return "UserID $UID not found";
}
}
function TID2Type($TID) {
global $con;
$SQL = "SELECT Name FROM `EngelType` WHERE TID='$TID'";
$Erg = mysql_query($SQL, $con);
if(mysql_num_rows($Erg))
return mysql_result($Erg, 0);
else
return "";
}
function ReplaceSmilies($neueckig) {
global $url, $ENGEL_ROOT;
$neueckig = str_replace(";o))", "<img src=\"" . $url . $ENGEL_ROOT . "pic/smiles/icon_redface.gif\">", $neueckig);
$neueckig = str_replace(":-))", "<img src=\"" . $url . $ENGEL_ROOT . "pic/smiles/icon_redface.gif\">", $neueckig);
$neueckig = str_replace(";o)", "<img src=\"" . $url . $ENGEL_ROOT . "pic/smiles/icon_wind.gif\">", $neueckig);
$neueckig = str_replace(":)", "<img src=\"" . $url . $ENGEL_ROOT . "pic/smiles/icon_smile.gif\">", $neueckig);
$neueckig = str_replace(":-)", "<img src=\"" . $url . $ENGEL_ROOT . "pic/smiles/icon_smile.gif\">", $neueckig);
$neueckig = str_replace(":(", "<img src=\"" . $url . $ENGEL_ROOT . "pic/smiles/icon_sad.gif\">", $neueckig);
$neueckig = str_replace(":-(", "<img src=\"" . $url . $ENGEL_ROOT . "pic/smiles/icon_sad.gif\">", $neueckig);
$neueckig = str_replace(":o(", "<img src=\"" . $url . $ENGEL_ROOT . "pic/smiles/icon_sad.gif\">", $neueckig);
$neueckig = str_replace(":o)", "<img src=\"" . $url . $ENGEL_ROOT . "pic/smiles/icon_lol.gif\">", $neueckig);
$neueckig = str_replace(";o(", "<img src=\"" . $url . $ENGEL_ROOT . "pic/smiles/icon_cry.gif\">", $neueckig);
$neueckig = str_replace(";(", "<img src=\"" . $url . $ENGEL_ROOT . "pic/smiles/icon_cry.gif\">", $neueckig);
$neueckig = str_replace(";-(", "<img src=\"" . $url . $ENGEL_ROOT . "pic/smiles/icon_cry.gif\">", $neueckig);
$neueckig = str_replace("8)", "<img src=\"" . $url . $ENGEL_ROOT . "pic/smiles/icon_rolleyes.gif\">", $neueckig);
$neueckig = str_replace("8o)", "<img src=\"" . $url . $ENGEL_ROOT . "pic/smiles/icon_rolleyes.gif\">", $neueckig);
$neueckig = str_replace(":P", "<img src=\"" . $url . $ENGEL_ROOT . "pic/smiles/icon_evil.gif\">", $neueckig);
$neueckig = str_replace(":-P", "<img src=\"" . $url . $ENGEL_ROOT . "pic/smiles/icon_evil.gif\">", $neueckig);
$neueckig = str_replace(":oP", "<img src=\"" . $url . $ENGEL_ROOT . "pic/smiles/icon_evil.gif\">", $neueckig);
$neueckig = str_replace(";P", "<img src=\"" . $url . $ENGEL_ROOT . "pic/smiles/icon_mad.gif\">", $neueckig);
$neueckig = str_replace(";oP", "<img src=\"" . $url . $ENGEL_ROOT . "pic/smiles/icon_mad.gif\">", $neueckig);
$neueckig = str_replace("?)", "<img src=\"" . $url . $ENGEL_ROOT . "pic/smiles/icon_question.gif\">", $neueckig);
return $neueckig;
}
function GetPicturShow($UID) {
global $con;
$SQL = "SELECT `show` FROM `UserPicture` WHERE `UID`='$UID'";
$res = mysql_query( $SQL, $con);
if(mysql_num_rows($res) == 1)
return mysql_result($res, 0, 0);
else
return "";
}
function displayPictur($UID, $height = "30") {
global $url, $ENGEL_ROOT;
if($height > 0)
return( "<img src=\"". $url. $ENGEL_ROOT. "ShowUserPicture.php?UID=$UID\" height=\"$height\" alt=\"picture of USER$UID\" class=\"photo\">");
else
return( "<img src=\"". $url. $ENGEL_ROOT. "ShowUserPicture.php?UID=$UID\" alt=\"picture of USER$UID\">");
}
function displayavatar($UID, $height="30") {
global $con, $url, $ENGEL_ROOT;
if( GetPicturShow($UID) == 'Y')
return "&nbsp;". displayPictur( $UID, $height);
// show avator
$asql = "select * from User where UID = $UID";
$aerg = mysql_query ($asql, $con);
if(mysql_num_rows($aerg))
if(mysql_result($aerg, 0, "Avatar") > 0)
return ("&nbsp;<img src=\"". $url. $ENGEL_ROOT. "pic/avatar/avatar". mysql_result($aerg, 0, "Avatar"). ".gif\">");
}
function UIDgekommen($UID) {
global $con;
$SQL = "SELECT `Gekommen` FROM `User` WHERE UID='$UID'";
$Erg = mysql_query($SQL, $con);
if(mysql_num_rows($Erg))
return mysql_result($Erg, 0);
else
return "0";
}
?>

View File

@ -7,6 +7,7 @@ require_once ('includes/sys_menu.php');
require_once ('includes/sys_mysql.php');
require_once ('includes/sys_page.php');
require_once ('includes/sys_template.php');
require_once ('includes/sys_user.php');
require_once ('config/config.php');
require_once ('config/config_db.php');
@ -28,8 +29,8 @@ $content = "";
// Recht dafür vorhanden?
if (in_array($p, $privileges)) {
if ($p == "news") {
//require_once ('includes/pages/user_news.php');
$content = "news";
require_once ('includes/pages/user_news.php');
$content = user_news();
}
elseif ($p == "login") {
require_once ('includes/pages/guest_login.php');

View File

@ -1,12 +0,0 @@
<?php
require_once ('../bootstrap.php');
$title = "News";
$header = "News";
include "includes/header.php";
echo "<a href=\"#Neu\">" . Get_Text(3) . "</a>";
include "news_output.php";
include "includes/footer.php";
?>

View File

@ -1,106 +0,0 @@
<?php
if( isset( $_POST["text"]) && isset( $_POST["betreff"]) && IsSet( $_POST["date"]) )
{
if( !isset( $_POST["treffen"]))
$_POST["treffen"] = 0;
$SQL = "INSERT INTO `News` (`Datum`, `Betreff`, `Text`, `UID`, `Treffen`) ".
"VALUES ('". $_POST["date"]. "', '". $_POST["betreff"]. "', '". $_POST["text"]. "', '".$_SESSION['UID'].
"', '". $_POST["treffen"]. "');";
$Erg = mysql_query($SQL, $con);
if ($Erg == 1)
Print_Text(4);
}
if( !IsSet( $_GET["news_begin"]))
$_GET["news_begin"]=0;
if( !IsSet( $_GET["DISPLAY_NEWS"]))
$_GET["DISPLAY_NEWS"] = 5;
$SQL = "SELECT * FROM `News` ORDER BY `ID` DESC LIMIT ". intval($_GET["news_begin"]). ", ". intval($_GET["DISPLAY_NEWS"]);
$Erg = mysql_query($SQL, $con);
// anzahl zeilen
$news_rows = mysql_num_rows($Erg);
for ($n = 0 ; $n < $news_rows ; $n++)
{
if (mysql_result($Erg, $n, "Treffen") == 0)
echo "<p class='question'>";
else
echo "<p class='engeltreffen'>";
echo "<u>". ReplaceSmilies(mysql_result($Erg, $n, "Betreff")) ."</u>\n";
// Schow Admin Page
if( $_SESSION['CVS'][ "admin/news.php" ] == "Y" )
echo " <a href=\"./../admin/news.php?action=change&date=". mysql_result($Erg, $n, "Datum"). "\">[edit]</a><br />\n\t\t";
echo "<br />&nbsp; &nbsp;<font size=1>".mysql_result($Erg, $n, "Datum").", ";
echo UID2Nick(mysql_result($Erg, $n, "UID"))."</font>";
// avatar anzeigen?
echo DisplayAvatar (mysql_result($Erg, $n, "UID"));
echo "</p>\n";
echo "<p class='answer'>". ReplaceSmilies(nl2br(mysql_result($Erg, $n, "Text"))) ."</p>\n";
$RefID=mysql_result($Erg, $n, "ID");
$countSQL="SELECT COUNT(*) FROM `news_comments` WHERE `Refid`='$RefID'";
$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";
$rowerg = mysql_query("SELECT * FROM `News`", $con);
$rows = mysql_num_rows($rowerg);
$dis_rows = round (($rows / $DISPLAY_NEWS)+0.5);
Print_Text(5);
for ($i=1; $i <= $dis_rows; $i++) {
if (!((($i * $DISPLAY_NEWS) - $_GET["news_begin"]) == $DISPLAY_NEWS)) {
echo "<a href=\"./news.php?news_begin=".(($i*$DISPLAY_NEWS) - $DISPLAY_NEWS - 1)."\">$i</a>&nbsp; ";
} else {
echo "$i&nbsp; ";
}
}
echo "</div>";
?>
<br />
<hr>
<h4><?PHP Print_Text(6); ?></h4>
<a name="Neu">&nbsp;</a>
<form action="<?PHP echo $ENGEL_ROOT ?>nonpublic/news.php" method="post">
<?PHP
// Datum mit uebergeben, um doppelte Eintraege zu verhindern
// (Reload nach dem Eintragen!)
?>
<input type="hidden" name="date" value="<?PHP echo date("Y-m-d H:i:s"); ?>">
<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>
<?PHP
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>
<?PHP
}
?>
</table>
<br />
<input type="submit" value="<?PHP Print_Text("save"); ?>">
</form>