The menu now backend supported

It loads the friends and groups of userID 2 by default (only if there is no session userID set
This commit is contained in:
Lars van Hijfte
2017-01-17 14:16:17 +01:00
parent 10d3e177ae
commit 6385324b13
6 changed files with 120 additions and 95 deletions

View File

@@ -1,5 +1,6 @@
$(document).ready(function() {
$(".extra-menu-items").hide();
$("#menu-back").hide();
// Show more friends
$("#more-friends-click").click(function() {

View File

@@ -4,7 +4,6 @@
<body>
<?php
// database gegevens zijn elders opgeslagen
include_once("../queries/connect.php");
include_once("../queries/friendship.php");

View File

@@ -15,8 +15,9 @@ function selectAllFriends($db, $userID) {
`friendship`.`user1ID` = $userID AND
`friendship`.`user2ID` = `user`.`userID` OR
`friendship`.`user2ID` = $userID AND
`friendship`.`user1ID` = `user`.`userID`"
);
`friendship`.`user1ID` = `user`.`userID` AND
`user`.`role` != 3
");
}

View File

@@ -0,0 +1,21 @@
<?php
function selectAllGroupsFromUser($db, $userID) {
return $db->query("
SELECT
`group_page`.`name`,
`group_page`.`picture`
FROM
`group_page`
INNER JOIN
`group_member`
WHERE
`group_member`.`userID` = $userID AND
`group_member`.`groupID` = `group_page`.`groupID` AND
`group_page`.`status` != 0
");
}
?>

View File

@@ -14,6 +14,6 @@
</style>
<?php
include_once("../connect.php");
include_once("../queries/connect.php");
?>

File diff suppressed because one or more lines are too long