Example #1
0
 function createComment($post_id, $owner_id)
 {
     // owner_id owner of post
     $model = new Comment_Model();
     $x = $model->createComment(Session::get('id'), $post_id, $_POST['comment_text']);
     if ($x == true) {
         $contNot = new Notification();
         $contNot->createNotification($owner_id, Session::get('id'), $post_id, "comment");
         echo 'Comment successfuly created';
         header("Location:" . URL . "/post/newsfeed");
     } else {
         echo 'error';
     }
     exit;
 }