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.

Sort styles in ACP

Postby RMcGirr83 » 02 Jan 2011, 15:04

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.
Image
User avatar
RMcGirr83
MOD Team Leader
MOD Team Leader
 
Posts: 432
Joined: 30 Nov 2006, 14:23
Real name: Rich McGirr

Re: Sort styles in ACP

Postby tabscorbet » 27 Jul 2012, 02:42

thanks for this one.:)
tabscorbet
New member
New member
 
Posts: 2
Joined: 27 Jul 2012, 02:31


Return to Code snippets

Who is online

Users browsing this forum: No registered users and 1 guest

cron