Added a check to all plugins to see if they support the DBMS the site is running on
3 /* Reminder: always indent with 4 spaces (no tabs). */
4 // +---------------------------------------------------------------------------+
5 // | XMLSitemap Plugin 1.0 |
6 // +---------------------------------------------------------------------------+
9 // | This file provides helper functions for the automatic plugin install. |
10 // +---------------------------------------------------------------------------+
11 // | Copyright (C) 2009 by the following authors: |
13 // | Authors: Kenji ITO - geeklog AT mystral-kk DOT net |
14 // | Dirk Haun - dirk AT haun-online DOT de |
15 // +---------------------------------------------------------------------------+
17 // | This program is free software; you can redistribute it and/or |
18 // | modify it under the terms of the GNU General Public License |
19 // | as published by the Free Software Foundation; either version 2 |
20 // | of the License, or (at your option) any later version. |
22 // | This program is distributed in the hope that it will be useful, |
23 // | but WITHOUT ANY WARRANTY; without even the implied warranty of |
24 // | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
25 // | GNU General Public License for more details. |
27 // | You should have received a copy of the GNU General Public License |
28 // | along with this program; if not, write to the Free Software Foundation, |
29 // | Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
31 // +---------------------------------------------------------------------------+
34 * Autoinstall API functions for the XMLSitemap plugin
40 * Plugin autoinstall function
42 * @param string $pi_name Plugin name
43 * @return array Plugin information
46 function plugin_autoinstall_xmlsitemap($pi_name)
48 $pi_name = 'xmlsitemap';
49 $pi_display_name = 'XMLSitemap';
50 $pi_admin = $pi_display_name . ' Admin';
51 $feature = 'xmlsitemap.edit';
54 'pi_name' => $pi_name,
55 'pi_display_name' => $pi_display_name,
56 'pi_version' => '1.0.0',
57 'pi_gl_version' => '1.6.0',
58 'pi_homepage' => 'http://www.geeklog.net/',
62 $pi_admin => 'Users in this group can administer the ' . $pi_display_name . ' plugin'
65 $feature => 'Access to ' . $pi_admin,
68 $feature => array($pi_admin),
75 'features' => $features,
76 'mappings' => $mappings,
84 * Load plugin configuration from database
86 * @param string $pi_name Plugin name
87 * @return boolean TRUE on success, otherwise FALSE
88 * @see plugin_initconfig_glsitemap
91 function plugin_load_configuration_xmlsitemap($pi_name)
95 $base_path = $_CONF['path'] . 'plugins/' . $pi_name . '/';
97 require_once $_CONF['path_system'] . 'classes/config.class.php';
98 require_once $base_path . 'install_defaults.php';
100 return plugin_initconfig_xmlsitemap();
104 * Check if the plugin is compatible with this Geeklog version
106 * @param string $pi_name Plugin name
107 * @return boolean TRUE: plugin compatible; FALSE: not compatible
110 function plugin_compatible_with_this_version_xmlsitemap($pi_name)
112 global $_CONF, $_DB_dbms;
114 // check if we support the DBMS the site is running on
115 $dbFile = $_CONF['path'] . 'plugins/' . $pi_name . '/sql/'
116 . $_DB_dbms . '_install.php';
117 if (! file_exists($dbFile)) {
121 return function_exists('PLG_itemDeleted');
125 * Perform post-install operations
127 * @param string $pi_name Plugin name
128 * @return boolean TRUE: plugin compatible; FALSE: not compatible
130 function plugin_postinstall_xmlsitemap($pi_name)
132 global $_CONF, $_XMLSMAP_CONF;
134 require_once $_CONF['path'] . 'plugins/xmlsitemap/functions.inc';
136 // Create an XML sitemap for the first time
137 return XMLSMAP_update();