Sort styles in ACP

A perfect place for code snippets to small to be a MOD or a library.
Or for examples on how to use our libraries.
Post Reply
User avatar
RMcGirr83
Supporter
Supporter
Posts: 6242
Joined: 30 Nov 2006, 14:23
Real name: Rich McGirr

Sort styles in ACP

Post by RMcGirr83 »

Currently, the styles aren't sorted in the ACP. They show up on a "first come, first served" basis. So let's fix that

OPEN

includes/acp/acp_styles.php

FIND

Code: Select all

         case 'style':
            $sql_from = STYLES_TABLE;


AFTER, ADD

Code: Select all

            $sql_order_by = ' ORDER BY LOWER(style_name)';


FIND

Code: Select all

         case 'template':
            $sql_from = STYLES_TEMPLATE_TABLE;


AFTER ADD

Code: Select all

            $sql_order_by = ' ORDER BY LOWER(template_name)';


FIND

Code: Select all

         case 'theme':
            $sql_from = STYLES_THEME_TABLE;


AFTER ADD

Code: Select all

            $sql_order_by = ' ORDER BY LOWER(theme_name)';


FIND

Code: Select all

         case 'imageset':
            $sql_from = STYLES_IMAGESET_TABLE;


AFTER ADD

Code: Select all

            $sql_order_by = ' ORDER BY LOWER(imageset_name)';


FIND

Code: Select all

      $sql = "SELECT *
         FROM $sql_from";


REPLACE WITH

Code: Select all

      $sql = "SELECT *
         FROM $sql_from
         $sql_order_by";


then the styles, template, theme, and imageset tabs will display the styles in alphabetic order and in the same way.
tabscorbet
New member
New member
Posts: 2
Joined: 27 Jul 2012, 02:31

Re: Sort styles in ACP

Post by tabscorbet »

thanks for this one.:)
Post Reply