table_forum_sofa.php 855 B

1234567891011121314151617181920212223242526272829303132333435
  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_sofa.php 31637 2012-09-17 08:12:26Z chenmengshu $
  7. */
  8. if(!defined('IN_DISCUZ')) {
  9. exit('Access Denied');
  10. }
  11. class table_forum_sofa extends discuz_table
  12. {
  13. public function __construct() {
  14. $this->_table = 'forum_sofa';
  15. $this->_pk = 'tid';
  16. parent::__construct();
  17. }
  18. public function range($start = 0, $limit = 20) {
  19. return DB::fetch_all('SELECT * FROM %t ORDER BY tid DESC %i', array($this->_table, DB::limit($start, $limit)), $this->_pk);
  20. }
  21. public function fetch_all_by_fid($fid, $start = 0, $limit = 20) {
  22. $fid = dintval($fid, true);
  23. return DB::fetch_all('SELECT * FROM %t WHERE fid=%d ORDER BY tid DESC %i', array($this->_table, $fid, DB::limit($start, $limit)), $this->_pk);
  24. }
  25. }
  26. ?>