From ac83bb750bbe3359904f8d3b0e90788c0064c304 Mon Sep 17 00:00:00 2001 From: Hendrik Date: Mon, 23 Jan 2017 16:05:22 +0100 Subject: [PATCH 001/214] fix status for enums, fix pages --- website/views/adminpanel.php | 64 ++++++++++++++++++------------------ 1 file changed, 32 insertions(+), 32 deletions(-) diff --git a/website/views/adminpanel.php b/website/views/adminpanel.php index e53d679..834f54f 100644 --- a/website/views/adminpanel.php +++ b/website/views/adminpanel.php @@ -85,37 +85,37 @@ $listm = $currentpage * $perpage;

Show:

- > + >
- > + >
- > + >
- > + >
- > + >
- > + >

Show:

- > + >
- > + >
- > + >
@@ -138,11 +138,11 @@ $listm = $currentpage * $perpage; id="admin-batchform" action="" method="post"> - +
- +
- +

@@ -154,11 +154,11 @@ $listm = $currentpage * $perpage; id="admin-groupbatchform" action="" method="post"> - +
- +
- +

@@ -225,7 +225,7 @@ $listm = $currentpage * $perpage; $listm = $currentpage * $perpage; if ($pagetype == 'user') { - $q = searchSomeUsersByStatus($listn, $listm, $search, $status); + $q = searchSomeUsersByStatus($listn, $perpage, $search, $status); while($user = $q->fetch(PDO::FETCH_ASSOC)) { $userID = $user['userID']; @@ -252,9 +252,9 @@ $listm = $currentpage * $perpage; action='$thispage' method='post'> @@ -264,7 +264,7 @@ $listm = $currentpage * $perpage; "); } } else { - $q = searchSomeGroupsByStatus($listn, $listm, $search, $groupstatus); + $q = searchSomeGroupsByStatus($listn, $perpage, $search, $groupstatus); while ($group = $q->fetch(PDO::FETCH_ASSOC)) { $groupID = $group['groupID']; @@ -291,9 +291,9 @@ $listm = $currentpage * $perpage; action='$thispage' method='post'> -- 2.49.1 From f82dd73b7de91479722ff1d3a63ffb4fbb465bcd Mon Sep 17 00:00:00 2001 From: Marijn Jansen Date: Mon, 23 Jan 2017 16:23:47 +0100 Subject: [PATCH 002/214] Profile picrure old deletion (: --- website/public/settings.php | 5 ++--- website/queries/settings.php | 20 +++++++++++++++----- 2 files changed, 17 insertions(+), 8 deletions(-) diff --git a/website/public/settings.php b/website/public/settings.php index 06d17c0..b473f99 100644 --- a/website/public/settings.php +++ b/website/public/settings.php @@ -2,7 +2,7 @@ @@ -12,8 +12,6 @@ prepare(" + SELECT + `profilepicture` + FROM + `user` + WHERE + `userID` = :userID + "); + $stmt->bindParam(":userID", $_SESSION["userID"]); + $stmt->execute(); + $old_avatar = $stmt->fetch()["profilepicture"]; + unlink("/var/www/html/public/uploads/" . $old_avatar); +} function setProfilePictureToDatabase($url) { $stmt = $GLOBALS["db"]->prepare(" -- 2.49.1 From 58ce5f1e7515198cace4d0aef031e1de63df01fb Mon Sep 17 00:00:00 2001 From: Lars van Hijfte Date: Mon, 23 Jan 2017 16:24:48 +0100 Subject: [PATCH 003/214] Menu, netjes, notification --- website/public/API/loadChatNotifications.php | 8 + ...php => loadFriendRequestNotifications.php} | 0 website/public/js/header.js | 6 +- website/public/js/notifications.js | 18 ++- website/public/styles/footer.css | 3 +- website/public/styles/main.css | 1 + website/public/styles/menu.css | 20 ++- website/public/styles/profile.css | 3 - website/queries/friendship.php | 8 +- website/queries/group_member.php | 11 +- website/views/menu.php | 140 ++++++++---------- 11 files changed, 114 insertions(+), 104 deletions(-) create mode 100644 website/public/API/loadChatNotifications.php rename website/public/API/{loadNotifications.php => loadFriendRequestNotifications.php} (100%) diff --git a/website/public/API/loadChatNotifications.php b/website/public/API/loadChatNotifications.php new file mode 100644 index 0000000..3b5835f --- /dev/null +++ b/website/public/API/loadChatNotifications.php @@ -0,0 +1,8 @@ + \
\ +
+
    + "; + } else { + echo " +

    + Vrienden +

    +
      + "; - // Set default values of a friend. + foreach ($friends as $i => $friend) { $username = $friend["username"]; $extraItem = ""; - $pf = "img/notbad.jpg"; + $pf = $friend["profilepicture"]; - // Change values if needed. - if (!empty($friend["profilepicture"])) - $pf = $friend["profilepicture"]; - - if ($i > 5) + if ($i >= 5) $extraItem = "extra-menu-items"; - // Echo the friend. echo "
    • @@ -47,66 +57,45 @@ "; } - $randomUser = selectRandomNotFriendUser($_SESSION["userID"])["username"]; - - echo " -
    • - - -
    • -
    • - "; - if ($i > 5) { - $i -= 5; + if (sizeof($friends) > 5) { echo "
    • - En nog $i anderen... -
    • + Meer vrienden.. + "; } - - ?> -
    + } + ?>
    -

    - Groepen -

    -
    -- 2.49.1 From 119c82e110733468f1ff965b0777279b11c36c48 Mon Sep 17 00:00:00 2001 From: Hendrik Date: Mon, 23 Jan 2017 16:27:54 +0100 Subject: [PATCH 004/214] minor color and text fixes --- website/public/styles/search.css | 2 +- website/queries/user.php | 5 ++++- website/views/search-view.php | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/website/public/styles/search.css b/website/public/styles/search.css index 86fd41d..565723e 100644 --- a/website/public/styles/search.css +++ b/website/public/styles/search.css @@ -25,5 +25,5 @@ } li.search-item:hover{ - background-color: #EEE; + background-color: #FBC02D; } \ No newline at end of file diff --git a/website/queries/user.php b/website/queries/user.php index 0af5262..649d976 100644 --- a/website/queries/user.php +++ b/website/queries/user.php @@ -278,7 +278,10 @@ function searchSomeUsers($n, $m, $search) $stmt = $GLOBALS["db"]->prepare(" SELECT `username`, - `profilepicture`, + IFNULL( + `profilepicture`, + '../img/notbad.jpg' + ) AS profilepicture, `fname`, `lname` FROM diff --git a/website/views/search-view.php b/website/views/search-view.php index ad93659..83d5bc0 100644 --- a/website/views/search-view.php +++ b/website/views/search-view.php @@ -38,7 +38,7 @@ $group_count = countSomeGroups($search)->fetchColumn(); >