Index: modules/ping/ping.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/ping/ping.module,v
retrieving revision 1.45
diff -u -r1.45 ping.module
--- modules/ping/ping.module	21 Nov 2006 20:14:18 -0000	1.45
+++ modules/ping/ping.module	1 Oct 2007 09:00:17 -0000
@@ -12,7 +12,7 @@
 function ping_help($section) {
   switch ($section) {
     case 'admin/help#ping':
-      $output = '<p>'. t('The ping module is useful for notifying interested sites that your site has changed. It automatically sends notifications (called "pings") to the <a href="@external-http-pingomatic-com">pingomatic</a> service to tell it that your site has changed. In turn pingomatic will ping other services such as weblogs.com, Technorati, blo.gs, BlogRolling, Feedster.com, Moreover, etc.', array('@external-http-pingomatic-com' => 'http://pingomatic.com/')) .'</p>';
+      $output = '<p>'. t('The ping module is useful for notifying interested sites that your site has changed. It automatically sends notifications (called "pings") to specified services. For example, the <a href="@external-http-pingomatic-com">pingomatic</a> service can be pinged to tell it that your site has changed. In turn pingomatic will ping other services such as weblogs.com, Technorati, blo.gs, BlogRolling, Feedster.com, Moreover, etc.', array('@external-http-pingomatic-com' => 'http://pingomatic.com/')) .'</p>';
       $output .= '<p>'. t('The ping module requires <code>cron</code> or a similar periodic job scheduler to be enabled.') .'</p>';
       $output .= '<p>'. t('For more information please read the configuration and customization handbook <a href="@ping">Ping page</a>.', array('@ping' => 'http://drupal.org/handbook/modules/ping/')) .'</p>';
       return $output;
@@ -35,6 +35,46 @@
 }
 
 /**
+ * Implemetaion of hook_menu
+ */
+function ping_menu($may_cache) {
+  $items = array();
+
+  if ($may_cache) {
+    $items[] = array(
+      'path' => 'admin/settings/ping',
+      'title' => t('Ping'),
+      'description' => t('Configure what services should be notified when the site is updated.'),
+      'callback' => 'drupal_get_form',
+      'callback arguments' => array('ping_admin_settings'),
+      'access' => user_access('administer site configuration'),
+      'type' => MENU_NORMAL_ITEM
+    );
+  }
+  
+  return $items;
+}
+
+function ping_admin_settings() {
+  $form['ping'] = array(
+    '#type' => 'fieldset',
+    '#title' => t('Ping settings'),
+    '#collapsible' => TRUE,
+    '#description' => t('Specify the services you would like to notify when your site has changed.'),
+  );
+  $form['ping']['ping_pinger_list'] = array(
+    '#type' => 'textarea',
+    '#title' => t('URLs to ping'),
+    '#default_value' => variable_get('ping_pinger_list', 'http://rpc.pingomatic.com'),
+    '#description' => t('Write each service url on a separate line. Example %url', array('%url' => 'http://rpc.pingomatic.com')),
+    '#width' => 40,
+    '#height' => 10,
+  );
+  
+  return system_settings_form($form);
+}
+
+/**
  * Call hook_ping() in all modules to notify remote sites that there is
  * new content at this one.
  */
@@ -49,10 +89,18 @@
  */
 function ping_ping($name = '', $url = '') {
 
-  $result = xmlrpc('http://rpc.pingomatic.com', 'weblogUpdates.ping', $name, $url);
+  $pingers = explode("\n", variable_get('ping_pinger_list', 'http://rpc.pingomatic.com'));
+  
+  foreach ($pingers as $pinger) {
+    $pinger = trim($pinger);
+    if (empty($pinger)) {
+      continue;
+    }
+    $result = xmlrpc(xmlrpc(check_url($pinger), 'weblogUpdates.ping', $name, $url));
 
-  if ($result === FALSE) {
-    watchdog('directory ping', t('Failed to notify pingomatic.com (site).'), WATCHDOG_WARNING);
+    if ($result === FALSE) {
+      watchdog('directory ping', t('Failed to notify %pinger (site). %message', array('%pinger' => $pinger, '%message' => xmlrpc_error_msg())), WATCHDOG_WARNING);
+    }
   }
 }
 
