本文整理汇总了PHP中post::delete方法的典型用法代码示例。如果您正苦于以下问题:PHP post::delete方法的具体用法?PHP post::delete怎么用?PHP post::delete使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类post
的用法示例。
在下文中一共展示了post::delete方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: remove
public function remove($id)
{
$P = new post();
$P->find($id);
$P->delete();
$this->redirect("admin/");
}
示例2: insert
echo '<h2>' . $row['post_title'] . '</h2>';
echo '<p>' . $row['post_content'] . '</p>';
echo '<span>' . $row['post_date'] . '</span>';
echo '</div>';
}
mysqli_close($cx);
}
public function insert($id, $title, $content, $date)
{
$q = mysqli_query($cx, "SELECT * FROM post WHERE post_id = " . $this->postId);
$row = mysqli_fetch_assoc($q);
mysqli_close($cx);
return $row;
}
public function delete($id)
{
$cx = $this->connect();
if (is_int($id)) {
$query = "DELETE FROM post WHERE post_id = " . $id;
} else {
if (is_array($id)) {
$ids = implode(', ', $id);
$query = "DELETE FROM post WHERE post_id in ( " . $ids . " )";
}
}
mysqli_query($cx, $query);
}
}
$post = new post();
$post->delete(7);
$post->retrive();
示例3: delete_post
public function delete_post($id)
{
if (!$this->user->is_logged_in()) {
redirect("/user/main/userLogin", 'location');
} else {
$post = new post($id);
$post->delete();
redirect('/user/blog/posts', 'location');
}
}
示例4: urldecode
require 'path.php';
init_cobalt('Delete post');
if (isset($_GET['id'])) {
$id = urldecode($_GET['id']);
require_once 'form_data_post.php';
}
if (xsrf_guard()) {
init_var($_POST['btn_cancel']);
init_var($_POST['btn_delete']);
require 'components/query_string_standard.php';
if ($_POST['btn_cancel']) {
log_action('Pressed cancel button');
redirect("listview_post.php?{$query_string}");
} elseif ($_POST['btn_delete']) {
log_action('Pressed delete button');
require_once 'subclasses/post.php';
$dbh_post = new post();
$object_name = 'dbh_post';
require 'components/create_form_data.php';
$dbh_post->delete($arr_form_data);
redirect("listview_post.php?{$query_string}");
}
}
require 'subclasses/post_html.php';
$html = new post_html();
$html->draw_header('Delete Post', $message, $message_type);
$html->draw_listview_referrer_info($filter_field_used, $filter_used, $page_from, $filter_sort_asc, $filter_sort_desc);
$html->draw_hidden('id');
$html->detail_view = TRUE;
$html->draw_controls('delete');
$html->draw_footer();
示例5: delete_post
private function delete_post($post_id)
{
if ($this->user['SiteRank'] >= 4) {
$post = post::get($post_id);
if ($post['postorderid'] == 0) {
if ($this->user['Username'] == $post['author'] || $this->user['Username'] >= 4) {
$result = post::delete($post_id);
//Update thread replys count
thread::update_post_count($post['thread']);
////Build event details to log
// $logEventID = '132';
// $logDetails = 'Forum post id:'.$post_id.' in thread id:'.$thread.' for category id:'.$category.' deleted!';
// $logEventAuthor = $this->user['Username'];
// //Write to admin log.
json::resp(array('success' => true, 'cat' => $post['cat'], 'thread' => $post['thread']));
}
} else {
self::errorJSON('Cannot delete first post of thread, the entire thread must be deleted!');
}
}
}