request['mode'];
$map = new TorrentPier\Legacy\Sitemap();
$html = '';
switch ($mode) {
case 'create':
$map->createSitemap();
if (file_exists(SITEMAP_DIR . '/sitemap.xml')) {
$html .= $lang['SITEMAP_CREATED'] . ': ' . bb_date(TIMENOW, $bb_cfg['post_date_format']) . ' ' . $lang['SITEMAP_AVAILABLE'] . ': ' . make_url('sitemap/sitemap.xml') . '';
} else {
$html .= $lang['SITEMAP_NOT_CREATED'];
}
break;
case 'search_update':
if (!file_exists(SITEMAP_DIR . '/sitemap.xml')) {
$map->createSitemap();
}
$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 . '';
}
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 . '';
}
}
$this->response['html'] = $html;
$this->response['mode'] = $mode;