Index: modules/easylinks/easylinks.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/easylinks/easylinks.module,v
retrieving revision 1.10
diff -u -r1.10 easylinks.module
--- modules/easylinks/easylinks.module	30 Oct 2006 16:56:31 -0000	1.10
+++ modules/easylinks/easylinks.module	31 Oct 2006 06:25:50 -0000
@@ -97,6 +106,13 @@
     '#description' => t('If this option is set, suggested links on the view page, will open in new window.'),
   );
 
+  $form['easylinks_sort_alphabetically'] = array(
+    '#type' => 'checkbox',
+    '#title' => t('Sort links alphabetically'),
+    '#default_value' => variable_get('easylinks_sort_alphabetically', 0),
+    '#description' => t('If this option is set, suggested links on the view page and block, will be listed alphabetically.'),
+  );
+
   return $form; 
 }
 
@@ -116,7 +132,9 @@
  * Returns list of link statuses.
  */
 function easylinks_select($numrecs = "10",$whereclause = "lid != 0",$orderby = "l.lid") {
-
+  if(variable_get('easylinks_sort_alphabetically', 0)) {
+    $orderby = "l.sitename";
+  }
   $sql = "SELECT l.lid, l.state, l.uid, l.sugestdttm, l.url, l.sitename, l.sitedesc FROM {easylinks} l WHERE %s ORDER BY %s";
 
   $result = pager_query($sql, $numrecs, 0, NULL,$whereclause,$orderby);
\ No newline at end of file
