mirror of
https://github.com/torrentpier/torrentpier-lts.git
synced 2025-02-28 15:10:54 +03:00
Fixed broken sitemap sending (#112)
This commit is contained in:
parent
bf9431a697
commit
3a946abdc1
@ -23,31 +23,19 @@ switch ($mode)
|
||||
case 'search_update':
|
||||
if (!@file_exists(SITEMAP_DIR. 'sitemap.xml')) $map->create();
|
||||
|
||||
$map_link = make_url(SITEMAP_DIR. 'sitemap.xml');
|
||||
$map_link = make_url(hide_bb_path(SITEMAP_DIR. 'sitemap.xml'));
|
||||
|
||||
if (strpos($map->send_url("http://google.com/webmasters/sitemaps/ping?sitemap=", $map_link), "successfully added") !== false) {
|
||||
$html .= '<br />'.$lang['SITEMAP_NOTIFY_SEARCH'].' Google: <font style="color: green;">'.$lang['SITEMAP_SENT'].'</font>';
|
||||
} else {
|
||||
$html .= '<br />'.$lang['SITEMAP_NOTIFY_SEARCH'].' Google: <font style="color: red;">'.$lang['SITEMAP_ERROR'].'</font> URL: <a href="http://google.com/webmasters/sitemaps/ping?sitemap='.urlencode($map_link).'" target="_blank">http://google.com/webmasters/sitemaps/ping?sitemap='.$map_link.'</a>';
|
||||
}
|
||||
|
||||
if (strpos($map->send_url("http://ping.blogs.yandex.ru/ping?sitemap=", $map_link), "OK") !== false) {
|
||||
$html .= '<br />'.$lang['SITEMAP_NOTIFY_SEARCH'].' Yandex: <font style="color: green;">'.$lang['SITEMAP_SENT'].'</font>';
|
||||
} else {
|
||||
$html .= '<br />'.$lang['SITEMAP_NOTIFY_SEARCH'].' Yandex: <font style="color: red;">'.$lang['SITEMAP_ERROR'].'</font> URL: <a href="http://ping.blogs.yandex.ru/ping?sitemap='.urlencode($map_link).'" target="_blank">http://ping.blogs.yandex.ru/ping?sitemap='.$map_link.'</a>';
|
||||
}
|
||||
|
||||
if ($map->send_url("http://www.bing.com/ping?sitemap=", $map_link)) {
|
||||
$html .= '<br />'.$lang['SITEMAP_NOTIFY_SEARCH'].' Bing: <font style="color: green;">'.$lang['SITEMAP_SENT'].'</font>';
|
||||
} else {
|
||||
$html .= '<br />'.$lang['SITEMAP_NOTIFY_SEARCH'].' Bing: <font style="color: red;">'.$lang['SITEMAP_ERROR'].'</font> URL: <a href="http://www.bing.com/ping?sitemap='.urlencode($map_link).'" target="_blank">http://www.bing.com/ping?sitemap='.$map_link.'</a>';
|
||||
}
|
||||
|
||||
if (strpos($map->send_url("http://rpc.weblogs.com/pingSiteForm?name=InfraBlog&url=", $map_link), "Thanks for the ping") !== false) {
|
||||
$html .= '<br />'.$lang['SITEMAP_NOTIFY_SEARCH'].' Weblogs: <font style="color: green;">'.$lang['SITEMAP_SENT'].'</font>';
|
||||
} else {
|
||||
$html .= '<br />'.$lang['SITEMAP_NOTIFY_SEARCH'].' Weblogs: <font style="color: red;">'.$lang['SITEMAP_ERROR'].'</font> URL: <a href="http://rpc.weblogs.com/pingSiteForm?name=InfraBlog&url='.urlencode($map_link).'" target="_blank">http://rpc.weblogs.com/pingSiteForm?name=InfraBlog&url='.$map_link.'</a>';
|
||||
}
|
||||
foreach ($bb_cfg['sitemap_sending'] as $source_name => $source_link)
|
||||
{
|
||||
if ($map->send_url($source_link, $map_link))
|
||||
{
|
||||
$html .= '<br />' . $lang['SITEMAP_NOTIFY_SEARCH'] . ' ' . $source_name . ' : <span style="color: green;">' . $lang['SITEMAP_SENT'] . '</span>';
|
||||
}
|
||||
else
|
||||
{
|
||||
$html .= '<br />' . $lang['SITEMAP_NOTIFY_SEARCH'] . ' ' . $source_name . ' : <span style="color: red;">' . $lang['SITEMAP_ERROR'] . '</span> URL: <a href="' . $source_link . urlencode($map_link) . '" target="_blank">' . $source_link . $map_link . '</a>';
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
|
@ -555,6 +555,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'] = array(
|
||||
# 'Source name' => 'http://ping_url'
|
||||
'Google' => 'http://google.com/webmasters/sitemaps/ping?sitemap=',
|
||||
);
|
||||
|
||||
// Extensions
|
||||
$bb_cfg['file_id_ext'] = array(
|
||||
1 => 'gif',
|
||||
|
@ -7,12 +7,12 @@ require(CLASS_DIR .'sitemap.php');
|
||||
$map = new sitemap();
|
||||
$map->create();
|
||||
|
||||
if (@file_exists(BB_ROOT. "/sitemap/sitemap.xml"))
|
||||
if (@file_exists(SITEMAP_DIR. 'sitemap.xml'))
|
||||
{
|
||||
$map_link = make_url('/sitemap/sitemap.xml');
|
||||
$map_link = make_url(hide_bb_path(SITEMAP_DIR. 'sitemap.xml'));
|
||||
|
||||
$map->send_url("http://google.com/webmasters/sitemaps/ping?sitemap=", $map_link);
|
||||
$map->send_url("http://ping.blogs.yandex.ru/ping?sitemap=", $map_link);
|
||||
$map->send_url("http://www.bing.com/ping?sitemap=", $map_link);
|
||||
$map->send_url("http://rpc.weblogs.com/pingSiteForm?name=InfraBlog&url=", $map_link);
|
||||
foreach ($bb_cfg['sitemap_sending'] as $source_name => $source_link)
|
||||
{
|
||||
$map->send_url($source_link, $map_link);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user