Hendrik post #126

Merged
11342374 merged 53 commits from hendrik-post into master 2017-01-25 16:20:49 +01:00
Showing only changes of commit f9f1e2bf17 - Show all commits

View File

@@ -68,18 +68,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);