Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: RSS problem  (Read 3265 times)

woker7

  • Newbie
  • *
  • Karma: 0
  • Posts: 14
RSS problem
« on: December 08, 2006, 05:37:04 pm »

When I hit the RSS link this is what turns up:

Warning: Cannot modify header information - headers already sent by (output started at /home/virtual/hucuk.hr/public_html/news/snews.php:1) in /home/virtual/hucuk.hr/public_html/news/snews.php on line 821


What could it be?  :(

sorry if you've already discussed this issue i just can't find the topic.
Logged

Mika

  • Hero Member
  • *****
  • Karma: 9
  • Posts: 1377
    • http://www.ni5ni6.com/
RSS problem
« Reply #1 on: December 08, 2006, 06:32:38 pm »

That usually means that you've most likely modified your code (error note points somewhere around $date variable) inside function rss() - that is, if you're using snews 1.5.
Headers already sent? The third line of rss() function is the header() definition. There could be a problem because nothing should be outputed before HTTP header.
Logged
http://www.ni5ni6.com/ - Tutorials, Mods and How-To's about sNews CMS
sNews 1.6 Developers Edition - commented sNews 1.6 version

woker7

  • Newbie
  • *
  • Karma: 0
  • Posts: 14
RSS problem
« Reply #2 on: December 11, 2006, 12:18:19 am »

I don't know...

I'm completely new to php...

I compared my snews.php file with the the newly released stable version and the RSS section seems identical.
The only modification I did was copy pasting croatian translation of language variables, I didn't touch anything else. (I'd be to scared to do that ) :D

So what should I do now?  :(
Logged

Keyrocks

  • Doug
  • ULTIMATE member
  • ******
  • Karma: 449
  • Posts: 6020
  • Semantically Challenged
    • snews.ca
RSS problem
« Reply #3 on: December 11, 2006, 02:41:38 am »

Quote from: woker7
I don't know... So what should I do now?  :(
I dunno... start by having a couple of beers to set the mood.  :lol:  (just kidding) - I really don't know... yet.
Logged
Do it now... later may not come.
-------------------------------------------------------------------------------------------------
sNews 1.6 MESU | sNews 1.6 MEMU

Fred K

  • Still trying to learn stuff
  • ULTIMATE member
  • ******
  • Karma: 130
  • Posts: 2728
    • Personal
RSS problem
« Reply #4 on: December 11, 2006, 03:01:10 am »

well, woker, you could try to use a fresh, unmodded snews.php file without the croatioan translation. Just to see if the error still occurrs. If it doesn't then maybe something got lost in translation ...
Logged

woker7

  • Newbie
  • *
  • Karma: 0
  • Posts: 14
RSS problem
« Reply #5 on: December 11, 2006, 04:36:07 pm »

well, here's a possible theory:

When I copy pasted the Croatian translation of language variables, the header of the translation file said I had to save the snews.php as UTF-8 and not as ANSI.
So now I have tried with both types, several times, uploading - and the same result every time.

RSS works when snews is ANSI, and RSS does NOT work when snews is UTF-8.

But when the file is ansi then the site has all these weird symbols instead of normal and regular Croatian diacritics.

Can RSS be fixed somehow to work with this UTF-8 or will I be forced to switch back to ANSI??  :|  :/
Logged

Fred K

  • Still trying to learn stuff
  • ULTIMATE member
  • ******
  • Karma: 130
  • Posts: 2728
    • Personal
RSS problem
« Reply #6 on: December 11, 2006, 04:49:33 pm »

It does work with charset defined as UTF-8. Just be aware that when using UTF-8, the source needs to be saved as UTF-8 with no BOM, and all your html pages must be in the same charset, e.g utf-8. The easiest way (I've found) to do this is to make sure that your editor uses utf-8 when creating/editing documents. Some editors default to the "automatic" charset encoding that your system language uses (in my case iso-8859-1).
So first make sure the editor is using utf-8, then make sure the charset in your snews.php as well as index.php is set to utf-8 and, in the admin interface, that the site continues to use utf-8 when creating content. That way the croatian language variables you paste into snews.php will be in utf-8 just as the content you create -- including the RSS feeed content. Which by all accounts should fix things.
Logged

woker7

  • Newbie
  • *
  • Karma: 0
  • Posts: 14
RSS problem
« Reply #7 on: December 11, 2006, 05:26:44 pm »

What's BOM?

I'm using notepad mostly and saved both index and snews into UTF-8.
(All types, encoding - UTF-8 instead of ANSI)
with snews in UTF - the Croatian letters are tip top.
with index.php in UTF - here's the message I get:

Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /home/virtual/hucuk.hr/public_html/news/index.php:1) in /home/virtual/hucuk.hr/public_html/news/index.php on line 1
 
Fatal error: Cannot redeclare db() (previously declared in /home/virtual/hucuk.hr/public_html/news/snews.php:14) in /home/virtual/hucuk.hr/public_html/news/snews.php on line 14

Save index back to ANSI - again it all works nicely.

What now?  :(
Logged

Mika

  • Hero Member
  • *****
  • Karma: 9
  • Posts: 1377
    • http://www.ni5ni6.com/
RSS problem
« Reply #8 on: December 11, 2006, 06:19:17 pm »

the very first thing in your index.php must be
Quote
please read this posts for more info
http://www.solucija.com/forum/viewtopic.php?id=1992
http://www.solucija.com/forum/viewtopic.php?pid=14580#p14580
Logged
http://www.ni5ni6.com/ - Tutorials, Mods and How-To's about sNews CMS
sNews 1.6 Developers Edition - commented sNews 1.6 version

woker7

  • Newbie
  • *
  • Karma: 0
  • Posts: 14
RSS problem
« Reply #9 on: December 12, 2006, 04:50:54 pm »

wow! it's fixed!

I set the encoding of both index and snews to UTF-8 NO BOM and it works now.

Thanks guys!  :)
Logged