From 11e274a6fedc639223285557766b13b405c03be8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philip=20H=C3=A4usler?= Date: Fri, 3 Jun 2011 06:47:35 +0200 Subject: [PATCH] user meetings --- DB/db_rewrite.sql | 43 ++++---- includes/pages/user_news.php | 71 +++++++++---- includes/sys_menu.php | 1 + www-ssl/admin/user.php | 133 ------------------------- www-ssl/index.php | 4 + www-ssl/nonpublic/engelbesprechung.php | 29 ------ 6 files changed, 80 insertions(+), 201 deletions(-) delete mode 100644 www-ssl/admin/user.php delete mode 100644 www-ssl/nonpublic/engelbesprechung.php diff --git a/DB/db_rewrite.sql b/DB/db_rewrite.sql index f713c813..20a23f1e 100644 --- a/DB/db_rewrite.sql +++ b/DB/db_rewrite.sql @@ -3,7 +3,7 @@ -- http://www.phpmyadmin.net -- -- Host: localhost --- Erstellungszeit: 03. Juni 2011 um 04:40 +-- Erstellungszeit: 03. Juni 2011 um 04:47 -- Server Version: 5.1.44 -- PHP-Version: 5.3.1 @@ -71,7 +71,7 @@ CREATE TABLE IF NOT EXISTS `Counter` ( -- INSERT INTO `Counter` (`URL`, `Anz`) VALUES -('news', 190), +('news', 192), ('login', 26), ('logout', 13), ('start', 26), @@ -82,13 +82,14 @@ INSERT INTO `Counter` (`URL`, `Anz`) VALUES ('admin_angel_types', 71), ('user_settings', 126), ('user_messages', 113), -('admin_groups', 125), +('admin_groups', 129), ('user_questions', 55), ('admin_questions', 42), ('admin_faq', 55), -('admin_news', 32), +('admin_news', 33), ('news_comments', 151), -('admin_user', 55); +('admin_user', 59), +('user_meetings', 5); -- -------------------------------------------------------- @@ -134,29 +135,30 @@ CREATE TABLE IF NOT EXISTS `GroupPrivileges` ( `privilege_id` int(11) NOT NULL, PRIMARY KEY (`id`), KEY `group_id` (`group_id`,`privilege_id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=64 ; +) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=71 ; -- -- Daten für Tabelle `GroupPrivileges` -- INSERT INTO `GroupPrivileges` (`id`, `group_id`, `privilege_id`) VALUES -(42, -2, 15), +(69, -2, 11), (24, -1, 5), -(40, -2, 4), -(41, -2, 3), +(68, -2, 9), +(67, -2, 17), (23, -1, 2), (62, -4, 16), (61, -4, 6), -(44, -2, 11), -(43, -2, 9), +(66, -2, 15), +(65, -2, 3), (12, -5, 10), (60, -4, 12), (59, -4, 14), -(45, -2, 8), +(64, -2, 4), (58, -4, 13), (57, -4, 7), -(63, -4, 5); +(63, -4, 5), +(70, -2, 8); -- -------------------------------------------------------- @@ -223,12 +225,14 @@ CREATE TABLE IF NOT EXISTS `News` ( `UID` int(11) NOT NULL DEFAULT '0', `Treffen` tinyint(4) NOT NULL DEFAULT '0', PRIMARY KEY (`ID`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=4 ; +) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=5 ; -- -- Daten für Tabelle `News` -- +INSERT INTO `News` (`ID`, `Datum`, `Betreff`, `Text`, `UID`, `Treffen`) VALUES +(4, 1307076340, 'Achtung, Treffen!', '', 1, 1); -- -------------------------------------------------------- @@ -268,7 +272,7 @@ CREATE TABLE IF NOT EXISTS `Privileges` ( `desc` varchar(1024) NOT NULL, PRIMARY KEY (`id`), UNIQUE KEY `name` (`name`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=17 ; +) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=18 ; -- -- Daten für Tabelle `Privileges` @@ -290,7 +294,8 @@ INSERT INTO `Privileges` (`id`, `name`, `desc`) VALUES (13, 'admin_faq', 'Edit FAQs'), (14, 'admin_news', 'Administrate the news section'), (15, 'news_comments', 'User can comment news'), -(16, 'admin_user', 'Administrate the angels'); +(16, 'admin_user', 'Administrate the angels'), +(17, 'user_meetings', 'Lists meetings (news)'); -- -------------------------------------------------------- @@ -1033,7 +1038,9 @@ INSERT INTO `Sprache` (`TextID`, `Sprache`, `Text`) VALUES ('news_comments', 'DE', 'News Kommentare'), ('news_comments', 'EN', 'News comments'), ('admin_news', 'DE', 'News verwalten'), -('admin_news', 'EN', 'Manage news'); +('admin_news', 'EN', 'Manage news'), +('user_meetings', 'DE', 'Treffen'), +('user_meetings', 'EN', 'Meetings'); -- -------------------------------------------------------- @@ -1076,7 +1083,7 @@ CREATE TABLE IF NOT EXISTS `User` ( -- INSERT INTO `User` (`UID`, `Nick`, `Name`, `Vorname`, `Alter`, `Telefon`, `DECT`, `Handy`, `email`, `ICQ`, `jabber`, `Size`, `Passwort`, `Gekommen`, `Aktiv`, `Tshirt`, `color`, `Sprache`, `Avatar`, `Menu`, `lastLogIn`, `CreateDate`, `Art`, `kommentar`, `Hometown`) VALUES -(1, 'admin', '', '', 0, '', '', '', '', '', '', 'L', '21232f297a57a5a743894a0e4a801fc3', 0, 0, 0, 10, 'DE', 115, 'L', 1307075960, '0000-00-00 00:00:00', '', '', ''), +(1, 'admin', '', '', 0, '', '', '', '', '', '', 'L', '21232f297a57a5a743894a0e4a801fc3', 0, 0, 0, 10, 'DE', 115, 'L', 1307076377, '0000-00-00 00:00:00', '', '', ''), (147, 'msquare', '', '', 23, '', '', '', 'msquare@notrademark.de', '', '', 'L', 'e10adc3949ba59abbe56e057f20f883e', 0, 0, 0, 6, 'EN', 0, 'L', 1307042703, '2011-06-02 00:55:09', '', '', ''); -- -------------------------------------------------------- diff --git a/includes/pages/user_news.php b/includes/pages/user_news.php index 7b4f9482..818c2da2 100644 --- a/includes/pages/user_news.php +++ b/includes/pages/user_news.php @@ -1,16 +1,45 @@ \n\n"; + $dis_rows = ceil(sql_num_query("SELECT * FROM `News` WHERE `Treffen`=1") / $DISPLAY_NEWS); + + $html .= Get_Text(5); + + for ($i = 0; $i < $dis_rows; $i++) { + if ($i == $_REQUEST['page']) + $html .= ($i +1) . "  "; + else + $html .= '' . ($i +1) . '  '; + } + $html .= ''; + return $html; +} + function display_news($news) { global $privileges, $p; $html .= ""; $html .= '
'; $html .= '
'; - $html .= date("Y-m-d H:i",$news['Datum']) . ', '; + $html .= date("Y-m-d H:i", $news['Datum']) . ', '; $html .= UID2Nick($news['UID']); if ($p != "news_comments") $html .= ', Kommentare (' . sql_num_query("SELECT * FROM `news_comments` WHERE `Refid`='" . sql_escape($news['ID']) . "'") . ') »'; $html .= '
'; - $html .= '

'.($news['Treffen'] == 1 ? '[Meeting] ' : '') . ReplaceSmilies($news['Betreff']) . '

'; + $html .= '

' . ($news['Treffen'] == 1 ? '[Meeting] ' : '') . ReplaceSmilies($news['Betreff']) . '

'; $html .= '

' . ReplaceSmilies(nl2br($news['Text'])) . '

'; if (in_array("admin_news", $privileges)) $html .= "
Edit
\n"; @@ -51,22 +80,22 @@ function user_news_comments() { $html .= ""; $html .= ' -
-
-

Neuer Kommentar:

-   - -
- - - - - - -
Text:
-
- -
'; +
+
+

Neuer Kommentar:

+   + +
+ + + + + + +
Text:
+
+ +
'; } else { $html .= "Fehlerhafter Aufruf!"; } @@ -125,9 +154,9 @@ function user_news() { '; if (in_array('admin_news', $privileges)) { $html .= ' - ' . Get_Text(9) . ' - - '; + ' . Get_Text(9) . ' + + '; } $html .= ' diff --git a/includes/sys_menu.php b/includes/sys_menu.php index 6a10c32b..d5543f97 100644 --- a/includes/sys_menu.php +++ b/includes/sys_menu.php @@ -22,6 +22,7 @@ function make_navigation() { // Engel Navigation $menu .= make_navigation_for(Get_Text('inc_schicht_engel'), array ( "news", + "user_meetings", "user_myshifts", "user_shifts", "user_messages", diff --git a/www-ssl/admin/user.php b/www-ssl/admin/user.php deleted file mode 100644 index 0b31c97c..00000000 --- a/www-ssl/admin/user.php +++ /dev/null @@ -1,133 +0,0 @@ -Neuen Engel eintragen

\n"; - - if (!isset ($_GET["OrderBy"])) - $_GET["OrderBy"] = "Nick"; - $SQL = "SELECT User.*, UserGroups.Name AS 'Group' FROM `User` " . - "LEFT JOIN `UserCVS` ON User.UID = UserCVS.UID " . - "LEFT JOIN `UserGroups` ON UserGroups.UID = UserCVS.GroupID " . - "ORDER BY `" . $_GET["OrderBy"] . "` ASC"; - $Erg = mysql_query($SQL, $con); - echo mysql_error($con); - - // anzahl zeilen - $Zeilen = mysql_num_rows($Erg); - - echo "Anzahl Engel: $Zeilen

\n"; -?> - - - - - - - - - - - - - - - - \n"; - echo "\t\n"; - echo "\t\n"; - echo "\t\n"; - echo "\t\n"; - echo "\t\n"; - echo "\t\n"; - $Gekommen += mysql_result($Erg, $n, "Gekommen"); - echo "\t\n"; - $Active += mysql_result($Erg, $n, "Aktiv"); - echo "\t\n"; - $Tshirt += mysql_result($Erg, $n, "Tshirt"); - echo "\t\n"; - echo "\t\n"; - echo "\t\n"; - echo "\n"; - } - echo "" . - "" . - "\n"; - echo "\t
- ?OrderBy=Nick">Nick | - ?OrderBy=CreateDate">CreateDate - ?OrderBy=Name">Name?OrderBy=Vorname">Vorname?OrderBy=Alter">Alter - ?OrderBy=email">@ | - ?OrderBy=DECT">DECT | - ?OrderBy=Hometown">Hometown | - ?OrderBy=lastLogIn">lastLogIn | - ?OrderBy=Art">Type | - ?OrderBy=ICQ">ICQ | - ?OrderBy=jabber">jabber | - ?OrderBy=Group">Group - ?OrderBy=Size">Größe?OrderBy=Gekommen">G?OrderBy=Aktiv">A?OrderBy=Tshirt">TÄnd.Secure
" . mysql_result($Erg, $n, "Nick") . "
(Create: " . mysql_result($Erg, $n, "CreateDate") . ")
" . mysql_result($Erg, $n, "Name") . "" . mysql_result($Erg, $n, "Vorname") . "" . mysql_result($Erg, $n, "Alter") . ""; - if (strlen(mysql_result($Erg, $n, "Telefon")) > 0) - echo "\n\t\tTel: " . mysql_result($Erg, $n, "Telefon") . "
"; - if (strlen(mysql_result($Erg, $n, "Handy")) > 0) - echo "\n\t\tHandy: " . mysql_result($Erg, $n, "Handy") . "
"; - if (strlen(mysql_result($Erg, $n, "DECT")) > 0) - echo "\n\t\tDECT: " . - mysql_result($Erg, $n, "DECT") . "
"; - if (strlen(mysql_result($Erg, $n, "email")) > 0) - echo "\n\t\temail: " . - mysql_result($Erg, $n, "email") . "
"; - if (strlen(mysql_result($Erg, $n, "Hometown")) > 0) - echo "\n\t\tHometown: " . mysql_result($Erg, $n, "Hometown") . "
"; - if (strlen(mysql_result($Erg, $n, "lastLogIn")) > 0) - echo "\n\t\tlastLogIn: " . mysql_result($Erg, $n, "lastLogIn") . "
"; - if (strlen(mysql_result($Erg, $n, "Art")) > 0) - echo "\n\t\tType: " . mysql_result($Erg, $n, "Art") . "
"; - if (strlen(mysql_result($Erg, $n, "ICQ")) > 0) - echo "\n\t\tICQ: " . mysql_result($Erg, $n, "ICQ") . "
"; - if (strlen(mysql_result($Erg, $n, "jabber")) > 0) - echo "\n\t\tjabber: " . mysql_result($Erg, $n, "jabber") . "
"; - echo "\n\t\tGroup: " . mysql_result($Erg, $n, "Group") . "
"; - echo "
" . mysql_result($Erg, $n, "Size") . "" . mysql_result($Erg, $n, "Gekommen") . "" . mysql_result($Erg, $n, "Aktiv") . "" . mysql_result($Erg, $n, "Tshirt") . "" . funktion_isLinkAllowed_addLink_OrEmpty("admin/userChangeNormal.php?enterUID=" . - mysql_result($Erg, $n, "UID") . "&Type=Normal", "Änd.") . - "" . funktion_isLinkAllowed_addLink_OrEmpty("admin/userChangeSecure.php?enterUID=" . - mysql_result($Erg, $n, "UID") . "&Type=Secure", "Secure") . - "
$Gekommen$Active$Tshirt
\n"; - // Ende Userliste - - echo "

Statistics

"; - funktion_db_element_list_2row("Hometown", "SELECT COUNT(`Hometown`), `Hometown` FROM `User` GROUP BY `Hometown`"); - - echo "
\n"; - - funktion_db_element_list_2row("Engeltypen", "SELECT COUNT(`Art`), `Art` FROM `User` GROUP BY `Art`"); - - echo "
\n"; - - funktion_db_element_list_2row("Used Groups", "SELECT UserGroups.Name AS 'GroupName', COUNT(UserGroups.Name) AS Count FROM `UserCVS` " . - "LEFT JOIN `UserGroups` ON UserGroups.UID = UserCVS.GroupID " . - "WHERE (UserCVS.GroupID!='NULL') " . - "GROUP BY `GroupName` " . - ""); -} else { - echo "error"; -} - -include ("includes/footer.php"); -?> - - diff --git a/www-ssl/index.php b/www-ssl/index.php index f6c6aaa2..ded6c110 100644 --- a/www-ssl/index.php +++ b/www-ssl/index.php @@ -40,6 +40,10 @@ if (in_array($p, $privileges)) { require_once ('includes/pages/user_news.php'); $content = user_news_comments(); } + elseif ($p == "user_meetings") { + require_once ('includes/pages/user_news.php'); + $content = user_meetings(); + } elseif ($p == "user_messages") { $content = user_messages(); } diff --git a/www-ssl/nonpublic/engelbesprechung.php b/www-ssl/nonpublic/engelbesprechung.php deleted file mode 100644 index 7ff684d4..00000000 --- a/www-ssl/nonpublic/engelbesprechung.php +++ /dev/null @@ -1,29 +0,0 @@ -" . mysql_result($Erg, $n, "Betreff") . ""; - - // Show Admin Page - if ($_SESSION['CVS']["admin/news.php"] == "Y") - echo " [edit]"; - - echo "
   " . mysql_result($Erg, $n, "Datum") . ", "; - echo UID2Nick(mysql_result($Erg, $n, "UID")) . "

\n"; - echo "

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

\n"; - } -} - -include ("includes/footer.php"); -?>