Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if ($host=="domain1.com" and $uri=="/sitemap.xml")
- {
- $host_array = array("domain1.com","domain2.com","domain3.com");
- $file_array = array();
- foreach ($host_array as $key=>$value)
- {
- create_keyword_file($value);
- $content = file_get_contents("keyword/".$value.".txt");
- $array = unserialize($content);
- foreach ($array[1] as $key2=>$value2)
- {
- $array[1][$key2] = "http://".$value."/".$array[1][$key2];
- }
- $file_array = array_merge($file_array,$array[1]);
- }
- srand($date);
- shuffle($file_array);
- array_splice($file_array,$sitemap_count);
- header("Content-Type: text/xml; charset=UTF-8");
- echo('<?xml version="1.0" encoding="UTF-8"?><?xml-stylesheet type="text/xsl" href="sitemap.xsl"?><urlset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd"
- xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
- ');
- echo(' <url><loc>http://'.$host.'/</loc></url>
- <lastmod>'.date("Y",$date).'-'.date("m",$date).'-'.date("d",$date).'</lastmod>
- <changefreq>Daily</changefreq>
- <priority>1</priority>
- ');
- foreach ($file_array as $key=>$value)
- {
- echo(' <url>
- <loc>'.$value.'</loc>
- <lastmod>'.date("Y",$date).'-'.date("m",$date).'-'.date("d",$date).'</lastmod>
- <changefreq>Daily</changefreq>
- <priority>1</priority>
- </url>
- ');
- }
- echo('</urlset>');
- if ($log==1) add_file("log/".$host.".txt",date("d.m.Y H:i:s",$date)."\n".$_SERVER["HTTP_USER_AGENT"]."\n"."http://".$_SERVER["HTTP_HOST"].$_SERVER["REQUEST_URI"]."\n\n");
- exit;
- }
Advertisement
Add Comment
Please, Sign In to add comment