当前位置: 首页>>代码示例>>PHP>>正文


PHP BxTemplVotingView::deleteVotings方法代码示例

本文整理汇总了PHP中BxTemplVotingView::deleteVotings方法的典型用法代码示例。如果您正苦于以下问题:PHP BxTemplVotingView::deleteVotings方法的具体用法?PHP BxTemplVotingView::deleteVotings怎么用?PHP BxTemplVotingView::deleteVotings使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在BxTemplVotingView的用法示例。


在下文中一共展示了BxTemplVotingView::deleteVotings方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: ActionDeletePost

 /**
  * SQL: Delete post by POSTed data
  *
  * @return MsgBox of result
  */
 function ActionDeletePost($iPostID = 0)
 {
     if (!$this->bAdminMode) {
         $this->CheckLogged();
     }
     if ($iPostID == 0) {
         $iPostID = (int) bx_get('DeletePostID');
     }
     $iPostOwnerID = $this->_oDb->getPostOwnerByID($iPostID);
     if (!$this->isAllowedPostDelete($iPostOwnerID)) {
         return $this->_oTemplate->displayAccessDenied();
     }
     if ($iPostID > 0) {
         $oCmts = new BxDolCmts($this->_oConfig->getCommentSystemName(), (int) $iPostID);
         $oCmts->onObjectDelete();
         // delete votings
         bx_import('BxTemplVotingView');
         $oVoting = new BxTemplVotingView($this->_oConfig->getRateSystemName(), $iPostID);
         $oVoting->deleteVotings($iPostID);
         $sFileName = $this->_oDb->getPostPhotoByID($iPostID);
         $sFilePathPost = 'big_' . $sFileName;
         if ($sFilePathPost != '' && file_exists(BX_BLOGS_IMAGES_PATH . $sFilePathPost) && is_file(BX_BLOGS_IMAGES_PATH . $sFilePathPost)) {
             @unlink(BX_BLOGS_IMAGES_PATH . $sFilePathPost);
         }
         $sFilePathPost = 'small_' . $sFileName;
         if ($sFilePathPost != '' && file_exists(BX_BLOGS_IMAGES_PATH . $sFilePathPost) && is_file(BX_BLOGS_IMAGES_PATH . $sFilePathPost)) {
             @unlink(BX_BLOGS_IMAGES_PATH . $sFilePathPost);
         }
         $sFilePathPost = 'orig_' . $sFileName;
         if ($sFilePathPost != '' && file_exists(BX_BLOGS_IMAGES_PATH . $sFilePathPost) && is_file(BX_BLOGS_IMAGES_PATH . $sFilePathPost)) {
             @unlink(BX_BLOGS_IMAGES_PATH . $sFilePathPost);
         }
         $vSqlRes = $this->_oDb->deletePost($iPostID);
         $sRet = db_affected_rows() > 0 ? _t('_post_successfully_deleted') : _t('_failed_to_delete_post');
         $this->isAllowedPostDelete($iPostOwnerID, true);
         // perform action
         //reparse tags
         bx_import('BxDolTags');
         $oTags = new BxDolTags();
         $oTags->reparseObjTags('blog', $iPostID);
         //reparse categories
         $oCategories = new BxDolCategories();
         $oCategories->reparseObjTags('bx_blogs', $iPostID);
         // delete views
         bx_import('BxDolViews');
         $oViews = new BxDolViews($this->_oConfig->getViewSystemName(), $iPostID, false);
         $oViews->onObjectDelete();
         //delete all subscriptions
         $oSubscription = BxDolSubscription::getInstance();
         $oSubscription->unsubscribe(array('type' => 'object_id', 'unit' => 'bx_blogs', 'object_id' => $iPostID));
         bx_import('BxDolAlerts');
         $oZ = new BxDolAlerts('bx_blogs', 'delete_post', $iPostID, $iPostOwnerID);
         $oZ->alert();
         return MsgBox($sRet);
     } else {
         return MsgBox(_t('_Error Occured'));
     }
 }
开发者ID:Gotgot59,项目名称:dolphin.pro,代码行数:63,代码来源:BxBlogsModule.php


注:本文中的BxTemplVotingView::deleteVotings方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。