drupal_directory_ping

Versions
4.6
drupal_directory_ping($link, $name, $mail, $slogan, $mission)

Callback function from drupal_xmlrpc() called when another site pings this one.

Code

modules/drupal.module, line 72

<?php
function drupal_directory_ping($link, $name, $mail, $slogan, $mission) {

  /*
  ** Parse our parameters:
  */

  foreach (array('link', 'name', 'mail', 'slogan', 'mission') as $key) {
    $$key = strip_tags($$key);
  }

  /*
  ** Update the data in our database and send back a reply:
  */

  if ($link && $name && $mail && $slogan && $mission) {
    db_query("DELETE FROM {directory} WHERE link = '%s' OR mail = '%s'", $link, $mail);
    db_query("INSERT INTO {directory} (link, name, mail, slogan, mission, timestamp) VALUES ('%s', '%s', '%s', '%s', '%s', %d)", $link, $name, $mail, $slogan, $mission, time());

    watchdog('directory ping', t('Ping from %name (%link).', array('%name' => theme('placeholder', $name), '%link' => theme('placeholder', $link))), WATCHDOG_NOTICE, '<a href="'. check_url($link) .'">view</a>');

    return 1;
  }
  else {
    return 0;
  }

}
?>
Login or register to post comments
 
 

All source code and documentation on this site is released under the terms of the GNU General Public License, version 2 and later. Drupal is a registered trademark of Dries Buytaert.