[pLog-svn] r4866 - plugins/branches/lifetype-1.2/sitemap

pwestbro at devel.lifetype.net pwestbro at devel.lifetype.net
Sat Feb 24 04:32:32 EST 2007


Author: pwestbro
Date: 2007-02-24 04:32:31 -0500 (Sat, 24 Feb 2007)
New Revision: 4866

Modified:
   plugins/branches/lifetype-1.2/sitemap/pluginsitemap.class.php
Log:
Merged revision 4865 into the 1.2 branch


Modified: plugins/branches/lifetype-1.2/sitemap/pluginsitemap.class.php
===================================================================
--- plugins/branches/lifetype-1.2/sitemap/pluginsitemap.class.php	2007-02-24 09:28:45 UTC (rev 4865)
+++ plugins/branches/lifetype-1.2/sitemap/pluginsitemap.class.php	2007-02-24 09:32:31 UTC (rev 4866)
@@ -126,33 +126,33 @@
 
             $url = $this->blogInfo->getBlogRequestGenerator();
 
-            // Data from the xml file that needs to be there.
-            $xmlData =  "<?xml version='1.0' encoding='UTF-8'?>\n".
-                          "<urlset xmlns=\"http://www.sitemaps.org/schemas/sitemap/0.9\">\n";
-                              
-             
-            // Iterate over the posts and create an entry for each.
-            foreach($list as $item)
-            {
-                $xmlData =  $xmlData . "<url>\n";
-                $xmlData =  $xmlData . "<loc>\n";
-                $xmlData =  $xmlData . htmlspecialchars( $url->postPermalink( $item ) ) . "\n";
-                $xmlData =  $xmlData . "</loc>\n";
-                $xmlData =  $xmlData . "</url>\n";
-            }
-            $xmlData =  $xmlData . "</urlset>\n";
-                
-                
+
             $compressedFile = $this->cacheFolder."/sitemap.gz";  
-
             
             // Save this to a compressed file.
             $gz = gzopen($compressedFile,'w9');
+
             if ( $gz )
             {
+
+                // Data from the xml file that needs to be there.
+                $xmlData =  "<?xml version='1.0' encoding='UTF-8'?>\n".
+                              "<urlset xmlns=\"http://www.sitemaps.org/schemas/sitemap/0.9\">\n";
+                              
                 gzwrite($gz, $xmlData);
+             
+                // Iterate over the posts and create an entry for each.
+                foreach($list as $item)
+                {
+                    gzwrite($gz,  "<url>\n");
+                    gzwrite($gz, "<loc>\n");
+                    gzwrite($gz, htmlspecialchars( $url->postPermalink( $item ) ) . "\n");
+                    gzwrite($gz, "</loc>\n");
+                    gzwrite($gz, "</url>\n");
+                }
+                gzwrite($gz, "</urlset>\n");
                 gzclose($gz);
-            }
+            }                
             
             $blogSettings = $this->blogInfo->getSettings();
             if( $blogSettings->getValue( "plugin_sitemap_notify_google_enabled" ))



More information about the pLog-svn mailing list