本文整理汇总了PHP中Blog::delete_post方法的典型用法代码示例。如果您正苦于以下问题:PHP Blog::delete_post方法的具体用法?PHP Blog::delete_post怎么用?PHP Blog::delete_post使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Blog
的用法示例。
在下文中一共展示了Blog::delete_post方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: delete
function delete($id)
{
/* Create a new blog interface object. */
$blog = new Blog(createPDO());
/* Attempt to delete the post and return the result. */
return $blog->delete_post($id);
}
示例2: testDeletePost
public function testDeletePost()
{
$blog = new Blog($this->pdo);
$blog->delete_post(1);
$result = $this->getConnection()->createQueryTable("posts", "SELECT * FROM posts\n WHERE id = 1");
$this->assertEquals(0, $result->getRowCount());
}
示例3: isset
}
}
if (isset($_GET['action']) && $_GET['action'] == 'view_post') {
$task_id = isset($_GET['task_id']) && is_numeric($_GET['task_id']) ? $_GET['task_id'] : 0;
if (isset($_GET['do']) && $_GET['do'] == 'delete_comment') {
if (api_is_allowed('BLOG_' . $blog_id, 'article_comments_delete', $task_id)) {
Blog::delete_comment($blog_id, (int) $_GET['post_id'], (int) $_GET['comment_id']);
$return_message = array('type' => 'confirmation', 'message' => get_lang('CommentDeleted'));
} else {
$error = true;
$message = get_lang('ActionNotAllowed');
}
}
if (isset($_GET['do']) && $_GET['do'] == 'delete_article') {
if (api_is_allowed('BLOG_' . $blog_id, 'article_delete', $task_id)) {
Blog::delete_post($blog_id, (int) $_GET['article_id']);
$current_page = '';
// Article is gone, go to blog home
$return_message = array('type' => 'confirmation', 'message' => get_lang('BlogDeleted'));
} else {
$error = true;
$message = get_lang('ActionNotAllowed');
}
}
if (isset($_GET['do']) && $_GET['do'] == 'rate') {
if (isset($_GET['type']) && $_GET['type'] == 'post') {
if (api_is_allowed('BLOG_' . $blog_id, 'article_rate')) {
Blog::add_rating('post', $blog_id, (int) $_GET['post_id'], (int) $_GET['rating']);
$return_message = array('type' => 'confirmation', 'message' => get_lang('RatingAdded'));
}
}