Error
Leading whitespace
Detail
We've detected that your Sitemap file begins with whitespace. We've accepted the file, but you may want to remove the whitespace so that the file adheres to the XML standard. [?]
I'm not sure what it's talking about. there are no spaces between <? and ?>
- Code: Select all
<?php
/***************************************************************************
* sitemap.php
* -------------------
* begin : Saturday, Feb 20, 2006
* copyright : (C) dcz
* Contact : www.phpbb-seo.com
*
* $Id: sitemap.php, v1.0.0RC2 2006/04/26 18:05:13 fds Exp $
*
*
***************************************************************************/
/***************************************************************************
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
***************************************************************************/
//mxBB PORTAL
if ( file_exists('mx_forum.php') )
{
define( 'IN_PORTAL', true );
$mx_root_path = './';
$module_root_path2 = $module_root_path = 'modules/';
include($mx_root_path . 'extension.inc');
include($mx_root_path . 'common.'.$phpEx);
// Start session management
$userdata = session_pagestart($user_ip, PAGE_INDEX);
mx_init_userprefs($userdata);
// End session management
$phpbb = FALSE;
define('GGSITEMAP_TABLE', $mx_table_prefix.'ggsitemap_config');
}
// PHPBB
else
{
define('IN_PHPBB', true);
$phpbb = TRUE;
// YOU HAVE TO SET THE CORRECT PATH FOR PHPBB IF YOU WANT
// TO USE THIS SITEMAP SYSTEM OUTSIDE OF THE PHPBB FOLDER
// AND TO LOOK AT LINE 70 too ;-)
$module_root_path2 = $module_root_path = $phpbb_root_path = './';
include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.'.$phpEx);
// Start session management
$userdata = session_pagestart($user_ip, PAGE_INDEX);
init_userprefs($userdata);
// End session management
}
// Good old heavy method. Do this here to allow for sitemap installation at the root level
$script_name = preg_replace('/^\/?(.*?)\/?$/', '\1', trim($board_config['script_path']));
$server_name = trim($board_config['server_name']);
$server_protocol = 'http://'; // No https here, since it's ment for google Bots
$server_port = ($board_config['server_port'] <> 80) ? ':' . trim($board_config['server_port']) . '/' : '/';
$root_url = $server_protocol . $server_name . $server_port;
$server_url = $root_url . $script_name;
if(substr($server_url, -1, 1) != "/")
{
$server_url .= "/";
}
// Comment this line if you put your sitemap in the root folder
// and phpbb installed in a subfolder.
$root_url = ($phpbb) ? $server_url : $root_url;
//
// Include common module stuff...
//
include($module_root_path . 'mx_ggsitemaps/includes/common_GGsitemaps.' . $phpEx);
// Grab ggsitemaps config
$sql = "SELECT * FROM " . GGSITEMAP_TABLE;
if( !$result = $db->sql_query($sql) )
{
mx_sitemaps_message_die(GENERAL_ERROR, "Couldn't get Google sitemaps config information", "", __LINE__, __FILE__, $sql);
}
while ( $row = $db->sql_fetchrow($result) )
{
$ggsitemap_config[$row['config_name']] = $row['config_value'];
}
// Even this is too much to stay for nothing
$db->sql_freeresult($result);
// Set some usefull vars
$sql_limit = $ggsitemap_config['sitemap_sql_limit'];
$url_limit = $ggsitemap_config['sitemap_url_limit'];
$sitemap_ver = $ggsitemap_config['sitemap_ver'];
$C_info = $ggsitemap_config['sitemap_c_info'];
$Rewrite_sitemap = ( $ggsitemap_config['sitemap_rewrited'] == "TRUE" ) ? TRUE : FALSE;
$is_index = false;
$started = false;
$query_ok = TRUE;
// Since echo is the fast way here, let's define headers and footers
// Those are inteded to allow validation
//Sitemaps
// DO NOT REMOVE (C) INFOS !!!
$S_header = '<?xml version=\'1.0\' encoding=\'UTF-8\'?>
<urlset xmlns="http://www.google.com/schemas/sitemap/0.84"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.google.com/schemas/sitemap/0.84
http://www.google.com/schemas/sitemap/0.84/sitemap.xsd">
<!-- Generated by mx Google Sitemaps ' . $sitemap_ver . ' - ' . $C_info . ' -->' . "\n";
$S_footer = '</urlset>';
//Sitemap index
// DO NOT REMOVE (C) INFOS !!!
$I_header = '<?xml version=\'1.0\' encoding=\'UTF-8\'?>
<sitemapindex xmlns="http://www.google.com/schemas/sitemap/0.84"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.google.com/schemas/sitemap/0.84
http://www.google.com/schemas/sitemap/0.84/siteindex.xsd">
<!-- Generated by mx Google Sitemaps ' . $sitemap_ver . ' - ' . $C_info . ' -->' . "\n";
$I_footer = '</sitemapindex>';
// Load sitemaps, I know this mean that all module are included here
// even if they end not being asked for, but what is the cost of
// even a dozen $_GET performed in several includes for a page that's
// not supposed to be even loaded ten times a day?
$location = $module_root_path . 'mx_ggsitemaps/includes';
$dir = @opendir( $location );
while( $file = @readdir($dir) )
{
if( preg_match("/^sitemap_.*?\." . $phpEx . "$/", $file) )
{
include_once($location . '/' . $file);
}
}
@closedir($dir);
// Check if nobody tricked us
if ($started)
{
mx_sitemaps_redirect(append_sid("index.$phpEx"));
}
// Nothing matched so it's an index
elseif (!$started)
{
$is_index = true;
// Load sitemap index
$dir = @opendir( $location );
while( $file = @readdir($dir) )
{
if( preg_match("/^index_.*?\." . $phpEx . "$/", $file) )
{
include_once($location . '/' . $file);
}
}
@closedir($dir);
}
// End output if necessary
if ($started)
{
echo $I_footer;
exit;
}
// Never know who might have tricked us ;-)
else
{
mx_sitemaps_message_die(GENERAL_MESSAGE, 'Invalid request');
}
?>

English |
French


