- Timestamp:
- Jul 13, 2012, 12:09:19 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/UserCollections/include/UserCollection.class.php
r16658 r16688 17 17 18 18 $this->data = array( 19 ' col_id' => 0,19 'id' => 0, 20 20 'user_id' => $user['id'], 21 21 'name' => null, … … 53 53 $query = ' 54 54 SELECT 55 id, 55 56 user_id, 56 57 name, … … 69 70 if (pwg_db_num_rows($result)) 70 71 { 71 $this->data['col_id'] = $col_id;72 72 $this->data = array_merge( 73 73 $this->data, … … 87 87 SELECT image_id 88 88 FROM '.COLLECTION_IMAGES_TABLE.' 89 WHERE col_id = '.$this->data[' col_id'].'89 WHERE col_id = '.$this->data['id'].' 90 90 ;'; 91 91 $this->images = array_from_query($query, 'image_id'); … … 107 107 $this->data['active'] = $active; 108 108 $this->data['public'] = $public; 109 $this->data['public_id'] = 'uc'.hash('crc32', uniqid(serialize($this->data , true)));109 $this->data['public_id'] = 'uc'.hash('crc32', uniqid(serialize($this->data), true)); 110 110 111 111 $query = ' … … 128 128 ;'; 129 129 pwg_query($query); 130 $this->data[' col_id'] = pwg_db_insert_id();130 $this->data['id'] = pwg_db_insert_id(); 131 131 132 132 $date = pwg_query('SELECT FROM_UNIXTIME(NOW());'); … … 146 146 WHERE 147 147 user_id = '.$this->data['user_id'].' 148 AND id != '.$this->data[' col_id'].'148 AND id != '.$this->data['id'].' 149 149 ;'; 150 150 pwg_query($query); … … 165 165 { 166 166 $this->data[$name] = $value; 167 pwg_query('UPDATE '.COLLECTIONS_TABLE.' SET '.$name.' = "'.$value.'" WHERE id = '.$this->data[' col_id'].';');167 pwg_query('UPDATE '.COLLECTIONS_TABLE.' SET '.$name.' = "'.$value.'" WHERE id = '.$this->data['id'].';'); 168 168 } 169 169 … … 213 213 DELETE FROM '.COLLECTION_IMAGES_TABLE.' 214 214 WHERE 215 col_id = '.$this->data[' col_id'].'215 col_id = '.$this->data['id'].' 216 216 AND image_id IN('.implode(',', $image_ids).') 217 217 ;'; … … 237 237 238 238 array_push($this->images, $image_id); 239 array_push($inserts, array('col_id'=>$this->data[' col_id'], 'image_id'=>$image_id));239 array_push($inserts, array('col_id'=>$this->data['id'], 'image_id'=>$image_id)); 240 240 } 241 241 … … 275 275 $query = ' 276 276 DELETE FROM '.COLLECTION_IMAGES_TABLE.' 277 WHERE col_id = '.$this->data[' col_id'].'277 WHERE col_id = '.$this->data['id'].' 278 278 ;'; 279 279 pwg_query($query);
Note: See TracChangeset
for help on using the changeset viewer.