Ignore:
Timestamp:
Sep 17, 2008, 3:48:31 AM (16 years ago)
Author:
rvelices
Message:
  • fix status header (web services + IE6 min display)
  • sql optims in feed /notification
  • dont send cookie for 10 years from admin/history.php
File:
1 edited

Legend:

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

    r2335 r2543  
    3636 * @return string sql where
    3737 */
    38 function get_std_sql_where_restrict_filter($prefix_condition, $force_one_condition = false)
     38function get_std_sql_where_restrict_filter($prefix_condition, $img_field='ic.image_id', $force_one_condition = false)
    3939{
    4040  return get_sql_condition_FandF
     
    4444                'forbidden_categories' => 'ic.category_id',
    4545                'visible_categories' => 'ic.category_id',
    46                 'visible_images' => 'ic.image_id'
     46                'visible_images' => $img_field
    4747              ),
    4848            $prefix_condition,
     
    9090  WHERE date_available > \''.$start.'\'
    9191    AND date_available <= \''.$end.'\'
    92       '.get_std_sql_where_restrict_filter('AND').'
     92      '.get_std_sql_where_restrict_filter('AND', 'id').'
    9393;';
    9494      break;
     
    9898  WHERE date_available > \''.$start.'\'
    9999    AND date_available <= \''.$end.'\'
    100       '.get_std_sql_where_restrict_filter('AND').'
     100      '.get_std_sql_where_restrict_filter('AND', 'id').'
    101101;';
    102102      break;
     
    435435  global $conf, $user;
    436436
    437   $where_sql = get_std_sql_where_restrict_filter('WHERE', true);
     437  $where_sql = get_std_sql_where_restrict_filter('WHERE', 'i.id', true);
    438438
    439439  $query = '
     
    441441      COUNT(DISTINCT id) nb_elements,
    442442      COUNT(DISTINCT category_id) nb_cats
    443   FROM '.IMAGES_TABLE.' INNER JOIN '.IMAGE_CATEGORY_TABLE.' AS ic ON id=image_id
     443  FROM '.IMAGES_TABLE.' i INNER JOIN '.IMAGE_CATEGORY_TABLE.' AS ic ON id=image_id
    444444  '.$where_sql.'
    445445  GROUP BY date_available
     
    460460      $query = '
    461461SELECT DISTINCT id, path, name, tn_ext, file
    462   FROM '.IMAGES_TABLE.' INNER JOIN '.IMAGE_CATEGORY_TABLE.' AS ic ON id=image_id
     462  FROM '.IMAGES_TABLE.' i INNER JOIN '.IMAGE_CATEGORY_TABLE.' AS ic ON id=image_id
    463463  '.$where_sql.'
    464464    AND date_available="'.$dates[$i]['date_available'].'"
Note: See TracChangeset for help on using the changeset viewer.