diff options
author | Philip Häusler <msquare@notrademark.de> | 2011-06-02 01:45:19 +0200 |
---|---|---|
committer | Philip Häusler <msquare@notrademark.de> | 2011-06-02 01:45:19 +0200 |
commit | 134272dd9376a1c43053e590799efb0ea508238c (patch) | |
tree | 9c915e5c1d55b91a40309dfc7fda4346c786c4ef | |
parent | 06497b3a5387f30ea140562cc71e371b2ec1e131 (diff) |
news
-rw-r--r-- | includes/funktion_user.php | 111 | ||||
-rw-r--r-- | www-ssl/index.php | 5 | ||||
-rw-r--r-- | www-ssl/nonpublic/news.php | 12 | ||||
-rw-r--r-- | www-ssl/nonpublic/news_output.php | 106 |
4 files changed, 3 insertions, 231 deletions
diff --git a/includes/funktion_user.php b/includes/funktion_user.php deleted file mode 100644 index c015cb5a..00000000 --- a/includes/funktion_user.php +++ /dev/null @@ -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 " ". 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 (" <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"; - } -?> diff --git a/www-ssl/index.php b/www-ssl/index.php index 1e63ede7..98c7e439 100644 --- a/www-ssl/index.php +++ b/www-ssl/index.php @@ -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'); diff --git a/www-ssl/nonpublic/news.php b/www-ssl/nonpublic/news.php deleted file mode 100644 index 16006c52..00000000 --- a/www-ssl/nonpublic/news.php +++ /dev/null @@ -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"; -?> diff --git a/www-ssl/nonpublic/news_output.php b/www-ssl/nonpublic/news_output.php deleted file mode 100644 index 77bbad87..00000000 --- a/www-ssl/nonpublic/news_output.php +++ /dev/null @@ -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 /> <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> "; - } else { - echo "$i "; - } -} -echo "</div>"; - -?> - -<br /> -<hr> -<h4><?PHP Print_Text(6); ?></h4> -<a name="Neu"> </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> |