--- multiping.install 2008-03-31 22:53:46.000000000 +0100 +++ multiping.install 2009-04-22 16:37:36.000000000 +0100 @@ -1,5 +1,14 @@ array( @@ -19,11 +28,21 @@ function multiping_schema() { return $schema; } +/** + * Implementation of hook_install(). + */ function multiping_install() { drupal_install_schema('multiping'); db_query("INSERT INTO {multiping} (id,name,url,method,lastping,whentoping,submitmainrss,voc,nodetypes,failcount) VALUES (1, 'Ping-o-matic', 'http://rpc.pingomatic.com', 'weblogUpdates.ping', 0, 9, 1, 'N;', 'N;', 0);"); + + // if scheduler is installed, set multiping to run after it in cron runs. If scheduler is not installed this will just set the weight to 10. + $weight = (int)db_result(db_query("SELECT weight FROM {system} WHERE name = 'scheduler'")); + db_query("UPDATE {system} SET weight = %d WHERE name = 'multiping'", $weight + 10); } +/** + * Implementation of hook_uninstall(). + */ function multiping_uninstall() { drupal_uninstall_schema('multiping'); }