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


PHP post::delete方法代码示例

本文整理汇总了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/");
 }
开发者ID:ravenlp,项目名称:CodiceCMS,代码行数:7,代码来源:admin_controller.php

示例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();
开发者ID:Tekken3,项目名称:test,代码行数:31,代码来源:index.php

示例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');
     }
 }
开发者ID:hyrmedia,项目名称:builderengine,代码行数:10,代码来源:User_blog.php

示例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();
开发者ID:seans888,项目名称:APC-CPO,代码行数:31,代码来源:delete_post.php

示例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!');
         }
     }
 }
开发者ID:TheDoxMedia,项目名称:pgs,代码行数:21,代码来源:forum.worker.php


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