Ejemplo n.º 1
0
 if (!empty($_POST['gz'])) {
     $sitemap->createGZipFile = true;
     $result .= $_POST['filename'] . '.gz&nbsp;' . __('added successfully') . '<br/>';
 }
 $sitemap->createSitemap();
 // create sitemap in memory
 $sitemap->writeSitemap();
 // write sitemap as file
 if (isset($_POST['robots_txt'])) {
     file_write_contents(RCMS_ROOT_PATH . 'robots.txt', $_POST['robots_txt']);
 }
 //save robots.txt
 if (!empty($_POST['robots'])) {
     //build new robots.txt
     rcms_delete_files(RCMS_ROOT_PATH . 'robots.txt');
     $sitemap->updateRobots();
     $result .= 'robots.txt&nbsp;' . __('added successfully') . '<br/>';
 }
 if (!empty($_POST['engines'])) {
     // submit sitemaps to search engines
     $result .= "<pre>";
     $result .= $sitemap->submitSitemap('');
     $result .= "</pre>";
 }
 $result .= __('Memory peak usage: ') . number_format(memory_get_peak_usage() / (1024 * 1024), 2) . "MB";
 $time2 = explode(" ", microtime());
 $time2 = $time2[1];
 $result .= '<br/>' . __('Execution time: ') . number_format($time2 - $time) . "s<br/>";
 $result .= __('Done') . '<br/>';
 $result .= __('Look at') . '&nbsp;<a href="' . $_POST['filename'] . '" target="_blank"> sitemap.xml  </a> &nbsp;<br/>';
 rcms_showAdminMessage($result);