From 134272dd9376a1c43053e590799efb0ea508238c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philip=20H=C3=A4usler?= Date: Thu, 2 Jun 2011 01:45:19 +0200 Subject: [PATCH] news --- includes/funktion_user.php | 111 ------------------------------ www-ssl/index.php | 5 +- www-ssl/nonpublic/news.php | 12 ---- www-ssl/nonpublic/news_output.php | 106 ---------------------------- 4 files changed, 3 insertions(+), 231 deletions(-) delete mode 100644 includes/funktion_user.php delete mode 100644 www-ssl/nonpublic/news.php delete mode 100644 www-ssl/nonpublic/news_output.php 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 @@ - 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))", "", $neueckig); - $neueckig = str_replace(":-))", "", $neueckig); - $neueckig = str_replace(";o)", "", $neueckig); - $neueckig = str_replace(":)", "", $neueckig); - $neueckig = str_replace(":-)", "", $neueckig); - $neueckig = str_replace(":(", "", $neueckig); - $neueckig = str_replace(":-(", "", $neueckig); - $neueckig = str_replace(":o(", "", $neueckig); - $neueckig = str_replace(":o)", "", $neueckig); - $neueckig = str_replace(";o(", "", $neueckig); - $neueckig = str_replace(";(", "", $neueckig); - $neueckig = str_replace(";-(", "", $neueckig); - $neueckig = str_replace("8)", "", $neueckig); - $neueckig = str_replace("8o)", "", $neueckig); - $neueckig = str_replace(":P", "", $neueckig); - $neueckig = str_replace(":-P", "", $neueckig); - $neueckig = str_replace(":oP", "", $neueckig); - $neueckig = str_replace(";P", "", $neueckig); - $neueckig = str_replace(";oP", "", $neueckig); - $neueckig = str_replace("?)", "", $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( "\"picture"); - else - return( "\"picture"); - } - - 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 (" "); - } - - 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 @@ -" . Get_Text(3) . ""; -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 @@ -"; - else - echo "

"; - - echo "". ReplaceSmilies(mysql_result($Erg, $n, "Betreff")) ."\n"; - - // Schow Admin Page - if( $_SESSION['CVS'][ "admin/news.php" ] == "Y" ) - echo " [edit]
\n\t\t"; - - echo "
   ".mysql_result($Erg, $n, "Datum").", "; - echo UID2Nick(mysql_result($Erg, $n, "UID")).""; - // avatar anzeigen? - echo DisplayAvatar (mysql_result($Erg, $n, "UID")); - echo "

\n"; - echo "

". ReplaceSmilies(nl2br(mysql_result($Erg, $n, "Text"))) ."

\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 "

$countcom comments

\n\n"; -} - -echo "
\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 "$i  "; - } else { - echo "$i  "; - } -} -echo "
"; - -?> - -
-
-

-  - -
- -"> - - - - - - - - - - - - - - - - -
-
-"> -