Ignore:
Timestamp:
Jul 6, 2008, 12:13:28 AM (16 years ago)
Author:
rvelices
Message:
  • feature 832: Folders with no images sql optimization
  • recent pics are sorted by date descending, and only then by conforder_by
  • updated prototype.js to version 1.6
File:
1 edited

Legend:

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

    r2327 r2424  
    236236      { // get all allowed sub-categories
    237237        $query = '
    238 SELECT id 
     238SELECT id
    239239  FROM '.CATEGORIES_TABLE.'
    240   WHERE 
     240  WHERE
    241241    uppercats LIKE "'.$page['category']['uppercats'].',%" '
    242242    .get_sql_condition_FandF(
     
    395395  else if ($page['section'] == 'recent_pics')
    396396  {
     397    if ( !isset($page['super_order_by']) )
     398    {
     399      $conf['order_by'] = str_replace(
     400        'ORDER BY ',
     401        'ORDER BY date_available DESC,',
     402        $conf['order_by']
     403        );
     404    }
     405
    397406    $query = '
    398407SELECT DISTINCT(id)
     
    524533  WHERE file LIKE "' . $page['image_file'] . '.%" ESCAPE "|"';
    525534    if ( count($page['items']) < 500)
    526     {// for very large item sets do not add IN - because slow 
     535    {// for very large item sets do not add IN - because slow
    527536      $query .= '
    528537  AND id IN ('.implode(',',$page['items']).')
     
    534543      case 0: break;
    535544      case 1:
    536         list($page['image_id'], $page['image_file']) = mysql_fetch_row($result); 
     545        list($page['image_id'], $page['image_file']) = mysql_fetch_row($result);
    537546        break;
    538547      default: // more than 1 file name match
Note: See TracChangeset for help on using the changeset viewer.