Author |
Message |
micah
Hangin' Around

Joined: May 25, 2006
Posts: 40
|
Posted:
Mon Mar 16, 2009 10:45 am |
|
This is the error that I keep on getting.
XML Parsing Error: XML or text declaration not at start of entity
Location: http://www.hockeytraderumors.com/backend.php
Line Number 64, Column 1:<?xml version="1.0" encoding="ISO-8859-1"?>
Any help to fix this would be appreciated.
Micah |
|
|
|
 |
jakec
Site Admin

Joined: Feb 06, 2006
Posts: 3048
Location: United Kingdom
|
Posted:
Mon Mar 16, 2009 12:22 pm |
|
What version of nuke are you using? |
|
|
|
 |
micah

|
Posted:
Mon Mar 16, 2009 1:10 pm |
|
|
|
 |
micah

|
Posted:
Mon Mar 16, 2009 1:11 pm |
|
no that's not true .. i just checked the config - 7.9 |
|
|
|
 |
Raven
Site Admin/Owner

Joined: Aug 27, 2002
Posts: 17088
|
Posted:
Mon Mar 16, 2009 5:44 pm |
|
Get rid of those 63 blank lines and it should work just fine. |
|
|
|
 |
micah

|
Posted:
Mon Mar 16, 2009 7:25 pm |
|
Now I feel like i am being a pain but I can't seem to be able to get rid of those blank lines. I have checked y header.php and my theme file and I can;t see anything out of whack.
Suggestions would be helpful
Micah |
|
|
|
 |
Raven

|
Posted:
Mon Mar 16, 2009 10:46 pm |
|
Prayer, Mr. Micah. The Klingons don't take prisoners
Check your backend.php file. |
|
|
|
 |
micah

|
Posted:
Tue Mar 17, 2009 8:21 am |
|
Raven ...
If I comment out the line header("Content-Type: text/xml"); I get a printout at least but it is not in the correct format. Everything else looks good to me.
Sorry but I just have no clue on this one
Micah
include("mainfile.php");
include("includes/ipban.php");
global $prefix, $db, $nukeurl;
header("Content-Type: text/xml");
$cat = intval($cat);
if (isset($cat) && !empty($cat)) {
$catid = $db->sql_fetchrow($db->sql_query("SELECT catid FROM ".$prefix."_stories_cat WHERE title LIKE '%$cat%' LIMIT 1"));
if ($catid == "") {
$result = $db->sql_query("SELECT sid, title, hometext FROM ".$prefix."_stories ORDER BY sid DESC LIMIT 10");
} else {
$catid = intval($catid);
$result = $db->sql_query("SELECT sid, title, hometext FROM ".$prefix."_stories WHERE catid='$catid' ORDER BY sid DESC LIMIT 10");
}
} else {
$result = $db->sql_query("SELECT sid, title, hometext FROM ".$prefix."_stories ORDER BY sid DESC LIMIT 10");
}
echo "<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>\n\n";
echo "<!DOCTYPE rss PUBLIC \"-//Netscape Communications//DTD RSS 0.91//EN\"\n";
echo " \"http://my.netscape.com/publish/formats/rss-0.91.dtd\">\n\n";
echo "<rss version=\"0.91\">\n\n";
echo "<channel>\n";
echo "<title>".htmlentities($sitename)."</title>\n";
echo "<link>$nukeurl</link>\n";
echo "<description>".htmlentities($backend_title)."</description>\n";
echo "<language>$backend_language</language>\n\n";
while ($row = $db->sql_fetchrow($result)) {
$rsid = intval($row['sid']);
$rtitle = filter($row['title'], "nohtml");
$rtext = filter($row['hometext']);
echo "<item>\n";
echo "<title>".htmlentities($rtitle)."</title>\n";
echo "<link>$nukeurl/modules.php?name=News&file=article&sid=$rsid</link>\n";
echo "<description>".htmlentities($rtext)."</description>\n";
echo "</item>\n\n";
}
echo "</channel>\n";
echo "</rss>";
?> |
|
|
|
 |
Raven

|
Posted:
Wed Mar 18, 2009 12:16 am |
|
Micah,
We have long stated that all releases after nuke 7.6 are not to be trusted. Be that as it may,
Did it ever work?
If so, just before it stopped working did you make any changes to your system?
If so then restore the files to their previous state. |
|
|
|
 |
micah

|
Posted:
Wed Mar 18, 2009 11:20 am |
|
It used to work ... I did not realize that it was not working any more.
The thing is that all files look good to me but I thin that part of the problem is that site wide there are the 63 blank spaces at the top of each page in the source file. I can;t get rid of those either ... but I think that if i can fix that the backend problem will be resolved as well. that is why I started looking at the header and index file first but I just can not find the problem that is causing all of those blank spaces.
micah |
|
|
|
 |
Raven

|
Posted:
Wed Mar 18, 2009 11:29 am |
|
I know that getting rid of those will fix the problem because I tried it
Now, if all your source files have those 63 lines in them then I would say you're probably using an editor like notepad or wordpad and transferring your files using ASCII. Is that a remote possibility? |
|
|
|
 |
micah

|
Posted:
Wed Mar 18, 2009 11:32 am |
|
yes ... that is exactly what I am doing ... but I didn't know that was a problem |
|
|
|
 |
Raven

|
Posted:
Wed Mar 18, 2009 2:45 pm |
|
This has been discussed several times but you wouldn't know that w/o knowing it was a problem - Catch-22. You should not use notepad nor wordpad to edit your files to be ftp'd. They mishandle line endings, add extra characters and are the source of all kinds of evil . There are several good code editors available and several are free. Notepad++ is just one. If you search the forums here for editors or Textpad you will find several others mentioned. Then, if you use *nix for your production host, you should transfer all files to your hosting account in BINARY.
I would recommend that you ftp your core files, at a minimum, in binary and see if that helps. You should also change all your line endings, via a good editor that you will be getting to Unix. |
|
|
|
 |
|