本文整理汇总了PHP中cmsCore::deleteComments方法的典型用法代码示例。如果您正苦于以下问题:PHP cmsCore::deleteComments方法的具体用法?PHP cmsCore::deleteComments怎么用?PHP cmsCore::deleteComments使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类cmsCore
的用法示例。
在下文中一共展示了cmsCore::deleteComments方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: deleteItem
public function deleteItem($id)
{
$imageurl = $this->getItemImageUrl($id);
@chmod(PATH . "/images/catalog/{$imageurl}", 0777);
@chmod(PATH . "/images/catalog/small/{$imageurl}", 0777);
@chmod(PATH . "/images/catalog/medium/{$imageurl}", 0777);
@unlink(PATH . '/images/catalog/' . $imageurl);
@unlink(PATH . '/images/catalog/small/' . $imageurl);
@unlink(PATH . '/images/catalog/medium/' . $imageurl);
$this->inDB->query("DELETE FROM cms_uc_items WHERE id= '{$id}'");
$this->inDB->query("DELETE FROM cms_tags WHERE target='catalog' AND item_id = '{$id}'");
$this->inDB->query("DELETE FROM cms_uc_ratings WHERE item_id = '{$id}'");
cmsActions::removeObjectLog('add_catalog', $id);
cmsCore::deleteComments('catalog', $id);
}
示例2: deletePost
/**
* Удаляет пост в блоге
* @param int $post_id
* @return bool
*/
public function deletePost($post_id)
{
cmsCore::callEvent('DELETE_POST', $post_id);
$post = $this->getPost($post_id);
if (!$post) {
return false;
}
// пересчитываем рейтинг блога
$this->inDB->query("UPDATE cms_blogs SET rating = rating - ({$post['rating']}) WHERE id = '{$post['blog_id']}'");
$this->inDB->delete('cms_blog_posts', "id = '{$post_id}'", 1);
cmsCore::deleteRatings($this->getTarget('rating'), $post_id);
cmsCore::deleteComments($this->getTarget('comments'), $post_id);
cmsClearTags($this->getTarget('tags'), $post_id);
cmsCore::deleteUploadImages($post_id, 'blog_post');
cmsActions::removeObjectLog($this->getTarget('actions_post'), $post_id);
return true;
}
示例3: deleteAlbum
/**
* Удаляет альбом
* @param int $album_id
* @param str $differ
* @param obj $inUploadPhoto
* @return bool
*/
public function deleteAlbum($album_id, $differ = '', $inUploadPhoto) {
$album = cmsCore::c('db')->getNsCategory('cms_photo_albums', $album_id, $differ);
if(!$album) { return false; }
cmsCore::callEvent('DELETE_ALBUM', $album_id);
//устанавливаем нужный альбом и все вложенные
$this->whereThisAndNestedCats($album['NSLeft'], $album['NSRight']);
cmsCore::c('db')->addJoin("INNER JOIN cms_photo_albums a ON a.id = f.album_id AND a.NSDiffer = '{$differ}'");
$photos = $this->getPhotos(true);
if ($photos){
foreach($photos as $photo){
$this->deletePhoto($photo, $inUploadPhoto);
}
}
cmsCore::deleteComments($this->getTarget('comments_album'), $album_id);
cmsActions::removeTargetLog($this->getTarget('actions_photo'), $album_id);
return cmsCore::c('db')->deleteNS('cms_photo_albums', $album_id, $differ);
}
示例4: deletePhoto
public function deletePhoto($photo_id) {
cmsCore::loadLib('tags');
$sql = "SELECT imageurl FROM cms_user_photos WHERE id = '{$photo_id}'";
$result = $this->inDB->query($sql);
if ($this->inDB->num_rows($result)){
$photo = $this->inDB->fetch_assoc($result);
@unlink(PATH.'/images/users/photos/'.$photo['imageurl']);
@unlink(PATH.'/images/users/photos/small/'.$photo['imageurl']);
@unlink(PATH.'/images/users/photos/medium/'.$photo['imageurl']);
$this->inDB->query("DELETE FROM cms_user_photos WHERE id = $photo_id") ;
cmsCore::deleteComments('userphoto', $photo_id);
cmsActions::removeObjectLog('add_user_photo', $photo_id);
cmsClearTags('userphoto', $photo_id);
}
return true;
}
示例5: deleteArticle
/**
* Удаляет статью
* @return bool
*/
public function deleteArticle($id)
{
cmsCore::callEvent('DELETE_ARTICLE', $id);
$this->inDB->delete('cms_content', "id='{$id}'", 1);
$this->inDB->delete('cms_tags', "target='content' AND item_id='{$id}'");
cmsCore::clearAccess($id, 'material');
cmsActions::removeObjectLog('add_article', $id);
@unlink(PATH . '/images/photos/small/article' . $id . '.jpg');
@unlink(PATH . '/images/photos/medium/article' . $id . '.jpg');
cmsCore::deleteRatings('content', $id);
cmsCore::deleteComments('article', $id);
translations::deleteTargetTranslation('content_content', $id);
return true;
}
示例6: deleteArticle
/**
* Удаляет статью
* @return bool
*/
public function deleteArticle($id) {
cmsCore::callEvent('DELETE_ARTICLE', $id);
cmsCore::c('db')->delete('cms_content', "id='". $id ."'", 1);
cmsCore::c('db')->delete('cms_tags', "target='content' AND item_id='". $id ."'");
cmsCore::clearAccess($id, 'material');
cmsActions::removeObjectLog('add_article', $id);
@unlink(PATH .'/images/content/medium/'. ceil($id/100) .'/article'. $id .'.jpg');
@unlink(PATH .'/images/content/small/'. ceil($id/100) .'/article'. $id .'.jpg');
cmsCore::deleteUploadImages($id, '', 'content');
cmsCore::deleteRatings('content', $id);
cmsCore::deleteComments('article', $id);
return true;
}
示例7: deleteRecord
public function deleteRecord($item_id)
{
cmsCore::callEvent('DELETE_BOARD_RECORD', $item_id);
$item = $this->getRecord($item_id);
if (!$item) {
return false;
}
@unlink(PATH . '/images/board/' . $item['file']);
@unlink(PATH . '/images/board/small/' . $item['file']);
@unlink(PATH . '/images/board/medium/' . $item['file']);
$this->inDB->delete('cms_board_items', " id = '{$item_id}'", 1);
cmsCore::deleteComments('boarditem', $item_id);
cmsActions::removeObjectLog('add_board', $item_id);
return true;
}