table_common_member_profile_setting.php 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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_common_member_profile_setting.php 27449 2012-02-01 05:32:35Z zhangguosheng $
  7. */
  8. if(!defined('IN_DISCUZ')) {
  9. exit('Access Denied');
  10. }
  11. class table_common_member_profile_setting extends discuz_table
  12. {
  13. public function __construct() {
  14. $this->_table = 'common_member_profile_setting';
  15. $this->_pk = 'fieldid';
  16. parent::__construct();
  17. }
  18. public function range($start = 0, $limit = 0) {
  19. return DB::fetch_all('SELECT * FROM '.DB::table($this->_table).' ORDER BY available DESC, displayorder'.DB::limit($start, $limit), null, $this->_pk);
  20. }
  21. public function fetch_all_by_available_unchangeable($available, $unchangeable) {
  22. return DB::fetch_all('SELECT * FROM %t WHERE available=%d AND unchangeable=%d ORDER BY displayorder', array($this->_table, $available, $unchangeable), $this->_pk);
  23. }
  24. public function fetch_all_by_available($available) {
  25. return DB::fetch_all('SELECT * FROM %t WHERE available=%d ORDER BY displayorder', array($this->_table, $available), $this->_pk);
  26. }
  27. public function fetch_all_by_available_formtype($available, $formtype) {
  28. return DB::fetch_all('SELECT * FROM %t WHERE available=%d AND formtype=%s', array($this->_table, $available, $formtype), $this->_pk);
  29. }
  30. public function fetch_all_by_available_required($available, $required) {
  31. return DB::fetch_all('SELECT * FROM %t WHERE available=%d AND required=%d', array($this->_table, $available, $required), $this->_pk);
  32. }
  33. public function fetch_all_by_available_showinregister($available, $showinregister) {
  34. return DB::fetch_all('SELECT * FROM %t WHERE available=%d AND showinregister=%d', array($this->_table, $available, $showinregister), $this->_pk);
  35. }
  36. public function fetch_all_by_available_showinthread($available, $showinthread) {
  37. return DB::fetch_all('SELECT * FROM %t WHERE available=%d AND showinthread=%d', array($this->_table, $available, $showinthread), $this->_pk);
  38. }
  39. public function clear_showinthread() {
  40. DB::update($this->_table, array('showinthread' => 0));
  41. }
  42. }
  43. ?>