private function createSitemap($rows, $spaceUserName, $sourceType, $indexFile)
    {/*{{{*/
		if(false == count($rows))return;
		$content = '';
        foreach($rows as $case)
        {
            $content .= '<loc>'.$this->getSitemapSourceUrl($spaceUserName,$case['id'],$sourceType).'</loc>'."\n";
			$content .= '<lastmod>'.$case['utime'].'</lastmod>'."\n";
			$content .= '<changefreq>'.Space::SPACE_SITEMAP_CHANGE_FREQ.'</changefreq><priority>'.Space::SPACE_SITEMAP_PRIORITY.'</priority>'."\n"; 
		}
		$filename = space::getSitemapFilename($spaceUserName, $sourceType);
        $fileUrl = 'http://'.URL_PREFIX.$spaceUserName.'.haodf.com/sitemap/'.$filename;
		$this->createSitemapXmlfile($filename, $content, $fileUrl, $indexFile);
    }/*}}}*/
Ejemplo n.º 2
0
<?php 
include_once(dirname(__FILE__).'/../assembly.php');
DAL::get()->setUp('spacefront');
preg_match('/^(dev\.)?([^\.]+)\./', getenv('HTTP_HOST'),$matches);
$spaceName = $matches[2];
echo 'Allow: *'."<br />";
echo 'Disallow: /huanyouhui'."<br />";
$keys = array_keys(Space::$source);
foreach ($keys as $key){
	$filename = space::getSitemapFilename($spaceName, $key);
	if(file_exists(dirname(__FILE__).'/sitemap/'.$filename)){
		echo 'Sitemap: http://'.getenv('HTTP_HOST').'/sitemap/'.$filename."<br />";
	}
}