[pLog-svn] r2377 - in plugins/trunk/sitemap: . locale

pwestbro at devel.plogworld.net pwestbro at devel.plogworld.net
Fri Jul 29 19:06:55 GMT 2005


Author: pwestbro
Date: 2005-07-29 19:06:54 +0000 (Fri, 29 Jul 2005)
New Revision: 2377

Added:
   plugins/trunk/sitemap/locale/locale_de_DE.php
Modified:
   plugins/trunk/sitemap/pluginsitemap.class.php
Log:
Thanks to Naden Badalgogtapeh for sending me the German translation for the
sitemap plugin.  This change includes the translation, as well as changing tabs to
spaces in the plugin code


Added: plugins/trunk/sitemap/locale/locale_de_DE.php
===================================================================
--- plugins/trunk/sitemap/locale/locale_de_DE.php	2005-07-28 20:51:27 UTC (rev 2376)
+++ plugins/trunk/sitemap/locale/locale_de_DE.php	2005-07-29 19:06:54 UTC (rev 2377)
@@ -0,0 +1,15 @@
+<?php
+$messages["manageSettings"] = "Einstellungen";
+$messages["sitemapPluginSettings"] = "Sitemaps";
+
+$messages["sitemap_plugin_enabled"] = "Diese Plugin aktivieren.";
+$messages["sitemap_plugin"] = "Sitemap Plugin";
+
+$messages["google_notification_enabled"] = "Google bei €nderungen automatisch benachrichtigen.";
+
+$messages["sitemap_settings_saved_ok"] = "Sitemap-Einstellungen wurde gespeichert!";
+
+$messages["label_configuration"] = "Einstellungen";
+$messages["label_enable"] = "Aktivieren";
+$messages["label_notify_google_enable"] = "Google benachrichtigen.";
+?>
\ No newline at end of file

Modified: plugins/trunk/sitemap/pluginsitemap.class.php
===================================================================
--- plugins/trunk/sitemap/pluginsitemap.class.php	2005-07-28 20:51:27 UTC (rev 2376)
+++ plugins/trunk/sitemap/pluginsitemap.class.php	2005-07-29 19:06:54 UTC (rev 2377)
@@ -1,82 +1,85 @@
 <?php
 
-	include_once( PLOG_CLASS_PATH."class/plugin/pluginbase.class.php" );
-	include_once( PLOG_CLASS_PATH."class/net/http/httpclient.class.php" );
-    include_once( PLOG_CLASS_PATH."class/net/requestgenerator.class.php" );
+    include_once( PLOG_CLASS_PATH."class/plugin/pluginbase.class.php" );
+    include_once( PLOG_CLASS_PATH."class/net/http/httpclient.class.php" );
+    include_once( PLOG_CLASS_PATH."class/net/requestgenerator.class.php" );
+
     
-	/**
-	 * implements notification of 
-	 */
-	class PluginSiteMap extends PluginBase
-	{
-	    var $pluginEnabled;
-        var $cacheFolder;
+    /**
+     * implements notification of 
+     */
+    class PluginSiteMap extends PluginBase
+    {
+        var $pluginEnabled;
+        var $cacheFolder;
 
-		function PluginSiteMap()
-		{
-			$this->PluginBase();
-			
-			$this->id = "sitemap";
-			$this->desc = "Generates Google Sitemap for all permalinks.";
-			$this->author = "Paul Westbrook";
-			$this->locales = Array( "en_UK" );
-			
-			$this->init();
-		}
 
-		/**
-		 * registers all the filters and actions that we're going to use
-		 */
-		function init()
-		{			
-			// register the events we want
-			$this->registerNotification( EVENT_POST_POST_ADD );
-			$this->registerNotification( EVENT_POST_POST_UPDATE );
-			$this->registerNotification( EVENT_POST_POST_DELETE );
-			
-			// register an action that will allow users to see which comments have not been
-			// accepted yet
-			$this->registerAdminAction( "sitemapPluginSettings", "AdminSiteMapPluginSettingsAction" );
-			$this->registerAdminAction( "sitemapPluginUpdateSettings", "AdminSiteMapPluginUpdateSettingsAction" );
-			
-			// add a menu entry
-			$menu =& Menu::getMenu();
+        function PluginSiteMap()
+        {
+            $this->PluginBase();
+            
+            $this->id = "sitemap";
+            $this->desc = "Generates Google Sitemap for all permalinks.";
+            $this->author = "Paul Westbrook";
+            $this->locales = Array( "en_UK", "de_DE" );
+            
+            $this->init();
+        }
+
+        /**
+         * registers all the filters and actions that we're going to use
+         */
+        function init()
+        {           
+            // register the events we want
+            $this->registerNotification( EVENT_POST_POST_ADD );
+            $this->registerNotification( EVENT_POST_POST_UPDATE );
+            $this->registerNotification( EVENT_POST_POST_DELETE );
+            
+            // register an action that will allow users to see which comments have not been
+            // accepted yet
+            $this->registerAdminAction( "sitemapPluginSettings", "AdminSiteMapPluginSettingsAction" );
+            $this->registerAdminAction( "sitemapPluginUpdateSettings", "AdminSiteMapPluginUpdateSettingsAction" );
+            
+            // add a menu entry
+            $menu =& Menu::getMenu();
             if( !$menu->entryExists( "/menu/controlCenter/manageSettings" ))                     
                 $this->addMenuEntry( "/menu/controlCenter", "manageSettings", "", "", true, false );
             $this->addMenuEntry( "/menu/controlCenter/manageSettings", "sitemapPluginSettings", "admin.php?op=sitemapPluginSettings", "", true, false );
-		}
+        }
 
-		function register()
-		{
-            $config =& Config::getConfig();
-            $this->cacheFolder = $config->getValue('temp_folder');
-            $this->cacheFolder = $this->cacheFolder.'/sitemap/'.$this->blogInfo->getId();
-            if( !File::exists( $this->cacheFolder )) {
-                File::createDir( $this->cacheFolder );
-            }
+        function register()
+        {
+            $config =& Config::getConfig();
 
-		    $blogSettings = $this->blogInfo->getSettings();
-			$this->pluginEnabled = $blogSettings->getValue( "plugin_sitemap_enabled" );
-		}
+            $this->cacheFolder = $config->getValue('temp_folder');
+            $this->cacheFolder = $this->cacheFolder.'/sitemap/'.$this->blogInfo->getId();
+            if( !File::exists( $this->cacheFolder )) {
+                File::createDir( $this->cacheFolder );
+            }
 
-	    function isEnabled()
-	    {
-	        return $this->pluginEnabled;
-	    }		
-		
-		/**
-		 * process the events that we have registered
-		 *
-		 * @see PluginBase::process
-		 * @see PluginManager
-		 */
-		function process( $eventType, $params )
-		{
-		    // make sure we're processing the right event!
-		    if( $eventType != EVENT_POST_POST_ADD &&
+            $blogSettings = $this->blogInfo->getSettings();
+            $this->pluginEnabled = $blogSettings->getValue( "plugin_sitemap_enabled" );
+        }
+
+        function isEnabled()
+        {
+            return $this->pluginEnabled;
+        }       
+        
+        /**
+         * process the events that we have registered
+         *
+         * @see PluginBase::process
+         * @see PluginManager
+         */
+        function process( $eventType, $params )
+        {
+            // make sure we're processing the right event!
+            if( $eventType != EVENT_POST_POST_ADD &&
                 $eventType != EVENT_POST_POST_UPDATE &&
                 $eventType != EVENT_POST_POST_DELETE ) 
-		    {
+            {
                 return true;
             }
 
@@ -84,26 +87,26 @@
             // Load all of the settings for this blog
             $this->register();
             
-			// do nothing if the plugin is not enabled!
-			$blogSettings = $this->blogInfo->getSettings();
-			if( !$blogSettings->getValue( "plugin_sitemap_enabled" ))
-			{
+            // do nothing if the plugin is not enabled!
+            $blogSettings = $this->blogInfo->getSettings();
+            if( !$blogSettings->getValue( "plugin_sitemap_enabled" ))
+            {
                 // error_log( "plugin not enabled" );
-				return true;
+                return true;
             }
-			  
-			$this->GenerateSiteMap( );
-		      
-			return true;
-		}
-		
-	    /**
-     	 * Turns on notification for the specified article
-	     *
-	     */
-		
-		function GenerateSiteMap( )
-		{
+              
+            $this->GenerateSiteMap( );
+              
+            return true;
+        }
+        
+        /**
+         * Turns on notification for the specified article
+         *
+         */
+        
+        function GenerateSiteMap( )
+        {
             // articles object
             $articles = new Articles;
 
@@ -118,8 +121,12 @@
             $url = $this->blogInfo->getBlogRequestGenerator();
 
             // Data from the xml file that needs to be there.
-            $xmlData =  $xmlData . "<?xml version='1.0' encoding='UTF-8'?>\n".
                          "<urlset xmlns=\"http://www.google.com/schemas/sitemap/0.84\"\n".
                          "xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n".
                          "xsi:schemaLocation=\"http://www.google.com/schemas/sitemap/0.84\n".
                          "http://www.google.com/schemas/sitemap/0.84/sitemap.xsd\">\n";
-                        	  
+            $xmlData =  $xmlData . "<?xml version='1.0' encoding='UTF-8'?>\n".
+                          "<urlset xmlns=\"http://www.google.com/schemas/sitemap/0.84\"\n".
+                          "xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n".
+                          "xsi:schemaLocation=\"http://www.google.com/schemas/sitemap/0.84\n".
+                          "http://www.google.com/schemas/sitemap/0.84/sitemap.xsd\">\n";
+                              
              
             // Iterate over the posts and create an entry for each.
             foreach($list as $item)
@@ -133,18 +140,21 @@
             $xmlData =  $xmlData . "</urlset>\n";
                 
                 
-            $compressedFile = $this->cacheFolder."/sitemap.gz";  
+            $compressedFile = $this->cacheFolder."/sitemap.gz";  
+
             
             // Save this to a compressed file.
             $gz = gzopen($compressedFile,'w9');
             if ( $gz )
-            {
                gzwrite($gz, $xmlData);
                gzclose($gz);
+            {
+                gzwrite($gz, $xmlData);
+                gzclose($gz);
             }
             
-			$blogSettings = $this->blogInfo->getSettings();
-			if( $blogSettings->getValue( "plugin_sitemap_notify_google_enabled" ))
-			{
-			     // Send the request to google
+            $blogSettings = $this->blogInfo->getSettings();
+            if( $blogSettings->getValue( "plugin_sitemap_notify_google_enabled" ))
+            {
+                 // Send the request to google
                 $rg =& RequestGenerator::getRequestGenerator( $this->blogInfo );
                 $rewriteFile = "/sitemap" . $this->blogInfo->getId() . ".gz";
                 $rewriteFileUrl = $rg->getUrl($rewriteFile);
@@ -152,8 +162,9 @@
                 $pingUrl = "http://www.google.com/webmasters/sitemaps/ping?sitemap=" . urlencode($rewriteFileUrl);
                 
                 $handle = fopen( $pingUrl, "r" );
-                fclose( $handle );
-			}
+                fclose( $handle );
+
+            }
         }
-	}  
+    }  
 ?>
\ No newline at end of file




More information about the pLog-svn mailing list