request['mode'])
{
$this->ajax_die('invalid mode (empty)');
}
$map = new sitemap();
$html = '';
switch ($mode)
{
case 'create':
$map->create();
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.xml').'';
} else {
$html .= $lang['SITEMAP_NOT_CREATED'];
}
break;
case 'search_update':
if (!@file_exists(SITEMAP_DIR. 'sitemap.xml')) $map->create();
$map_link = make_url(hide_bb_path(SITEMAP_DIR. 'sitemap.xml'));
foreach ($bb_cfg['sitemap_sending'] as $source_name => $source_link)
{
if ($map->send_url($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;
default:
$this->ajax_die('Invalid mode');
}
$this->response['html'] = $html;
$this->response['mode'] = $mode;