Merge branch 'lars' into 'master'
Rip website? See merge request !155
This commit was merged in pull request #159.
This commit is contained in:
@@ -21,7 +21,7 @@ $friends = json_decode($_POST["friends"]);
|
||||
foreach($friends as $i => $friend) {
|
||||
$friendshipStatus = getFriendshipStatus($friend->userID);
|
||||
?>
|
||||
<li class='friend-item <?= $extra ?>'>
|
||||
<li class='friend-item'>
|
||||
<form action='<?= $action ?>' method='<?= $actionType ?>'>
|
||||
<button type='submit'
|
||||
name='username'
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
<body>
|
||||
<?php
|
||||
session_start();
|
||||
|
||||
if(isset($_SESSION["userID"])){
|
||||
header("location: login.php");
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
left: 0;
|
||||
top: 80px;
|
||||
height: calc(100% - 80px);
|
||||
height: calc(100% - 120px);
|
||||
width: 236px;
|
||||
|
||||
padding: 20px 10px;
|
||||
|
||||
@@ -16,7 +16,6 @@ function selectLimitedFriends($userID, $limit) {
|
||||
`profilepicture`,
|
||||
'../img/avatar-standard.png'
|
||||
) AS profilepicture,
|
||||
`onlinestatus`,
|
||||
`role`
|
||||
FROM
|
||||
`user`
|
||||
@@ -56,7 +55,10 @@ function selectAllFriends($userID) {
|
||||
`profilepicture`,
|
||||
'../img/avatar-standard.png'
|
||||
) AS profilepicture,
|
||||
`onlinestatus`,
|
||||
CASE `lastactivity` >= DATE_SUB(NOW(),INTERVAL 15 MINUTE)
|
||||
WHEN TRUE THEN 'online'
|
||||
WHEN FALSE THEN 'offline'
|
||||
END AS `onlinestatus`,
|
||||
`role`
|
||||
FROM
|
||||
`user`
|
||||
@@ -88,7 +90,10 @@ function selectAllFriendRequests() {
|
||||
`profilepicture`,
|
||||
'../img/avatar-standard.png'
|
||||
) AS profilepicture,
|
||||
`onlinestatus`,
|
||||
CASE `lastactivity` >= DATE_SUB(NOW(),INTERVAL 15 MINUTE)
|
||||
WHEN TRUE THEN 'online'
|
||||
WHEN FALSE THEN 'offline'
|
||||
END AS `onlinestatus`,
|
||||
`role`
|
||||
FROM
|
||||
`user`
|
||||
@@ -235,7 +240,10 @@ function searchSomeFriends($n, $m, $search) {
|
||||
`profilepicture`,
|
||||
'../img/avatar-standard.png'
|
||||
) AS profilepicture,
|
||||
`onlinestatus`,
|
||||
CASE `lastactivity` >= DATE_SUB(NOW(),INTERVAL 15 MINUTE)
|
||||
WHEN TRUE THEN 'online'
|
||||
WHEN FALSE THEN 'offline'
|
||||
END AS `onlinestatus`,
|
||||
`role`
|
||||
FROM
|
||||
`user`
|
||||
|
||||
@@ -45,7 +45,10 @@ function selectUser($me, $other) {
|
||||
) AS profilepicture,
|
||||
`bio`,
|
||||
`user`.`creationdate`,
|
||||
`onlinestatus`,
|
||||
CASE `lastactivity` >= DATE_SUB(NOW(),INTERVAL 15 MINUTE)
|
||||
WHEN TRUE THEN 'online'
|
||||
WHEN FALSE THEN 'offline'
|
||||
END AS `onlinestatus`,
|
||||
`role`,
|
||||
`fname`,
|
||||
`lname`,
|
||||
@@ -104,47 +107,47 @@ function selectAllUserGroups($userID) {
|
||||
return $stmt;
|
||||
}
|
||||
|
||||
//function selectAllUserPosts($userID) {
|
||||
// $stmt = prepareQuery("
|
||||
// SELECT
|
||||
// `post`.`postID`,
|
||||
// `post`.`author`,
|
||||
// `title`,
|
||||
// CASE LENGTH(`post`.`content`) >= 150 AND `post`.`content` NOT LIKE '<img%'
|
||||
// WHEN TRUE THEN
|
||||
// CONCAT(LEFT(`post`.`content`, 150), '...')
|
||||
// WHEN FALSE THEN
|
||||
// `post`.`content`
|
||||
// END
|
||||
// AS `content`,
|
||||
// `post`.`creationdate`,
|
||||
// COUNT(`commentID`) AS `comments`,
|
||||
// COUNT(`niet_slecht`.`postID`) AS `niet_slechts`
|
||||
// FROM
|
||||
// `post`
|
||||
// LEFT JOIN
|
||||
// `niet_slecht`
|
||||
// ON
|
||||
// `post`.`postID` = `niet_slecht`.`postID`
|
||||
// LEFT JOIN
|
||||
// `comment`
|
||||
// ON
|
||||
// `post`.`postID` = `comment`.`postID`
|
||||
// WHERE
|
||||
// `post`.`author` = :userID AND
|
||||
// `groupID` IS NULL
|
||||
// GROUP BY
|
||||
// `post`.`postID`
|
||||
// ORDER BY
|
||||
// `post`.`creationdate` DESC
|
||||
// ");
|
||||
//
|
||||
// $stmt->bindParam(':userID', $userID, PDO::PARAM_INT);
|
||||
// if(!$stmt->execute()) {
|
||||
// return False;
|
||||
// }
|
||||
// return $stmt;
|
||||
//}
|
||||
function selectAllUserPosts($userID) {
|
||||
$stmt = prepareQuery("
|
||||
SELECT
|
||||
`post`.`postID`,
|
||||
`post`.`author`,
|
||||
`title`,
|
||||
CASE LENGTH(`post`.`content`) >= 150 AND `post`.`content` NOT LIKE '<img%'
|
||||
WHEN TRUE THEN
|
||||
CONCAT(LEFT(`post`.`content`, 150), '...')
|
||||
WHEN FALSE THEN
|
||||
`post`.`content`
|
||||
END
|
||||
AS `content`,
|
||||
`post`.`creationdate`,
|
||||
COUNT(`commentID`) AS `comments`,
|
||||
COUNT(`niet_slecht`.`postID`) AS `niet_slechts`
|
||||
FROM
|
||||
`post`
|
||||
LEFT JOIN
|
||||
`niet_slecht`
|
||||
ON
|
||||
`post`.`postID` = `niet_slecht`.`postID`
|
||||
LEFT JOIN
|
||||
`comment`
|
||||
ON
|
||||
`post`.`postID` = `comment`.`postID`
|
||||
WHERE
|
||||
`post`.`author` = :userID AND
|
||||
`groupID` IS NULL
|
||||
GROUP BY
|
||||
`post`.`postID`
|
||||
ORDER BY
|
||||
`post`.`creationdate` DESC
|
||||
");
|
||||
|
||||
$stmt->bindParam(':userID', $userID, PDO::PARAM_INT);
|
||||
if(!$stmt->execute()) {
|
||||
return False;
|
||||
}
|
||||
return $stmt;
|
||||
}
|
||||
|
||||
function select20UsersFromN($n) {
|
||||
$q = prepareQuery("
|
||||
|
||||
@@ -3,7 +3,9 @@
|
||||
<img class="profile-picture main-picture" src="<?= $user["profilepicture"] ?>"><br />
|
||||
<div class="platform">
|
||||
<div class="status-buttons-container">
|
||||
<button disabled class="gray"><?= $user["onlinestatus"] ?></button>
|
||||
<button disabled class="gray">
|
||||
<?= $user["onlinestatus"] ?>
|
||||
</button>
|
||||
<button disabled class="gray"><?= $user["role"] ?></button>
|
||||
</div>
|
||||
<div class="friend-button-container">
|
||||
|
||||
Reference in New Issue
Block a user