本文整理汇总了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'));
}
}