/**
  * Method that permits to create a new comment
  *
  * @access	private
  */
 private function create()
 {
     if (VPost::submit() == 'Submit Reply') {
         $comment = new Comment();
         $comment->_name = $this->_user['user_username'];
         $comment->_email = $this->_user['user_email'];
         $comment->_content = VPost::comment_content();
         $comment->_rel_id = VPost::id();
         $comment->_rel_type = VPost::type();
         $comment->_status = 'approved';
         try {
             $comment->create();
             $this->_action_msg = ActionMessages::reply_comment(true);
         } catch (Exception $e) {
             $this->_action_msg = ActionMessages::reply_comment($e->getMessage());
         }
     }
 }
 /**
  * Update medias metadata, and also file manipulation when requested
  *
  * @access	private
  */
 private function update()
 {
     if (VPost::update_image(false)) {
         try {
             $media = new Media();
             $media->_id = VPost::id();
             $media->_name = VPost::name();
             $media->_description = VPost::description();
             $media->update('_name', 'str');
             $media->update('_description', 'str');
             if (VPost::rotate() != 'no') {
                 $media->read('_permalink');
                 $media->read('_type');
                 $path = $media->_permalink;
                 $fname = basename($path);
                 $dirname = dirname($path) . '/';
                 $img = new HandleMedia();
                 $img->_mime = $media->_type;
                 $img->load(PATH . $path);
                 $img->rotate(VPost::rotate());
                 $img->load(PATH . $dirname . '1000-' . $fname);
                 $img->rotate(VPost::rotate());
                 $img->load(PATH . $dirname . '300-' . $fname);
                 $img->rotate(VPost::rotate());
                 $img->load(PATH . $dirname . '150-' . $fname);
                 $img->rotate(VPost::rotate());
             }
             if (VPost::flip() != 'no') {
                 $media->read('_permalink');
                 $media->read('_type');
                 $path = $media->_permalink;
                 $fname = basename($path);
                 $dirname = dirname($path) . '/';
                 $img = new HandleMedia();
                 $img->_mime = $media->_type;
                 $img->load(PATH . $path);
                 $img->flip(VPost::flip());
                 $img->load(PATH . $dirname . '1000-' . $fname);
                 $img->flip(VPost::flip());
                 $img->load(PATH . $dirname . '300-' . $fname);
                 $img->flip(VPost::flip());
                 $img->load(PATH . $dirname . '150-' . $fname);
                 $img->flip(VPost::flip());
             }
             $result = true;
         } catch (Exception $e) {
             $result = $e->getMessage();
         }
         $this->_action_msg = ActionMessages::updated($result);
     } elseif (VPost::update_video(false)) {
         try {
             $media = new Media();
             $media->_id = VPost::id();
             $media->_name = VPost::name();
             $media->_description = VPost::description();
             $media->_category = implode(',', VPost::cat(array()));
             $media->update('_name', 'str');
             $media->update('_description', 'str');
             $media->update('_category', 'str');
             if (VPost::attach() != 'no') {
                 $media->_attachment = VPost::attach();
                 $media->update('_attachment', 'int');
             } else {
                 $media->_attachment = null;
                 $media->update('_attachment', 'null');
             }
             $result = true;
         } catch (Exception $e) {
             $result = $e->getMessage();
         }
         $this->_action_msg = ActionMessages::updated($result);
     } elseif (VPost::update_alien(false)) {
         try {
             $media = new Media();
             $media->_id = VPost::id();
             $media->_name = VPost::name();
             $media->_description = VPost::description();
             $media->_embed_code = VPost::embed();
             $media->update('_name', 'str');
             $media->update('_description', 'str');
             $media->update('_embed_code', 'str');
             $result = true;
         } catch (Exception $e) {
             $result = $e->getMessage();
         }
         $this->_action_msg = ActionMessages::updated($result);
     }
 }