Index: /trunk/user/view.php
===================================================================
--- /trunk/user/view.php (revision 9)
+++ /trunk/user/view.php (revision 125)
@@ -319,21 +319,21 @@
         print_row(get_string('aimid').':', '<a href="aim:goim?screenname='.s($user->aim).'">'.s($user->aim).'</a>');
     }
     if ($user->msn && !isset($hiddenfields['msnid'])) {
         print_row(get_string('msnid').':', s($user->msn));
     }
 
     /// Print the Custom User Fields
     profile_display_fields($user->id);
 
 
-    if ($mycourses = get_my_courses($user->id, null, null, false, 21)) {
+    if ($mycourses = get_my_courses($user->id, 'visible DESC,sortorder ASC', null, false, 21)) {
         $shown=0;
         $courselisting = '';
         foreach ($mycourses as $mycourse) {
             if ($mycourse->category) {
                 if ($mycourse->id != $course->id){
                     $class = '';
                     if ($mycourse->visible == 0) {
                         // get_my_courses will filter courses $USER cannot see
                         // if we get one with visible 0 it just means it's hidden
                         // ... but not from $USER
