Ejemplo n.º 1
0
 /**
  * 添加回复
  */
 public static final function append()
 {
     $online = front::online();
     if (!$online->user_id) {
         die('Permission Denied!');
     }
     //需要登录
     $time = time();
     while (isset($_SERVER['REQUEST_METHOD']) && $_SERVER['REQUEST_METHOD'] === 'POST') {
         $post = array('doc_id' => isset($_POST['doc_id']) ? $_POST['doc_id'] : '', 'email' => isset($_POST['email']) ? $_POST['email'] : '', 'content' => isset($_POST['content']) ? $_POST['content'] : '', 'ip' => get_onlineip(), 'create_date' => date('Y-m-d', $time), 'create_time' => date('H:i:s', $time));
         //$post['content'] = htmlentities($content , ENT_COMPAT ,'utf-8') ;
         //pecho($post);
         if (!empty($error)) {
             break;
         }
         $doc_remark = new self();
         $doc_remark->doc_remark_id = null;
         $doc_remark->struct($post);
         $doc_remark->insert('', 'doc_remark_id');
         if ($doc_remark->doc_remark_id) {
             $doc = new doc();
             $doc->doc_id = $doc_remark->doc_id;
             $doc->last_remark = date('Y-m-d H:i:s', $time);
             $doc->update();
         }
         //print_r ( $doc_remark);
         header('Location: ?' . $_GET['query']);
         return;
     }
 }