=== added file 'multiping.info'
--- multiping.info	1970-01-01 00:00:00 +0000
+++ multiping.info	2007-01-14 14:52:55 +0000
@@ -0,0 +1,3 @@
+; $Id$
+name = Multi Ping
+description = A replacement for the ping module of Drupal. It allows pinging of multiple sites.
\ No newline at end of file

=== modified file 'multiping.module'
--- multiping.module	2007-01-14 10:43:31 +0000
+++ multiping.module	2007-01-14 14:52:55 +0000
@@ -37,7 +37,9 @@
   $items = array();
 
   if ($may_cache) {
-    $items[] = array('path' => 'admin/settings/multiping', 'title' => t('multi ping'),
+    $items[] = array('path' => 'admin/settings/multiping',
+      'title' => t('Multi ping'),
+      'description' => t('Administer multi ping'),
       'callback' => 'multiping_admin',
       'access' => user_access('admin pings'));
   }
@@ -60,7 +62,7 @@
   if (strlen($slogan)>0)
     $name=$name.' - '.$slogan;
   // Determine rss url
-  if (module_exist('taxonomy') && $pingservice->whentoping==2 
+  if (module_exists('taxonomy') && $pingservice->whentoping==2 
     && count($pingservice->voc)>0 && $pingservice->submitmainrss==0) {
     // Taxonomy module exists, "ping only for nodes with taxonomy",
     // Some taxonomy elements are actually selected, "main rss" override is off
@@ -98,7 +100,7 @@
   $result = db_query('SELECT * FROM {multiping}');
   while ($row = db_fetch_object($result)) {
     $sql_from="";
-    if (module_exist('taxonomy') && $row->whentoping==2) {
+    if (module_exists('taxonomy') && $row->whentoping==2) {
       // Find most recent date for nodes with given taxonomy
       $voc=unserialize($row->voc);
       $sql_from="{term_node} t, {node} n WHERE n.status>0 AND".
@@ -172,7 +174,7 @@
 }
 
 
-function _multiping_form($id) {
+function multiping_edit_service($id) {
   $edit['id']=$id;
   $edit['name']='';
   $edit['url']='http://';
@@ -237,7 +239,7 @@
     '#required' => FALSE,
   );
   $options = array('1' => t('Always ping'), '0' => t('Don\'t ping'));
-  if (module_exist('taxonomy')) {
+  if (module_exists('taxonomy')) {
    $options['2']=t('Ping only for nodes with the following taxonomy');
   }
   $form['whentoping'] = array(
@@ -247,7 +249,7 @@
     '#options' => $options,
     '#description' => t('Determines the default settings for pinging this service'),
   );
-  if (module_exist('taxonomy')) {
+  if (module_exists('taxonomy')) {
     $form['voc'] = array(
       '#type' => 'select',
       '#title' => t('Taxonomy terms when to ping'),
@@ -267,7 +269,70 @@
     '#type' => 'submit',
     '#value' => t('Submit'),
   );
-  return drupal_get_form('multiping_edit_service', $form);
+  return $form;
+}
+
+
+function _multiping_form($id) {
+  return drupal_get_form('multiping_edit_service', $id);
+}
+
+
+function multiping_edit_service_submit($form_id, $form_values) {
+  return multiping_settings_submit($form_id, $form_values);
+}
+
+function multiping_settings() {
+	$form=array();
+	$settings=_multiping_get_settings();
+	$form['global']['time_between_pings'] = array(
+		'#type' => 'textfield',
+		'#title' => t('Time between pings'),
+		'#default_value' => $settings['global']['time_between_pings'],
+		'#size' => 8,
+		'#maxlength' => 4,
+		'#description' => t('Minimum number of minutes between two pings to same site'),
+		'#attributes' => NULL,
+		'#required' => TRUE,
+	);
+	$form['pingatonce'] = array(
+		'#type' => 'checkbox',
+		'#title' => t('Ping after post'),
+		'#default_value' => $settings['global']['pingatonce'],
+		'#description' => t('Ping directly after post/update (instead of pinging during the cron job runs)'),
+	);
+	$form['submit'] = array(
+		'#type' => 'submit',
+		'#value' => t('Submit'),
+	);
+  return $form;
+}
+
+
+function multiping_settings_submit($form_id, $form_values) {
+	$edit = $form_values;
+	if ($edit['form_id']=='multiping_edit_service') {
+		$edit['id'] = ($edit['id'] && is_numeric($edit['id'])) ? $edit['id'] : 0;
+		$edit['name'] = ($edit['name']) ? $edit['name'] : '(no name)';
+		$edit['url'] = ($edit['url']) ? $edit['url'] : 'http://localhost/';
+		$edit['method'] = ($edit['method']) ? $edit['method'] : '';
+		$edit['submitmainrss'] = ($edit['submitmainrss']) ? $edit['submitmainrss'] : 0; // Not present if false!
+		if ($edit['submitmainrss']>0) $edit['submitmainrss']=1;
+		if ($edit['id']==0) {
+			db_query("INSERT INTO {multiping} (name,url,method,whentoping,submitmainrss,voc) ".
+	"VALUES ('%s','%s','%s','%s','%s','%s')",$edit['name'],$edit['url'],
+	$edit['method'],$edit['whentoping'],$edit['submitmainrss'],serialize($edit['voc']));
+		} else {
+			db_query("UPDATE {multiping} SET name='%s',url='%s',method='%s',whentoping='%s',submitmainrss='%s',voc='%s' ".
+	"WHERE id=%d",$edit['name'],$edit['url'],$edit['method'],$edit['whentoping'],$edit['submitmainrss'],serialize($edit['voc']),$edit['id']);
+		}
+	} elseif ($edit['form_id']=='multiping_settings') {
+		$settings=_multiping_get_settings();
+		$settings['global']['time_between_pings']=$edit['time_between_pings'];
+		$settings['global']['pingatonce']=$edit['pingatonce'];
+		variable_set('multiping', $settings);
+	}
+	drupal_goto("admin/settings/multiping");
 }
 
 
@@ -277,31 +342,7 @@
 function multiping_admin() {
   if (!user_access('admin pings')) return;
   $output = "";
-  if ($_POST['op']==t('Submit')) {
-    $edit = $_POST['edit'];
-    if ($edit['form_id']=='multiping_edit_service') {
-      $edit['id'] = ($edit['id'] && is_numeric($edit['id'])) ? $edit['id'] : 0;
-      $edit['name'] = ($edit['name']) ? $edit['name'] : '(no name)';
-      $edit['url'] = ($edit['url']) ? $edit['url'] : 'http://localhost/';
-      $edit['method'] = ($edit['method']) ? $edit['method'] : '';
-      $edit['submitmainrss'] = ($edit['submitmainrss']) ? $edit['submitmainrss'] : 0; // Not present if false!
-      if ($edit['submitmainrss']>0) $edit['submitmainrss']=1;
-      if ($edit['id']==0) {
-        db_query("INSERT INTO {multiping} (name,url,method,whentoping,submitmainrss,voc) ".
-	  "VALUES ('%s','%s','%s','%s','%s','%s')",$edit['name'],$edit['url'],
-	  $edit['method'],$edit['whentoping'],$edit['submitmainrss'],serialize($edit['voc']));
-      } else {
-        db_query("UPDATE {multiping} SET name='%s',url='%s',method='%s',whentoping='%s',submitmainrss='%s',voc='%s' ".
-	  "WHERE id=%d",$edit['name'],$edit['url'],$edit['method'],$edit['whentoping'],$edit['submitmainrss'],serialize($edit['voc']),$edit['id']);
-      }
-    } elseif ($edit['form_id']=='multiping_settings') {
-      $settings=_multiping_get_settings();
-      $settings['global']['time_between_pings']=$edit['time_between_pings'];
-      $settings['global']['pingatonce']=$edit['pingatonce'];
-      variable_set('multiping', $settings);
-    }
-    drupal_goto("admin/settings/multiping");
-  } elseif (arg(3)=="new") {
+  if (arg(3)=="new") {
     $output .= _multiping_form(0);
   } elseif (arg(3)=="edit") {
     if (!is_numeric(arg(4))) return;
@@ -322,28 +363,6 @@
     $output .= "<p>".l(t('Return'),"admin/settings/multiping")."</p>";
   } else {
     // General settings
-    $form=array();
-    $settings=_multiping_get_settings();
-    $form['global']['time_between_pings'] = array(
-      '#type' => 'textfield',
-      '#title' => t('Time between pings'),
-      '#default_value' => $settings['global']['time_between_pings'],
-      '#size' => 8,
-      '#maxlength' => 4,
-      '#description' => t('Minimum number of minutes between two pings to same site'),
-      '#attributes' => NULL,
-      '#required' => TRUE,
-    );
-    $form['pingatonce'] = array(
-      '#type' => 'checkbox',
-      '#title' => t('Ping after post'),
-      '#default_value' => $settings['global']['pingatonce'],
-      '#description' => t('Ping directly after post/update (instead of pinging during the cron job runs)'),
-    );
-    $form['submit'] = array(
-      '#type' => 'submit',
-      '#value' => t('Submit'),
-    );
     $output .= drupal_get_form('multiping_settings', $form);
     // Table with services
     $header = array(t('Name'), t('Last update'), array('data' => t('Operations'), 'colspan' => '2'));


