예제 #1
0
 public function update_by_pluginvarid($pluginid, $pluginvarid, $data)
 {
     if (!$pluginid || !$pluginvarid || !$data || !is_array($data)) {
         return;
     }
     XDB::update($this->_table, $data, XDB::field('pluginid', $pluginid) . ' AND ' . XDB::field('pluginvarid', $pluginvarid));
 }
 public function update_by_threadtableid($threadtableid, $data, $unbuffered = false, $low_priority = false)
 {
     if (empty($data)) {
         return false;
     }
     return XDB::update($this->_table, $data, XDB::field('threadtableid', $threadtableid), $unbuffered, $low_priority);
 }
예제 #3
0
 public function update($tableid, $val, $data)
 {
     if (!$data) {
         return;
     }
     return XDB::update($this->_get_table($tableid), $data, XDB::field($this->_pk, $val));
 }
예제 #4
0
 public function update_by_tid_action($tids, $action, $data)
 {
     $tids = dintval($tids, true);
     if (!empty($data) && is_array($data) && $tids) {
         return XDB::update($this->_table, $data, XDB::field('tid', $tids) . ' AND ' . XDB::field('action', $action));
     }
     return 0;
 }
예제 #5
0
 public function update($val, $data, $unbuffered = false, $low_priority = false)
 {
     if (isset($val) && !empty($data) && is_array($data)) {
         $this->checkpk();
         $ret = XDB::update($this->_table, $data, XDB::field($this->_pk, $val), $unbuffered, $low_priority);
         foreach ((array) $val as $id) {
             $this->update_cache($id, $data);
         }
         return $ret;
     }
     return !$unbuffered ? 0 : false;
 }
예제 #6
0
 public function srupdate($val, $data, $condition = '', $unbuffered = false, $low_priority = false)
 {
     if (isset($val) && !empty($data) && is_array($data)) {
         $this->checkpk();
         $where = '';
         if (empty($condition)) {
             $where = XDB::field($this->_pk, $val);
         } elseif (is_array($condition)) {
             $where = XDB::field($this->_pk, $val) . ' AND ' . self::implode($condition, ' AND ');
         } else {
             $where = XDB::field($this->_pk, $val) . ' AND ' . $condition;
         }
         $ret = XDB::update($this->_table, $data, $where, $unbuffered, $low_priority);
         foreach ((array) $val as $id) {
             $this->update_cache($id, $data);
         }
         return $ret;
     }
     return !$unbuffered ? 0 : false;
 }
예제 #7
0
 public function update_archive($fids)
 {
     return XDB::update('forum_forum', array('archive' => '0'), "fid NOT IN (" . dimplode($fids) . ")");
 }
 function fixalbum($bid, $data)
 {
     if (!is_array($data) || empty($data)) {
         return null;
     }
     $condition = array();
     $bid = dintval($bid, true);
     $condition[] = XDB::field('bid', $bid);
     return XDB::update($this->_table, $data, implode(' AND ', $condition));
 }
 public function update_by_bid($bid, $data)
 {
     return XDB::update($this->_table, $data, XDB::field('bid', $bid));
 }
 public function update_by_groupid($groupid, $data)
 {
     return XDB::update($this->_table, $data, XDB::field('groupid', $groupid));
 }
예제 #11
0
 public function update_by_closed($tids, $data, $tableid = 0)
 {
     $tids = dintval($tids, true);
     if (!empty($data) && is_array($data)) {
         $num = XDB::update($this->get_table_name($tableid), $data, XDB::field('closed', $tids), true);
         if ($num) {
             foreach ((array) $tids as $tid) {
                 $this->update_cache($tid, $data, $this->_cache_ttl);
             }
         }
         return $num;
     }
     return 0;
 }
예제 #12
0
 public function update_fid_by_fid($tableid, $fid, $newfid, $unbuffered = false, $low_priority = false)
 {
     $where = array();
     $where[] = XDB::field('fid', $fid);
     $return = XDB::update(self::get_tablename($tableid), array('fid' => $newfid), implode(' AND ', $where), $unbuffered, $low_priority);
     if ($return && $this->_allowmem) {
         $updatefid = $this->fetch_cache('updatefid');
         $updatefid[$fid] = array('fid' => $newfid, 'dateline' => TIMESTAMP);
         $this->store_cache('updatefid', $updatefid);
     }
     return $return;
 }
 public function fix_update_block($hash, $data)
 {
     return XDB::update($this->_blockstyletable, $data, XDB::field('hash', $hash));
 }