X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=plugins%2FSitemap%2FSitemapPlugin.php;h=07227b4a824b903ec00695449ce91a04969fb1aa;hb=dc5b302fe9ac5906bac29b279dc78ad2d2625536;hp=29b822acd54be6014597c32908d8c75c5505e04d;hpb=8c710ad2c1b80544acccb515f7b601aadff2de16;p=quix0rs-gnu-social.git diff --git a/plugins/Sitemap/SitemapPlugin.php b/plugins/Sitemap/SitemapPlugin.php index 29b822acd5..07227b4a82 100644 --- a/plugins/Sitemap/SitemapPlugin.php +++ b/plugins/Sitemap/SitemapPlugin.php @@ -49,37 +49,6 @@ class SitemapPlugin extends Plugin const USERS_PER_MAP = 50000; const NOTICES_PER_MAP = 50000; - /** - * Load related modules when needed - * - * @param string $cls Name of the class to be loaded - * - * @return boolean hook value; true means continue processing, false means stop. - */ - function onAutoload($cls) - { - $dir = dirname(__FILE__); - - switch ($cls) - { - case 'Sitemap_user_count': - case 'Sitemap_notice_count': - require_once $dir . '/' . $cls . '.php'; - return false; - case 'SitemapindexAction': - case 'NoticesitemapAction': - case 'UsersitemapAction': - case 'SitemapadminpanelAction': - require_once $dir . '/' . strtolower(mb_substr($cls, 0, -6)) . '.php'; - return false; - case 'SitemapAction': - require_once $dir . '/' . strtolower($cls) . '.php'; - return false; - default: - return true; - } - } - /** * Add sitemap-related information at the end of robots.txt * @@ -180,22 +149,8 @@ class SitemapPlugin extends Plugin { $schema = Schema::get(); - $schema->ensureTable('sitemap_user_count', - array(new ColumnDef('registration_date', 'date', null, - true, 'PRI'), - new ColumnDef('user_count', 'integer'), - new ColumnDef('created', 'datetime', - null, false), - new ColumnDef('modified', 'timestamp'))); - - $schema->ensureTable('sitemap_notice_count', - array(new ColumnDef('notice_date', 'date', null, - true, 'PRI'), - new ColumnDef('notice_count', 'integer'), - new ColumnDef('created', 'datetime', - null, false), - new ColumnDef('modified', 'timestamp'))); - + $schema->ensureTable('sitemap_user_count', Sitemap_user_count::schemaDef()); + $schema->ensureTable('sitemap_notice_count', Sitemap_notice_count::schemaDef()); return true; } @@ -219,12 +174,12 @@ class SitemapPlugin extends Plugin * * @return boolean hook value */ - function onPluginVersion(&$versions) + function onPluginVersion(array &$versions) { $url = 'http://status.net/wiki/Plugin:Sitemap'; $versions[] = array('name' => 'Sitemap', - 'version' => STATUSNET_VERSION, + 'version' => GNUSOCIAL_VERSION, 'author' => 'Evan Prodromou', 'homepage' => $url, 'rawdescription' =>