Merge branch 'master' into lars

This commit is contained in:
Lars van Hijfte
2017-01-24 17:07:07 +01:00
3 changed files with 16 additions and 12 deletions

View File

@@ -20,8 +20,6 @@ if(empty($_GET["username"])) {
$userID = getUserID($_GET["username"]);
}
echo "User ID: $userID";
$user = selectUser($_SESSION["userID"], $userID);
$profile_friends = selectAllFriends($userID);
$profile_groups = selectAllUserGroups($userID);

View File

@@ -105,18 +105,24 @@ function selectAllUserGroups($userID) {
function selectAllUserPosts($userID) {
$stmt = $GLOBALS["db"]->prepare("
SELECT
`postID`,
`author`,
`title`,
`content`,
`creationdate`
`postID`,
`author`,
`title`,
CASE LENGTH(`content`) >= 150
WHEN TRUE THEN
CONCAT(LEFT(`content`, 150), '...')
WHEN FALSE THEN
`content`
END
AS `content`,
`creationdate`
FROM
`post`
`post`
WHERE
`author` = :userID AND
`groupID` IS NULL
`author` = :userID AND
`groupID` IS NULL
ORDER BY
`creationdate` DESC
`creationdate` DESC
");
$stmt->bindParam(':userID', $userID, PDO::PARAM_INT);

View File

@@ -60,7 +60,7 @@
<div class="post platform">
<form>
<input type="text" class="newpost" placeholder="Titel">
<textarea class="newpost">Schrijf een berichtje...</textarea>
<textarea class="newpost" placeholder="Schrijf een berichtje..."></textarea>
<input type="submit" value="Plaats!">
</form>
</div>