Removed old query for posts.
This commit is contained in:
@@ -103,48 +103,6 @@ function selectAllUserGroups($userID) {
|
|||||||
return $stmt;
|
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) {
|
function select20UsersFromN($n) {
|
||||||
$q = prepareQuery("
|
$q = prepareQuery("
|
||||||
SELECT
|
SELECT
|
||||||
|
|||||||
Reference in New Issue
Block a user