table_forum_collectionrelated.php 979 B

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_collectionrelated.php 27449 2012-02-01 05:32:35Z zhangguosheng $
  7. */
  8. if(!defined('IN_DISCUZ')) {
  9. exit('Access Denied');
  10. }
  11. class table_forum_collectionrelated extends discuz_table
  12. {
  13. public function __construct() {
  14. $this->_table = 'forum_collectionrelated';
  15. $this->_pk = 'tid';
  16. $this->_pre_cache_key = 'forum_collectionrelated_';
  17. parent::__construct();
  18. }
  19. public function update_collection_by_ctid_tid($ctid, $tid, $replace = false) {
  20. if($replace === false) {
  21. $ctid .= "\t";
  22. $collection = 'CONCAT(collection, %s)';
  23. } else {
  24. $collection = '%s';
  25. }
  26. $result = DB::query('UPDATE %t SET collection='.$collection.' WHERE tid=%d', array($this->_table, $ctid, $tid));
  27. if($this->_allowmem) {
  28. $this->clear_cache($tid);
  29. $this->clear_cache($tid, 'forum_collection_tid_');
  30. }
  31. return $result;
  32. }
  33. }
  34. ?>