my_article_put.php 964 B

12345678910111213141516171819202122232425
  1. <?php
  2. require_once "../path.php";
  3. require_once "../public/_pdo.php";
  4. require_once '../public/function.php';
  5. require_once '../hostsetting/function.php';
  6. require_once "../ucenter/active.php";
  7. $respond=array("status"=>0,"message"=>"");
  8. PDO_Connect("sqlite:"._FILE_DB_USER_ARTICLE_);
  9. $query="INSERT INTO article ( id, title , subtitle , summary , content , tag , owner, setting , status , create_time , modify_time , receive_time ) VALUES ( ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? ) ";
  10. $sth = $PDO->prepare($query);
  11. $uuid = UUID::v4();
  12. //写入日志
  13. add_edit_event(_ARTICLE_NEW_,$uuid);
  14. $sth->execute(array($uuid , $_POST["title"] , "" ,"", "" , "" , $_COOKIE["userid"] , "{}" , 1 , mTime() , mTime() , mTime() ));
  15. $respond=array("status"=>0,"message"=>"");
  16. if (!$sth || ($sth && $sth->errorCode() != 0)) {
  17. $error = PDO_ErrorInfo();
  18. $respond['status']=1;
  19. $respond['message']=$error[2];
  20. }
  21. echo json_encode($respond, JSON_UNESCAPED_UNICODE);
  22. ?>