Implement video upload to posts
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user