table_portal_article_trash.php 805 B

12345678910111213141516171819202122232425262728293031323334353637
  1. <?php
  2. /**
  3. * [Discuz!] (C)2001-2099 Comsenz Inc.
  4. * This is NOT a freeware, use is subject to license terms
  5. *
  6. * $Id: table_portal_article_trash.php 27836 2012-02-15 08:14:02Z zhangguosheng $
  7. */
  8. if(!defined('IN_DISCUZ')) {
  9. exit('Access Denied');
  10. }
  11. class table_portal_article_trash extends discuz_table
  12. {
  13. public function __construct() {
  14. $this->_table = 'portal_article_trash';
  15. $this->_pk = 'aid';
  16. parent::__construct();
  17. }
  18. public function insert_batch($inserts) {
  19. $sql = array();
  20. foreach($inserts as $value) {
  21. if(($value['aid'] = dintval($value['aid']))) {
  22. $sql[] = "('$value[aid]', '".addslashes($value['content'])."')";
  23. }
  24. }
  25. if($sql) {
  26. DB::query('INSERT INTO '.DB::table($this->_table)."(`aid`, `content`) VALUES ".implode(', ', $sql));
  27. }
  28. }
  29. }
  30. ?>