Esempio n. 1
0
 public function deleteAction()
 {
     $id = $this->_getParam('id');
     $model = new Application_Model_Blog();
     //$model->delete("id={$id}");
     //added by Mahipal Adhikari on 5-jan-2011, move Blogs to deleted table before deleting permanently
     $model->deleteBlog($id);
     //$tag	=	new Application_Model_BlogTag();
     //$tag->delete("blog_id={$id}");
     $_SESSION['errorMsg'] = "Journal post has been deleted!";
     return $this->_helper->redirector('index', 'journals', "admin");
 }
Esempio n. 2
0
 public function deleteblogAction()
 {
     if ($this->auth->hasIdentity()) {
         $deleteblog = new Application_Model_Blog($this->registry['DB']);
         $blogid = $this->getRequest()->getParam('blogid');
         $this->view->results = $deleteblog->deleteBlog($blogid);
     }
 }
Esempio n. 3
0
 /**
  * @Created By : Mahipal Singh Adhikari
  * @Created On : 1-Nov-2010
  * @Description: Used to delete journal post and corresponding data from database
  */
 public function deletePostAction()
 {
     $id = $this->_getParam('blog_id');
     //$id	= base64_decode($id);
     if (isset($id)) {
         $objBlog = new Application_Model_Blog();
         //added by Mahipal Adhikari on 5-jan-2011, move Blogs to deleted table before deleting permanently
         $objBlog->deleteBlog($id);
         //delete blog
         //$objBlog->delete("id = $id");
         //delete blog tags
         //$objBlogTag = new Application_Model_BlogTag();
         //$objBlogTag->delete("blog_id = $id");
         //delete blog comments
         //$objBlogCom = new Application_Model_Comment();
         //$objBlogCom->delete("item_type='blog' AND item_id = $id");
         //delete blom votes
         //$objBlogVot = new Application_Model_Vote();
         //$objBlogVot->delete("item_type='blog' AND item_id = $id");
         $_SESSION["flash_msg"] = "Post has been deleted successfully!";
     } else {
         $_SESSION["flash_msg"] = "Error occured please try again later.";
     }
     $this->_redirect($this->view->seoUrl('/journal/my-journals/'));
 }