Merge branch 'kevin-prototype' into 'master'
Kevin prototype See merge request !109
This commit was merged in pull request #113.
This commit is contained in:
@@ -20,8 +20,6 @@ if(empty($_GET["username"])) {
|
|||||||
$userID = getUserID($_GET["username"]);
|
$userID = getUserID($_GET["username"]);
|
||||||
}
|
}
|
||||||
|
|
||||||
echo "User ID: $userID";
|
|
||||||
|
|
||||||
$user = selectUser($_SESSION["userID"], $userID);
|
$user = selectUser($_SESSION["userID"], $userID);
|
||||||
$profile_friends = selectAllFriends($userID);
|
$profile_friends = selectAllFriends($userID);
|
||||||
$profile_groups = selectAllUserGroups($userID);
|
$profile_groups = selectAllUserGroups($userID);
|
||||||
|
|||||||
@@ -105,18 +105,24 @@ function selectAllUserGroups($userID) {
|
|||||||
function selectAllUserPosts($userID) {
|
function selectAllUserPosts($userID) {
|
||||||
$stmt = $GLOBALS["db"]->prepare("
|
$stmt = $GLOBALS["db"]->prepare("
|
||||||
SELECT
|
SELECT
|
||||||
`postID`,
|
`postID`,
|
||||||
`author`,
|
`author`,
|
||||||
`title`,
|
`title`,
|
||||||
`content`,
|
CASE LENGTH(`content`) >= 150
|
||||||
`creationdate`
|
WHEN TRUE THEN
|
||||||
|
CONCAT(LEFT(`content`, 150), '...')
|
||||||
|
WHEN FALSE THEN
|
||||||
|
`content`
|
||||||
|
END
|
||||||
|
AS `content`,
|
||||||
|
`creationdate`
|
||||||
FROM
|
FROM
|
||||||
`post`
|
`post`
|
||||||
WHERE
|
WHERE
|
||||||
`author` = :userID AND
|
`author` = :userID AND
|
||||||
`groupID` IS NULL
|
`groupID` IS NULL
|
||||||
ORDER BY
|
ORDER BY
|
||||||
`creationdate` DESC
|
`creationdate` DESC
|
||||||
");
|
");
|
||||||
|
|
||||||
$stmt->bindParam(':userID', $userID, PDO::PARAM_INT);
|
$stmt->bindParam(':userID', $userID, PDO::PARAM_INT);
|
||||||
|
|||||||
@@ -60,7 +60,7 @@
|
|||||||
<div class="post platform">
|
<div class="post platform">
|
||||||
<form>
|
<form>
|
||||||
<input type="text" class="newpost" placeholder="Titel">
|
<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!">
|
<input type="submit" value="Plaats!">
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user