Changeset 5743
- Timestamp:
- Apr 9, 2010, 9:47:29 PM (15 years ago)
- Location:
- trunk/admin
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/admin/photos_add_direct.php
r5742 r5743 380 380 } 381 381 382 // categories 383 // 384 // we need to know the category in which the last photo was added 385 $selected_category = array(); 386 $selected_parent = array(); 387 388 $query = ' 389 SELECT 390 category_id, 391 id_uppercat 392 FROM '.IMAGES_TABLE.' AS i 393 JOIN '.IMAGE_CATEGORY_TABLE.' AS ic ON image_id = i.id 394 JOIN '.CATEGORIES_TABLE.' AS c ON category_id = c.id 395 ORDER BY i.id DESC 396 LIMIT 1 397 ;'; 398 $result = pwg_query($query); 399 if (pwg_db_num_rows($result) > 0) 400 { 401 $row = pwg_db_fetch_assoc($result); 402 403 $selected_category = array($row['category_id']); 404 405 if (!empty($row['id_uppercat'])) 406 { 407 $selected_parent = array($row['id_uppercat']); 408 } 409 } 410 411 // existing category 382 412 $query = ' 383 413 SELECT id,name,uppercats,global_rank … … 387 417 display_select_cat_wrapper( 388 418 $query, 389 array(),419 $selected_category, 390 420 'category_options' 391 421 ); 422 423 // new category 424 display_select_cat_wrapper( 425 $query, 426 $selected_parent, 427 'category_parent_options' 428 ); 429 392 430 393 431 // image level options -
trunk/admin/themes/default/template/photos_add_direct.tpl
r5742 r5743 173 173 <div id="category_type_existing" style="display:none" class="category_selection"> 174 174 <select class="categoryDropDown" name="category"> 175 {html_options options=$category_options }175 {html_options options=$category_options selected=$category_options_selected} 176 176 </select> 177 177 </div> … … 184 184 <select class="categoryDropDown" name="category_parent"> 185 185 <option value="0">------------</option> 186 {html_options options=$category_ options}186 {html_options options=$category_parent_options selected=$category_parent_options_selected} 187 187 </select> 188 188 </td>
Note: See TracChangeset
for help on using the changeset viewer.