7
Hi wishcraft,
Befor 1 year ago, I made
RSS feed hack for xcgal Module and I added this RSS link to Google Webmaster Center, it is accepted and everything is ok.
![Resized Image](http://www.websitesource.com/images/google-webmaster-central01.gif)
But before few days, I saw
ERRORS alert beside xcgal RSS link and all other RSS Feeds and the error type was
Unsupported file format, and at google help they are say:
Quote:
Your Sitemap does not appear to be in a supported format. Please ensure it meets our Sitemap guidelines and resubmit.
Some things you might check are:
That the file uses the correct header. For a Sitemap file, the header can look like this:
For a Sitemap index file, the header can look like this:
xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
That the namespace in the header is "http://www.sitemaps.org/schemas/sitemap/0.9". Note that this must end in 0.9. If it ends in .9, you'll see an error.
That each XML attribute is enclosed in either single quotes (') or double quotes (") and that those quotes are straight, not curly. If you use a word processing program, such as Microsoft Word, you may find that it inserts curly quotes.
So, what I do is converting my xcgal RSS from:
//
// XOOPS Gallery RSS 2.0
// displays latest photos via RSS 2.0 feed.
// Copyright (c) 2007 Mowaffak Ali - www.arabxoops.com
// Thanks to www.mypapit.net
// 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.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
//
//
//
include_once '../../mainfile.php';
define('IN_XCGALLERY', true);
require('include/init.inc.php');
$charset='windows-1256';
$sitename = htmlspecialchars($xoopsConfig['sitename'], ENT_QUOTES);
$email = checkEmail($xoopsConfig['adminmail'],false);
$slogan = htmlspecialchars($xoopsConfig['slogan'], ENT_QUOTES);
$module = $xoopsModule->getVar('name');
$channel_link = XOOPS_URL.'/';
$channel_desc = xoops_utf8_encode($slogan);
$channel_lastbuild = formatTimestamp(time(), 'rss');
$channel_editor = xoops_utf8_encode($email);
$channel_category = xoops_utf8_encode($category);
$channel_generator = xoops_utf8_encode($module);
$channel_language = _LANGCODE;
$galpath = XOOPS_URL.'/modules/xcgal';
$albumpath = $galpath.'/albums/';
// How many items you want to show in RSS feed
$upperlimit = 10;
header('Content-Type:text/xml; charset='.$charset);
$title = $sitename.' - '.$module;
$channel_title = xoops_utf8_encode($title);
print "1.0" encoding="$charset"?>n";
print "2.0">";
print "n";
print "$channel_titlen";
print "$channel_linkn";
print "$channel_desc";
print "$channel_languagen";
print "$channel_lastbuildn";
print "$channel_generatorn";
$result=$xoopsDB->query("SELECT pid,ctime,title,keywords,filepath,filename FROM ".$xoopsDB->prefix("xcgal_pictures")." ORDER BY pid DESC LIMIT 0,$upperlimit");
while (list($pid, $ctime, $title, $keywords,$filepath,$filename) = mysql_fetch_row($result)) {
print "t- n"
;
print "tt $title n";
print "tt$galpath/displayimage.php?pid=$pidn";
print "tt$channel_editorn";
print "tt$channel_lastbuildn";
print "tt";
echo htmlspecialchars("
$albumpath$filepath" . "thumb_$filename" alt="" />
$keywords");
print "n";
print "tn";
print "n";
}
print "";
print "";
to:
//
// XOOPS Gallery RSS 2.0
// displays latest photo via RSS 2.0 feed.
// Copyright (c) 2007 Mowaffak Ali
// http://www.arabxoops.com/
//
// 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.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
//
//
//
// Thanks to http://mypapit.net/pproject
//
include_once '../../mainfile.php';
define('IN_XCGALLERY', true);
require('include/init.inc.php');
$charset='UTF-8';
$sitename = htmlspecialchars($xoopsConfig['sitename'], ENT_QUOTES);
$module = $xoopsModule->getVar('name');
$channel_link = XOOPS_URL.'/';
$channel_lastbuild = formatTimestamp(time(), 'rss');
$channel_language = _LANGCODE;
$galpath = XOOPS_URL.'/modules/xcgal';
$albumpath = $galpath.'/albums/';
// How many items you want to show in RSS feed
$upperlimit = 100;
header('Content-Type:text/xml; charset='.$charset);
$title = $sitename.' - '.$module;
$channel_title = xoops_utf8_encode($title);
print "1.0" encoding="$charset"?>n";
print "http://www.sitemaps.org/schemas/sitemap/0.9">n";
$result=$xoopsDB->query("SELECT pid FROM ".$xoopsDB->prefix("xcgal_pictures")." ORDER BY pid DESC LIMIT 0,$upperlimit");
while (list($pid) = mysql_fetch_row($result)) {
print "tn";
print "tt$galpath/displayimage.php?pid=$pidn";
print "ttmonthlyn";
print "tt0.5n";
print "tn";
print "n";
}
print "";
and now the error fixed!
I know windows-1256 is not valid charset for RSS but I use it because my site don't support UTF-8.
Am I right ? because I'm looking for convert all RSS feeds in my site to this sitemap structure.
Any comments ?