--- ping.module.orig 2005-12-31 21:18:22.000000000 +0700 +++ ping.module 2006-01-16 13:01:29.000000000 +0700 @@ -44,6 +44,25 @@ } /** + * Implemetaion of hook_settings + */ +function ping_settings() { + $form['ping'] = array( + '#type' => 'fieldset', + '#title' => t('Ping settings'), + '#collapsible' => TRUE, + ); + $form['ping']['ping_pinger_list'] = array( + '#type' => 'textarea', + '#title' => t('URLs to ping'), + '#default_value' => variable_get('ping_pinger_list', 'http://rpc.pingomatic.com'), + '#width' => 40, + '#height' => 10, + ); + return $form; +} + +/** * Call hook_ping() in all modules to notify remote sites that there is * new content at this one. */ @@ -58,11 +77,19 @@ */ function ping_ping($name = '', $url = '') { - $result = xmlrpc('http://rpc.pingomatic.com', 'weblogUpdates.ping', $name, $url); - - if ($result === FALSE) { - watchdog('directory ping', t('Failed to notify pingomatic.com (site).'), WATCHDOG_WARNING); + $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($pinger, 'weblogUpdates.ping', $name, $url); + + if ($result === FALSE) { + watchdog('directory ping', t('Failed to notify %pinger (site). %message', array('%pinger' => $pinger, '%message' => xmlrpc_error_msg())), WATCHDOG_WARNING); + } } } +?>