Changeset 16688 for extensions/UserCollections/include/collections.inc.php
- Timestamp:
- Jul 13, 2012, 12:09:19 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/UserCollections/include/collections.inc.php
r16658 r16688 24 24 case 'new': 25 25 { 26 new UserCollection('new', array(), empty($_GET['name']) ? 'temp' : $_GET['name'], 1); 27 redirect(USER_COLLEC_PUBLIC); 28 break; 29 } 30 31 // clear 32 case 'clear': 33 { 34 $query = ' 35 DELETE ci 36 FROM '.COLLECTION_IMAGES_TABLE.' AS ci 37 INNER JOIN '.COLLECTIONS_TABLE.' AS c 38 ON ci.col_id = c.id 39 WHERE 40 c.user_id = '.$user['id'].' 41 AND c.id = '.$_GET['col_id'].' 42 ;'; 43 pwg_query($query); 26 $UserCollection = new UserCollection('new', array(), empty($_GET['name']) ? 'temp' : $_GET['name'], 1); 44 27 45 if ( !empty($_SERVER['HTTP_REFERER']))28 if (isset($_GET['redirect'])) 46 29 { 47 redirect($_SERVER['HTTP_REFERER']);30 $redirect = USER_COLLEC_PUBLIC.'edit/'.$UserCollection->getParam('id'); 48 31 } 32 else 33 { 34 $redirect = USER_COLLEC_PUBLIC; 35 } 36 redirect($redirect); 49 37 break; 50 38 } … … 194 182 } 195 183 184 // clear 185 if ( isset($_GET['action']) and $_GET['action'] == 'clear' ) 186 { 187 $UserCollection->clearImages(); 188 } 189 196 190 // remove an element 197 191 if ( isset($_GET['collection_toggle']) and preg_match('#^[0-9]+$#', $_GET['collection_toggle']) ) 198 192 { 199 193 $UserCollection->removeImages(array($_GET['collection_toggle'])); 194 unset($_GET['collection_toggle']); 200 195 } 201 196 … … 205 200 206 201 // collection content 207 $template->assign('collection', $UserCollection->getCollectionInfo()); 202 $col = $UserCollection->getCollectionInfo(); 203 $col['U_CLEAR'] = $self_url.'&action=clear'; 204 $col['U_DELETE'] = USER_COLLEC_PUBLIC.'&action=delete&col_id='.$page['col_id']; 205 $template->assign('collection', $col); 206 208 207 $page['items'] = $UserCollection->getImages(); 209 208 … … 252 251 $UserCollection = new UserCollection($page['col_id']); 253 252 254 // backlink for owner255 if ($UserCollection->getParam('user_id') == $user['id'])256 {257 $template->assign('U_LIST', USER_COLLEC_PUBLIC);258 }259 260 253 // special template 261 254 add_event_handler('loc_end_index_thumbnails', 'user_collections_thumbnails_in_collection', EVENT_HANDLER_PRIORITY_NEUTRAL+10, 2); // +10 to overload GThumb+ 262 255 263 256 // collection content 264 $template->assign('collection', $UserCollection->getCollectionInfo());265 257 $page['items'] = $UserCollection->getImages(); 266 258
Note: See TracChangeset
for help on using the changeset viewer.