Archived
1
0

Implement video upload to posts

This commit is contained in:
Marcel
2018-12-30 18:52:30 +01:00
parent 1f3e0243cf
commit ebb5c473f6
11 changed files with 1063 additions and 571 deletions

View File

@@ -48,8 +48,8 @@
$this->db->query('DELETE FROM user_posts_media WHERE postID = ?', [$postID]);
}
public function addImageToPost($postID, $imageUrl) {
$this->db->query('INSERT INTO user_posts_media (postID, mediaType, mediaUrl) VALUES (?, ?, ?)', [$postID, 'image', $imageUrl]);
public function addMediaToPost($postID, $type, $fileID) {
$this->db->query('INSERT INTO user_posts_media (postID, mediaType, fileID) VALUES (?, ?, ?)', [$postID, $type, $fileID]);
}
public function preparePostContent($content)
@@ -149,7 +149,7 @@
}
public function getPostMedia($postID) {
$result = $this->db->query('SELECT * FROM user_posts_media WHERE postID = ?', [$postID])->result_array();
$result = $this->db->query('SELECT m.mediaType type, f.name name FROM user_posts_media m LEFT JOIN files f ON f.ID = m.fileID WHERE postID = ?', [$postID])->result_array();
return $result;
}