### Eclipse Workspace Patch 1.0
#P Drupal Contrib
Index: links/links_weblink.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/links/links_weblink.module,v
retrieving revision 1.14
diff -u -r1.14 links_weblink.module
--- links/links_weblink.module	22 Jun 2006 03:35:57 -0000	1.14
+++ links/links_weblink.module	13 Sep 2006 16:53:40 -0000
@@ -275,6 +275,13 @@
     '#description' => t('If enabled, the clickable link will be appended to the end of the content, when in full-page display mode.'),
   );
 
+  $form['link_settings']['links_weblink_block_top_count'] = array(
+    '#type' => 'select',
+    '#title' => t('How many links should we show in top weblinks block'),
+    '#default_value' => variable_get('links_weblink_block_top_count','10'),
+    '#options' => array(10=>10, 20=>20, 30=>30, 40=>40),
+  );
+
   $form['link_catalog'] = array(
     '#type' => 'fieldset',
     '#title' => t('Weblink catalog settings'),
@@ -507,7 +514,11 @@
 
 function links_weblink_block_list($type = 'top') {
   $orderby = ($type == 'new') ?  'n.created' : 'ln.clicks';
-  return node_title_list(db_query_range(db_rewrite_sql("SELECT n.nid, n.title, l.url, ln.clicks FROM {node} n INNER JOIN {links_node} ln on n.nid = ln.nid INNER JOIN {links} l ON ln.lid = l.lid WHERE n.type = 'weblink' AND ln.module='links_weblink' AND n.status = 1 AND n.moderate = 0 ORDER by $orderby DESC"),0, 10));
+  $howmany=10;
+  if ($type=='top') {
+    $howmany = variable_get('links_weblink_block_top_count','10');
+  }
+  return node_title_list(db_query_range(db_rewrite_sql("SELECT n.nid, n.title, l.url, ln.clicks FROM {node} n INNER JOIN {links_node} ln on n.nid = ln.nid INNER JOIN {links} l ON ln.lid = l.lid WHERE n.type = 'weblink' AND ln.module='links_weblink' AND n.status = 1 AND n.moderate = 0 ORDER by $orderby DESC"),0, $howmany));
 }
 
 /**
