Changeset 23813 for trunk/admin


Ignore:
Timestamp:
Jul 6, 2013, 8:31:14 PM (11 years ago)
Author:
mistic100
Message:

bug 2931: revert r23675 & r23721, make element_set_ranks.php uses ASC keyword (+ migration task)

Location:
trunk/admin
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/admin/configuration.php

    r23675 r23813  
    113113$sort_fields = array(
    114114  ''                    => '',
    115   'file'                => l10n('File name, A → Z'),
     115  'file ASC'            => l10n('File name, A → Z'),
    116116  'file DESC'           => l10n('File name, Z → A'),
    117   'name'                => l10n('Photo title, A → Z'),
     117  'name ASC'            => l10n('Photo title, A → Z'),
    118118  'name DESC'           => l10n('Photo title, Z → A'),
    119119  'date_creation DESC'  => l10n('Date created, new → old'),
    120   'date_creation'       => l10n('Date created, old → new'),
     120  'date_creation ASC'   => l10n('Date created, old → new'),
    121121  'date_available DESC' => l10n('Date posted, new → old'),
    122   'date_available'      => l10n('Date posted, old → new'),
     122  'date_available ASC'  => l10n('Date posted, old → new'),
    123123  'rating_score DESC'   => l10n('Rating score, high → low'),
    124   'rating_score'        => l10n('Rating score, low → high'),
     124  'rating_score ASC'    => l10n('Rating score, low → high'),
    125125  'hit DESC'            => l10n('Visits, high → low'),
    126   'hit'                 => l10n('Visits, low → high'),
    127   'id'                  => l10n('Numeric identifier, 1 → 9'),
     126  'hit ASC'             => l10n('Visits, low → high'),
     127  'id ASC'              => l10n('Numeric identifier, 1 → 9'),
    128128  'id DESC'             => l10n('Numeric identifier, 9 → 1'),
    129   'rank'                => l10n('Manual sort order'),
     129  'rank ASC'            => l10n('Manual sort order'),
    130130  );
    131131
     
    163163
    164164            // there is no rank outside categories
    165             if ( ($i = array_search('rank', $order_by)) !== false)
     165            if ( ($i = array_search('rank ASC', $order_by)) !== false)
    166166            {
    167167              unset($order_by[$i]);
     
    171171            if ( count($order_by) == 0 )
    172172            {
    173               $order_by = array('id');
     173              $order_by = array('id ASC');
    174174            }
    175175
    176             $_POST['order_by'] = 'ORDER BY '.implode(',', $order_by);
    177             $_POST['order_by_inside_category'] = 'ORDER BY '.implode(',', $order_by_inside_category);
     176            $_POST['order_by'] = 'ORDER BY '.implode(', ', $order_by);
     177            $_POST['order_by_inside_category'] = 'ORDER BY '.implode(', ', $order_by_inside_category);
    178178          }
    179179        }
     
    335335    else
    336336    {
     337      $out = array();
    337338      $order_by = trim($conf['order_by_inside_category']);
    338339      $order_by = str_replace('ORDER BY ', null, $order_by);
    339       $order_by = explode(',', $order_by);
    340       foreach($order_by as &$order)
    341       {
    342         $order = trim($order);
    343         if (substr_compare($order, ' ASC', -4)==0)
    344         {
    345           $order = substr($order, 0, -4);
    346         }
    347       }
    348       unset($order);
     340      $order_by = explode(', ', $order_by);
    349341    }
    350342
  • trunk/admin/element_set_ranks.php

    r19703 r23813  
    125125  elseif ($image_order_choice=='rank')
    126126  {
    127     $image_order = 'rank';
     127    $image_order = 'rank ASC';
    128128  }
    129129  $query = '
     
    238238$sort_fields = array(
    239239  ''                    => '',
    240   'file'                => l10n('File name, A → Z'),
     240  'file ASC'            => l10n('File name, A → Z'),
    241241  'file DESC'           => l10n('File name, Z → A'),
    242   'name'                => l10n('Photo title, A → Z'),
     242  'name ASC'            => l10n('Photo title, A → Z'),
    243243  'name DESC'           => l10n('Photo title, Z → A'),
    244244  'date_creation DESC'  => l10n('Date created, new → old'),
    245   'date_creation'       => l10n('Date created, old → new'),
     245  'date_creation ASC'   => l10n('Date created, old → new'),
    246246  'date_available DESC' => l10n('Date posted, new → old'),
    247   'date_available'      => l10n('Date posted, old → new'),
     247  'date_available ASC'  => l10n('Date posted, old → new'),
    248248  'rating_score DESC'   => l10n('Rating score, high → low'),
    249   'rating_score'        => l10n('Rating score, low → high'),
     249  'rating_score ASC'    => l10n('Rating score, low → high'),
    250250  'hit DESC'            => l10n('Visits, high → low'),
    251   'hit'                 => l10n('Visits, low → high'),
    252   'id'                  => l10n('Numeric identifier, 1 → 9'),
     251  'hit ASC'             => l10n('Visits, low → high'),
     252  'id ASC'              => l10n('Numeric identifier, 1 → 9'),
    253253  'id DESC'             => l10n('Numeric identifier, 9 → 1'),
    254   'rank'                => l10n('Manual sort order'),
     254  'rank ASC'            => l10n('Manual sort order'),
    255255  );
    256256
Note: See TracChangeset for help on using the changeset viewer.