table_forum_onlinelist.php 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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_onlinelist.php 27876 2012-02-16 04:28:02Z zhengqingpeng $
  7. */
  8. if(!defined('IN_DISCUZ')) {
  9. exit('Access Denied');
  10. }
  11. class table_forum_onlinelist extends discuz_table
  12. {
  13. public function __construct() {
  14. $this->_table = 'forum_onlinelist';
  15. $this->_pk = '';
  16. parent::__construct();
  17. }
  18. public function fetch_all_order_by_displayorder() {
  19. return DB::fetch_all('SELECT * FROM %t ORDER BY displayorder', array($this->_table));
  20. }
  21. public function delete_all() {
  22. DB::query('DELETE FROM %t', array($this->_table));
  23. }
  24. public function delete_by_groupid($groupid) {
  25. $groupid = is_array($groupid) ? array_map('intval', (array)$groupid) : dintval($groupid);
  26. if($groupid) {
  27. return DB::delete($this->_table, DB::field('groupid', $groupid));
  28. }
  29. return 0;
  30. }
  31. public function update_by_groupid($groupid, $data) {
  32. $groupid = is_array($groupid) ? array_map('intval', (array)$groupid) : dintval($groupid);
  33. if($groupid && $data && is_array($data)) {
  34. return DB::update($this->_table, $data, DB::field('groupid', $groupid));
  35. }
  36. return 0;
  37. }
  38. }
  39. ?>