|
|
Drupal example source code file (xmlsitemap_engines_test.module)
The xmlsitemap_engines_test.module Drupal example source code<?php // $Id: xmlsitemap_engines_test.module,v 1.1.2.6 2010/01/31 19:38:21 davereid Exp $ /** * Implements hook_menu(). */ function xmlsitemap_engines_test_menu() { $items['ping'] = array( 'page callback' => 'xmlsitemap_engines_test_pinged', 'access callback' => TRUE, 'type' => MENU_CALLBACK, ); return $items; } /** * Implements hook_xmlsitemap_engine_info(). */ function xmlsitemap_engines_test_xmlsitemap_engine_info() { $engines['simpletest'] = array( 'name' => t('SimpleTest'), 'url' => 'http://example.com/', ); return $engines; } /** * Implements hook_xmlsitemap_engine_info_alter(). */ function xmlsitemap_engines_test_xmlsitemap_engine_info_alter(&$engines) { $engines['simpletest']['url'] = url('ping', array('absolute' => TRUE, 'query' => array('sitemap' => ''))) . '[sitemap]'; } function xmlsitemap_engines_test_pinged() { if (empty($_GET['sitemap']) || !valid_url($_GET['sitemap'])) { watchdog('xmlsitemap', 'No valid sitemap parameter provided.', array(), WATCHDOG_WARNING); // @todo Remove this? Causes an extra watchdog error to be handled. return drupal_not_found(); } else { watchdog('xmlsitemap', 'Recieved ping for @sitemap.', array('@sitemap' => $_GET['sitemap'])); } } Other Drupal examples (source code examples)Here is a short list of links related to this Drupal xmlsitemap_engines_test.module source code file: |
"Drupal" is a registered trademark of Dries Buytaert.
my drupal tutorials and examples
Copyright
1998-2016 Alvin Alexander, alvinalexander.com
All Rights Reserved.
Beginning in 2016, a portion of the proceeds from pages under the '/drupal-code-examples/' URI will be donated to charity.