]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - plugins/Sitemap/SitemapPlugin.php
move USERS_PER_MAP to plugin
[quix0rs-gnu-social.git] / plugins / Sitemap / SitemapPlugin.php
index 8889c893066eae618bfab6432eb491282765eb50..40263aaeef206aab1b68f98b39dd73c82ea94af9 100644 (file)
@@ -47,20 +47,11 @@ if (!defined('STATUSNET')) {
 
 class SitemapPlugin extends Plugin
 {
+    const USERS_PER_MAP = 25000;
+
     /**
      * Load related modules when needed
      *
-     * Most non-trivial plugins will require extra modules to do their work. Typically
-     * these include data classes, action classes, widget classes, or external libraries.
-     *
-     * This method receives a class name and loads the PHP file related to that class. By
-     * tradition, action classes typically have files named for the action, all lower-case.
-     * Data classes are in files with the data class name, initial letter capitalized.
-     *
-     * Note that this method will be called for *all* overloaded classes, not just ones
-     * in this plugin! So, make sure to return true by default to let other plugins, and
-     * the core code, get a chance.
-     *
      * @param string $cls Name of the class to be loaded
      *
      * @return boolean hook value; true means continue processing, false means stop.
@@ -96,12 +87,13 @@ class SitemapPlugin extends Plugin
     {
         $m->connect('sitemapindex.xml',
                     array('action' => 'sitemapindex'));
+
         $m->connect('/sitemaps/notice/:year/:month/:day/:index.xml',
                     array('action' => 'noticesitemap'),
                     array('year' => '[0-9]{4}',
-                          'month' => '[1]?[0-9]',
-                          'day' => '[123]?[0-9]',
-                          'index' => '[0-9]+'));
+                          'month' => '[01][0-9]',
+                          'day' => '[0123][0-9]',
+                          'index' => '[1-9][0-9]*'));
 
         $m->connect('/sitemaps/user/:index.xml',
                     array('action' => 'usersitemap'),