Changeset 25593 for trunk/admin
- Timestamp:
- Nov 19, 2013, 9:19:36 PM (11 years ago)
- Location:
- trunk/admin
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/admin/cat_modify.php
r25019 r25593 232 232 ), 233 233 234 'U_ADD_PHOTOS_ALBUM' => $base_url.'photos_add&album='.$category['id'], 234 235 'U_CHILDREN' => $cat_list_url.'&parent_id='.$category['id'], 235 236 'U_HELP' => get_root_url().'admin/popuphelp.php?page=cat_modify', -
trunk/admin/include/photos_add_direct_prepare.inc.php
r25018 r25593 162 162 $selected_category = array(); 163 163 164 $query = ' 164 if (isset($_GET['album'])) 165 { 166 // set the category from get url or ... 167 check_input_parameter('album', $_GET, false, PATTERN_ID); 168 169 // test if album really exists 170 $query = ' 171 SELECT id 172 FROM '.CATEGORIES_TABLE.' 173 WHERE id = '.$_GET['album'].' 174 ;'; 175 $result = pwg_query($query); 176 if (pwg_db_num_rows($result) == 1) 177 { 178 $selected_category = array($_GET['album']); 179 180 // lets put in the session to persist in case of upload method switch 181 $_SESSION['selected_category'] = $selected_category; 182 } 183 else 184 { 185 fatal_error('[Hacking attempt] the album id = "'.$_GET['album'].'" is not valid'); 186 } 187 } 188 else if (isset($_SESSION['selected_category'])) 189 { 190 $selected_category = $_SESSION['selected_category']; 191 } 192 else 193 { 194 // we need to know the category in which the last photo was added 195 $query = ' 165 196 SELECT category_id 166 197 FROM '.IMAGES_TABLE.' AS i … … 169 200 ORDER BY i.id DESC 170 201 LIMIT 1 171 ;'; 172 $result = pwg_query($query); 173 if (pwg_db_num_rows($result) > 0) 174 { 175 $row = pwg_db_fetch_assoc($result); 176 177 $selected_category = array($row['category_id']); 202 ; 203 '; 204 $result = pwg_query($query); 205 if (pwg_db_num_rows($result) > 0) 206 { 207 $row = pwg_db_fetch_assoc($result); 208 $selected_category = array($row['category_id']); 209 } 178 210 } 179 211 -
trunk/admin/themes/default/template/cat_modify.tpl
r23425 r25593 38 38 <li><a href="{$U_MANAGE_ELEMENTS}">{'manage album photos'|@translate}</a></li> 39 39 {/if} 40 41 <li style="text-transform:lowercase;"><a href="{$U_ADD_PHOTOS_ALBUM}">{'Add Photos'|translate}</a></li> 40 42 41 43 <li><a href="{$U_CHILDREN}">{'manage sub-albums'|@translate}</a></li>
Note: See TracChangeset
for help on using the changeset viewer.