--- url.module.old	2009-05-06 19:44:34.000000000 +1000
+++ url.module	2009-05-06 21:44:10.000000000 +1000
@@ -126,6 +126,7 @@
           'total' => $max,
         );
         $action['total'] = 99;
+	return $action;
       }
     }
 
@@ -180,3 +181,70 @@
   return $urls;
 }
 
+function url_menu() {
+  $items = array();
+
+  $items['admin/settings/spam/filters/url'] = array(
+    'title' => 'URL',
+    'page callback' => 'drupal_get_form',
+    'page arguments' => array('url_admin_settings'),
+    'access arguments' => array('administer spam'),
+    'description' => 'Configure the url filter.',
+    'type' => MENU_LOCAL_TASK,
+  );
+
+  return $items;
+}
+
+function url_admin_settings() {
+  $form = array();
+  $form['short'] = array(
+    '#type' => 'fieldset',
+    '#title' => 'URL limits',
+    '#collapsible' => TRUE,
+    '#collapsed' => FALSE,
+  );
+  $max_urls = drupal_map_assoc(array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 15, 20, 25, 40, 100));
+  $max_dups = drupal_map_assoc(array(0, 1, 2, 3, 4, 5, 10, 15, 20, 25, 40, 100));
+  $form['short']['url_limit_total'] = array(
+    '#type' => 'select',
+    '#title' => t('Maximum total URLs per post'),
+    '#options' => $max_urls,
+    '#required' => TRUE,
+    '#default_value' => variable_get('url_limit_total', 10),
+  );
+  $form['short']['url_limit_repeat'] = array(
+    '#type' => 'select',
+    '#title' => t('Maximum number of times the same URL can appear in a post'),
+    '#options' => $max_dups,
+    '#required' => TRUE,
+    '#default_value' => variable_get('url_limit_repeat', 5),
+  );
+  return system_settings_form($form);
+}
+
+function url_admin_settings_validate($form, &$form_state) {
+  $limit_long = $form_state['values']['url_limit_total'];
+  $limit_short = $form_state['values']['url_limit_repeat'];
+  if ($limit_short > $limit_long) {
+    form_set_error('node_age_limit_long', t('Total URL limit must be at least as big as the repeated URL limit.'));
+  }
+}
+function url_admin_settings_submit($form, &$form_state) {
+/* TODO The 'op' element in the form values is deprecated.
+   Each button can have #validate and #submit functions associated with it.
+   Thus, there should be one button that submits the form and which invokes
+   the normal form_id_validate and form_id_submit handlers. Any additional
+   buttons which need to invoke different validate or submit functionality
+   should have button-specific functions. */
+  if ($form_state['values']['op'] == t('Reset to defaults')) {
+    variable_del('url_limit_total');
+    variable_del('url_limit_repeat');
+    drupal_set_message('Configuration reset to defaults.');
+  }
+  else {
+    variable_set('url_limit_total', $form_state['values']['url_limit_total']);
+    variable_set('url_limit_repeat', $form_state['values']['url_limit_repeat']);
+    drupal_set_message('Configuration saved.');
+  }
+}
\ No newline at end of file
