Ignore:
Timestamp:
Feb 14, 2007, 11:53:02 PM (17 years ago)
Author:
plg
Message:

New: history logs high quality access via action.php. A new column
#history.is_high was added. Filter was added on administration history
detail view.

Modification: function get_sql_condition_FandF was slightly refactored for
presentation improvement.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/functions_user.inc.php

    r1763 r1817  
    10901090
    10911091/*
    1092  * Compute sql where condition with restrict and filter data
    1093  *
    1094  * FandF: Forbidden and Filters
    1095  *
    1096  * @param $condition_fields array:
    1097  *            keys are condition to aply and
    1098  *            values are sql field to use
    1099  *            array('forbidden_categories' => 'ic.category_id')
    1100  *        $prefix_condition string:
    1101  *            this value are concatenated if sql is not empty
    1102  *        $force_one_condition:
    1103  *            if there are not condition , use this condition "1 = 1"
     1092 * Compute sql where condition with restrict and filter data. "FandF" means
     1093 * Forbidden and Filters.
     1094 *
     1095 * @param array condition_fields: read function body
     1096 * @param string prefix_condition: prefixes sql if condition is not empty
     1097 * @param boolean force_one_condition: use at least "1 = 1"
    11041098 *
    11051099 * @return string sql where/conditions
    11061100 */
    1107 function get_sql_condition_FandF($condition_fields, $prefix_condition = null, $force_one_condition = false)
     1101function get_sql_condition_FandF(
     1102  $condition_fields,
     1103  $prefix_condition = null,
     1104  $force_one_condition = false
     1105  )
    11081106{
    11091107  global $user, $filter;
     
    11161114    {
    11171115      case 'forbidden_categories':
     1116      {
    11181117        if (!empty($user['forbidden_categories']))
    11191118        {
    1120           $sql_list[] = $field_name.' NOT IN ('.$user['forbidden_categories'].')';
     1119          $sql_list[] =
     1120            $field_name.' NOT IN ('.$user['forbidden_categories'].')';
    11211121        }
    11221122        break;
    1123 
     1123      }
    11241124      case 'visible_categories':
     1125      {
    11251126        if (!empty($filter['visible_categories']))
    11261127        {
    1127           $sql_list[] = $field_name.' IN ('.$filter['visible_categories'].')';
     1128          $sql_list[] =
     1129            $field_name.' IN ('.$filter['visible_categories'].')';
    11281130        }
    11291131        break;
    1130 
     1132      }
    11311133      case 'visible_images':
     1134      {
    11321135        if (!empty($filter['visible_images']))
    11331136        {
    1134           $sql_list[] = $field_name.' IN ('.$filter['visible_images'].')';
     1137          $sql_list[] =
     1138            $field_name.' IN ('.$filter['visible_images'].')';
    11351139        }
    11361140        break;
    1137 
     1141      }
    11381142      default:
     1143      {
    11391144        die('Unknow condition');
    11401145        break;
    1141 
     1146      }
    11421147    }
    11431148  }
Note: See TracChangeset for help on using the changeset viewer.