Changeset 614 for trunk/search.php


Ignore:
Timestamp:
Nov 23, 2004, 11:31:24 PM (19 years ago)
Author:
plg
Message:
  • global categories' options : instead of N horizontal tabs on a single page, N options in the left menu (but the same backend)
  • categories.global_rank : new calculated field. It gives a global rank of the category among all others (updated during ordering)
  • category.php page : menu is generated faster thanks to categories.global_rank, recursivity becomes useless :-)
  • new function to display select box with a set of categories : display_select_cat_wrapper
  • cat_options : instead of using 1 multiselect for true/false items, using 1 multiselect for true, and another one for false. The form provides buttons with arrows to switch categories from one multiselect to another
  • deletion of obsolete function display_categories (working with the old template system)
  • deletion of obsolete functions get_user_plain_structure, create_user_structure, get_user_subcat_ids, update_structure, count_images : useless thanks to global_rank
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/search.php

    r607 r614  
    339339}
    340340//------------------------------------------------------------- categories form
    341 // this is a trick : normally, get_user_plain_structure is used to create
    342 // the categories structure for menu (in category.php) display, but here, we
    343 // want all categories to be shown...
    344 $user['expand'] = true;
    345 $structure = create_user_structure('');
    346 
     341$query = '
     342SELECT name,id,date_last,nb_images,global_rank,uppercats
     343  FROM '.CATEGORIES_TABLE;
     344  if ($user['forbidden_categories'] != '')
     345  {
     346    $query.= '
     347  WHERE id NOT IN ('.$user['forbidden_categories'].')';
     348  }
     349$query.= '
     350;';
    347351$selecteds = array();
    348352if (isset($_POST['submit']))
     
    350354  $selecteds = $_POST['cat'];
    351355}
    352 display_select_categories($structure,
    353                           ' ',
    354                           $selecteds,
    355                           'category_option',
    356                           array());
     356display_select_cat_wrapper($query, $selecteds, 'category_option', false);
    357357
    358358$categories_selected = '';
Note: See TracChangeset for help on using the changeset viewer.