".__('This version of Google XML Sitemaps is not multisite compatible.','sitemap')."
".sprintf(__('Unfortunately this version of the Google XML Sitemaps plugin was not tested with the multisite feature of WordPress 3.0 yet.
The plugin will not be active until you disable the multisite mode.
Or you can try the new beta which supports all the new WordPress features!','sitemap'), "http://www.arnebrachhold.de/redir/sitemap-info-beta/")."
";
}
/**
* Registers the plugin in the admin menu system
*/
function RegisterAdminPage() {
if (function_exists('add_options_page')) {
add_options_page(__('XML-Sitemap Generator','sitemap'), __('XML-Sitemap','sitemap'), 'level_10', GoogleSitemapGeneratorLoader::GetBaseName(), array('GoogleSitemapGeneratorLoader','CallHtmlShowOptionsPage'));
}
}
function RegisterAdminIcon($hook) {
if ( $hook == GoogleSitemapGeneratorLoader::GetBaseName() && function_exists('plugins_url')) {
return plugins_url('img/icon-arne.gif',GoogleSitemapGeneratorLoader::GetBaseName());
}
return $hook;
}
function RegisterPluginLinks($links, $file) {
$base = GoogleSitemapGeneratorLoader::GetBaseName();
if ($file == $base) {
$links[] = '' . __('Settings','sitemap') . '';
$links[] = '' . __('FAQ','sitemap') . '';
$links[] = '' . __('Support','sitemap') . '';
$links[] = '' . __('Donate','sitemap') . '';
}
return $links;
}
/**
* Invokes the HtmlShowOptionsPage method of the generator
*/
function CallHtmlShowOptionsPage() {
if(GoogleSitemapGeneratorLoader::LoadPlugin()) {
$gs = &GoogleSitemapGenerator::GetInstance();
$gs->HtmlShowOptionsPage();
}
}
/**
* Invokes the CheckForAutoBuild method of the generator
*/
function CallCheckForAutoBuild($args) {
if(GoogleSitemapGeneratorLoader::LoadPlugin()) {
$gs = &GoogleSitemapGenerator::GetInstance();
$gs->CheckForAutoBuild($args);
}
}
/**
* Invokes the CheckForAutoBuild method of the generator
*/
function CallBuildNowRequest() {
if(GoogleSitemapGeneratorLoader::LoadPlugin()) {
$gs = &GoogleSitemapGenerator::GetInstance();
$gs->BuildNowRequest();
}
}
/**
* Invokes the BuildSitemap method of the generator
*/
function CallBuildSitemap() {
if(GoogleSitemapGeneratorLoader::LoadPlugin()) {
$gs = &GoogleSitemapGenerator::GetInstance();
$gs->BuildSitemap();
}
}
/**
* Invokes the CheckForManualBuild method of the generator
*/
function CallCheckForManualBuild() {
if(GoogleSitemapGeneratorLoader::LoadPlugin()) {
$gs = &GoogleSitemapGenerator::GetInstance();
$gs->CheckForManualBuild();
}
}
/**
* Invokes the ShowPingResult method of the generator
*/
function CallShowPingResult() {
if(GoogleSitemapGeneratorLoader::LoadPlugin()) {
$gs = &GoogleSitemapGenerator::GetInstance();
$gs->ShowPingResult();
}
}
function CallHtmlShowHelpList($filterVal,$screen) {
$id = get_plugin_page_hookname(GoogleSitemapGeneratorLoader::GetBaseName(),'options-general.php');
if($screen == $id) {
$links = array(
__('Plugin Homepage','sitemap')=>'http://www.arnebrachhold.de/redir/sitemap-help-home/',
__('My Sitemaps FAQ','sitemap')=>'http://www.arnebrachhold.de/redir/sitemap-help-faq/'
);
$filterVal[$id] = '';
$i=0;
foreach($links AS $text=>$url) {
$filterVal[$id].='' . $text . '' . ($i < (count($links)-1)?'
':'') ;
$i++;
}
}
return $filterVal;
}
function CallDoRobots() {
if(GoogleSitemapGeneratorLoader::LoadPlugin()) {
$gs = &GoogleSitemapGenerator::GetInstance();
$gs->DoRobots();
}
}
/**
* Loads the actual generator class and tries to raise the memory and time limits if not already done by WP
*
* @return boolean true if run successfully
*/
function LoadPlugin() {
$mem = abs(intval(@ini_get('memory_limit')));
if($mem && $mem < 64) {
@ini_set('memory_limit', '64M');
}
$time = abs(intval(@ini_get("max_execution_time")));
if($time != 0 && $time < 120) {
@set_time_limit(120);
}
if(!class_exists("GoogleSitemapGenerator")) {
$path = trailingslashit(dirname(__FILE__));
if(!file_exists( $path . 'sitemap-core.php')) return false;
require_once($path. 'sitemap-core.php');
}
GoogleSitemapGenerator::Enable();
return true;
}
/**
* Returns the plugin basename of the plugin (using __FILE__)
*
* @return string The plugin basename, "sitemap" for example
*/
function GetBaseName() {
return plugin_basename(__FILE__);
}
/**
* Returns the name of this loader script, using __FILE__
*
* @return string The __FILE__ value of this loader script
*/
function GetPluginFile() {
return __FILE__;
}
/**
* Returns the plugin version
*
* Uses the WP API to get the meta data from the top of this file (comment)
*
* @return string The version like 3.1.1
*/
function GetVersion() {
if(!isset($GLOBALS["sm_version"])) {
if(!function_exists('get_plugin_data')) {
if(file_exists(ABSPATH . 'wp-admin/includes/plugin.php')) require_once(ABSPATH . 'wp-admin/includes/plugin.php'); //2.3+
else if(file_exists(ABSPATH . 'wp-admin/admin-functions.php')) require_once(ABSPATH . 'wp-admin/admin-functions.php'); //2.1
else return "0.ERROR";
}
$data = get_plugin_data(__FILE__, false, false);
$GLOBALS["sm_version"] = $data['Version'];
}
return $GLOBALS["sm_version"];
}
}
//Enable the plugin for the init hook, but only if WP is loaded. Calling this php file directly will do nothing.
if(defined('ABSPATH') && defined('WPINC')) {
add_action("init",array("GoogleSitemapGeneratorLoader","Enable"),1000,0);
}
?>