diff --git a/library/ajax/sitemap.php b/library/ajax/sitemap.php
index 5478c490f..82be6174d 100644
--- a/library/ajax/sitemap.php
+++ b/library/ajax/sitemap.php
@@ -34,17 +34,17 @@ switch ($mode) {
$map_link = make_url('sitemap/sitemap.xml');
- if ($map->sendSitemap('http://google.com/webmasters/sitemaps/ping?sitemap=', $map_link)) {
- $html .= '
' . $lang['SITEMAP_NOTIFY_SEARCH'] . ' Google: ' . $lang['SITEMAP_SENT'] . '';
- } else {
- $html .= '
' . $lang['SITEMAP_NOTIFY_SEARCH'] . ' Google: ' . $lang['SITEMAP_ERROR'] . ' URL: http://google.com/webmasters/sitemaps/ping?sitemap=' . $map_link . '';
+ foreach ($bb_cfg['sitemap_sending'] as $source_name => $source_link) {
+ if ($map->sendSitemap($source_link, $map_link)) {
+ $html .= '
' . $lang['SITEMAP_NOTIFY_SEARCH'] . ' ' . $source_name . ' : ' . $lang['SITEMAP_SENT'] . '';
+ } else {
+ $html .= '
' . $lang['SITEMAP_NOTIFY_SEARCH'] . ' ' . $source_name . ' : ' . $lang['SITEMAP_ERROR'] . ' URL: ' . $source_link . $map_link . '';
+ }
}
+ break;
- if ($map->sendSitemap('http://www.bing.com/ping?sitemap=', $map_link)) {
- $html .= '
' . $lang['SITEMAP_NOTIFY_SEARCH'] . ' Bing: ' . $lang['SITEMAP_SENT'] . '';
- } else {
- $html .= '
' . $lang['SITEMAP_NOTIFY_SEARCH'] . ' Bing: ' . $lang['SITEMAP_ERROR'] . ' URL: http://www.bing.com/ping?sitemap=' . $map_link . '';
- }
+ default:
+ $this->ajax_die("Invalid mode: $mode");
}
$this->response['html'] = $html;
diff --git a/library/config.php b/library/config.php
index 4415c8033..1143c6ac3 100644
--- a/library/config.php
+++ b/library/config.php
@@ -517,6 +517,11 @@ $bb_cfg['user_agreement_url'] = 'info.php?show=user_agreement';
$bb_cfg['copyright_holders_url'] = 'info.php?show=copyright_holders';
$bb_cfg['advert_url'] = 'info.php?show=advert';
+$bb_cfg['sitemap_sending'] = [
+# 'Source name' => 'http://ping_url'
+ 'Google' => 'http://google.com/webmasters/sitemaps/ping?sitemap=',
+];
+
// Extensions
$bb_cfg['file_id_ext'] = [
1 => 'gif',
diff --git a/library/includes/cron/jobs/sitemap.php b/library/includes/cron/jobs/sitemap.php
index b5faf8913..2f952dadf 100644
--- a/library/includes/cron/jobs/sitemap.php
+++ b/library/includes/cron/jobs/sitemap.php
@@ -17,6 +17,7 @@ $map->createSitemap();
if (file_exists(SITEMAP_DIR . '/sitemap.xml')) {
$map_link = make_url('sitemap/sitemap.xml');
- $map->sendSitemap('http://google.com/webmasters/sitemaps/ping?sitemap=', $map_link);
- $map->sendSitemap('http://www.bing.com/ping?sitemap=', $map_link);
+ foreach ($bb_cfg['sitemap_sending'] as $source_name => $source_link) {
+ $map->sendSitemap($source_link, $map_link);
+ }
}