Exemplo n.º 1
0
     if (!empty($_POST["comment_id"])) {
         $comment->retrieve();
     }
     echo json_encode($comment->db_out(null, 0));
     break;
 case "get_event_comments":
     if (!empty($_POST["event_id"])) {
         $comment = new WT_Comment();
         echo "<table id='the-comment-list' class='widefat'>";
         comments_rows($comment->query("comment_event_id=" . $_POST["event_id"]));
         echo "</table>";
     }
     break;
 case "insert_comment":
     $comment = new WT_Comment();
     $insert = $comment->insert($_POST);
     if ($insert) {
         $comment->db_response("html");
     }
     break;
 case "more_comments":
     $comments = new WT_Comments($_POST["event_id"], $_POST["start_index"]);
     if ($comments->is_comments()) {
         $comments->json();
     }
     break;
 case "update_comment":
     # Initialize comment, without retrieving it from db
     $comment = new WT_Comment($_POST["comment_id"]);
     # Update DB
     $comment->update($_POST);