table_forum_rsscache.php 999 B

1234567891011121314151617181920212223242526272829303132333435363738
  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_rsscache.php 27775 2012-02-14 06:58:02Z zhangguosheng $
  7. */
  8. if(!defined('IN_DISCUZ')) {
  9. exit('Access Denied');
  10. }
  11. class table_forum_rsscache extends discuz_table
  12. {
  13. public function __construct() {
  14. $this->_table = 'forum_rsscache';
  15. $this->_pk = 'tid';
  16. parent::__construct();
  17. }
  18. public function fetch_all_by_fid($fid, $limit = 20) {
  19. return $fid ? DB::fetch_all('SELECT * FROM '.DB::table($this->_table).' WHERE '.DB::field('fid', $fid).' ORDER BY dateline DESC LIMIT '.$limit, null, 'tid') : array();
  20. }
  21. public function fetch_all_by_guidetype($type, $limit = 20) {
  22. return DB::fetch_all('SELECT * FROM %t WHERE guidetype=%s ORDER BY dateline DESC LIMIT %d', array($this->_table, $type, $limit));
  23. }
  24. public function delete_by_guidetype($type){
  25. DB::query('DELETE FROM %t WHERE guidetype=%s', array($this->_table, $type));
  26. }
  27. }
  28. ?>