problem with my rss-feed

Random stuff about serendipity. Discussion, Questions, Paraphernalia.
Post Reply
stm999999999
Regular
Posts: 1531
Joined: Tue Mar 07, 2006 11:25 pm
Location: Berlin, Germany
Contact:

problem with my rss-feed

Post by stm999999999 »

I have a problem with my feeds on my new site (http://www.s9y.org/forums/viewtopic.php?t=7699):
Fehler:XML declaration not at beginning of document
Spezifikation:http://www.w3.org/TR/REC-xml/
1:
2:
3: <?xml version="1.0" encoding="utf-8" ?>
4: <?xml-stylesheet href="/templates/default/atom.css" type="text/css" ?>
5:
6: <feed
it does not matter if I use rss2 or atom ...

I do not have any (changed) feed-tpls in my template, s9y uses the default ones. If I choose another template (or the origin of my changed one, artistic) everything is fine.

Do you have any idea for this error? Why are there two empty lines?
Ciao, Stephan
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: problem with my rss-feed

Post by garvinhicking »

Hi!

I think that one of your files emits blank space. Check all your manually modified files if they have blank lines or linebreaks before the first <?php or after the last ?>.

Especially custom language files, theme config files or plugins can cause this. Often even a WINDOWS-Style linebreak can introduce that error. We suggest to not put a closing "?>" in files to prevent a problem with padding newlines.

Best regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
stm999999999
Regular
Posts: 1531
Joined: Tue Mar 07, 2006 11:25 pm
Location: Berlin, Germany
Contact:

Post by stm999999999 »

I think it could not be a plugin or so, because after changing the template all works well.

So it should be an error of my template.

In what kind of files should I search? only.php or even .tpl, or ...?
Ciao, Stephan
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Hi!

PHP files only.

HTH,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
stm999999999
Regular
Posts: 1531
Joined: Tue Mar 07, 2006 11:25 pm
Location: Berlin, Germany
Contact:

Post by stm999999999 »

thanks, I found it in my lang_de.inc.php.

But it is a little bit mysterious: It is the normal lang-file. The utf-8-lang-file was OK and my blog uses utf-8. Why has an error in the normal lang an effect to a utf-8-blog?
Ciao, Stephan
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Hi!

In which file exactly? Ofyour template or of the blog?

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
stm999999999
Regular
Posts: 1531
Joined: Tue Mar 07, 2006 11:25 pm
Location: Berlin, Germany
Contact:

Post by stm999999999 »

in my template lang-file, with $serendipity['useTemplateLanguage'] = true;
Ciao, Stephan
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Hi!

Hm...okay. I don't recall the code for that useTemplateLanguage stuff, so itwould need to be investigated why the-non-utf8 version could be included...

Maybe it's also your templates config.inc.php fiel that is loading this lang file...?

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
stm999999999
Regular
Posts: 1531
Joined: Tue Mar 07, 2006 11:25 pm
Location: Berlin, Germany
Contact:

Post by stm999999999 »

Hm...okay. I don't recall the code for that useTemplateLanguage stuff, so itwould need to be investigated why the-non-utf8 version could be included...

Code: Select all

    // The following variable can be set in serendipity_config_local.inc.php to force your templates being able to use language override includes
    if ($serendipity['useTemplateLanguage']) {
        @include (S9Y_INCLUDE_PATH . 'templates/' . $serendipity['template'] . '/' . $charset .  'lang_' . $serendipity['lang'] . '.inc.php');
        @include (S9Y_INCLUDE_PATH . 'templates/' . $serendipity['template'] . '/lang_en.inc.php');
    }
Maybe it's also your templates config.inc.php fiel that is loading this lang file...?

Code: Select all

$probelang = dirname(__FILE__) . '/lang_' . $serendipity['lang'] . '.inc.php';
if (file_exists($probelang)) {
    include $probelang;
} else {
    include dirname(__FILE__) . '/lang_en.inc.php';
}
hm, a "$charset" there would be fine?
Ciao, Stephan
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Hi!

So its definitely your templates config.inc.php. In your case, yes, you'd needto add a $serendipity['charset'] in there.

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
stm999999999
Regular
Posts: 1531
Joined: Tue Mar 07, 2006 11:25 pm
Location: Berlin, Germany
Contact:

Post by stm999999999 »

why not "$charset" as in the lang.inc.php?


BTW, this fault is not only in my config.php. It is in "artistic" on which my templated based, and it is in kubrick and pink_lilies ...

It seems to me that this is in every template with a config.php
Ciao, Stephan
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Hi!

Because $charset is not a superglobal value and only available in local scope in lang.inc.php.
BTW, this fault is not only in my config.php. It is in "artistic" on which my templated based, and it is in kubrick and pink_lilies ...
I guess then this was introduced before the UTF-8 charset was available. I also don'T know which templates already have a utf-8 translation. If someone can contribute a GNU patch for all affected templates I can commit the fix!

Best regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Post Reply