table_forum_newthread.php 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  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_forum_groupuser.php 31121 2012-07-18 06:01:56Z liulanbo $
  7. */
  8. if(!defined('IN_DISCUZ')) {
  9. exit('Access Denied');
  10. }
  11. class table_forum_newthread extends discuz_table
  12. {
  13. public function __construct() {
  14. $this->_table = 'forum_newthread';
  15. $this->_pk = '';
  16. parent::__construct();
  17. }
  18. public function fetch_all_by_fids($fids, $start = 0, $limit = 20) {
  19. if(empty($fids)) {
  20. return array();
  21. }
  22. return DB::fetch_all("SELECT * FROM %t WHERE %i ORDER BY dateline DESC %i", array($this->_table, DB::field('fid', $fids), DB::limit($start, $limit)), 'tid');
  23. }
  24. public function delete_by_fids($fids) {
  25. return DB::delete($this->_table, DB::field('fid', $fids));
  26. }
  27. public function delete_by_tids($tids) {
  28. return DB::delete($this->_table, DB::field('tid', $tids));
  29. }
  30. public function delete_by_dateline($timestamp) {
  31. return DB::delete($this->_table, DB::field('dateline', $timestamp, '<'));
  32. }
  33. }
  34. ?>