Page 1 of 1

Arrange Category Alphabetically [SOLVED]

Posted: Wed Jan 16, 2008 6:14 am
by doswald
hi mate, here me again. just wanna ask (still im using v1.2.0), when i add new category it goes at the bottom of the page. are there any ways that we can arrange them alphabetically for a neat/clean quiz area?

thanks for the time.

regards

Re: Arrange Category Alphabetically

Posted: Wed Jan 16, 2008 12:18 pm
by battye
I think this is right:

in quiz.php


find

Code: Select all

      if( !$userdata['session_logged_in'] )
      {
         $sql_suffix = "WHERE category_permissions = 0 OR category_permissions = 1";
      }
      
      else
      {
         $sql_suffix = '';
      }
   
   $sql = "SELECT * FROM " . QUIZ_CATEGORY_TABLE . " $sql_suffix";
REPLACE WITH

Code: Select all

      if( !$userdata['session_logged_in'] )
      {
         $sql_suffix = "WHERE category_permissions = 0 OR category_permissions = 1";
      }
      
      else
      {
         $sql_suffix = '';
      }
   
   $sql = "SELECT * FROM " . QUIZ_CATEGORY_TABLE . " $sql_suffix  ORDER BY category_name ASC";

Re: Arrange Category Alphabetically

Posted: Thu Jan 17, 2008 2:13 am
by doswald
you're the man mate! thanks for being there!

Re: Arrange Category Alphabetically [SOLVED]

Posted: Thu Jan 17, 2008 2:31 am
by battye
I'm glad I've been able to figure out at least one of your questions! :)