Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> Post Installation Help
Author Message
micah
Hangin' Around


Joined: May 25, 2006
Posts: 40

PostPosted: Mon Mar 16, 2009 10:45 am Reply with quote

This is the error that I keep on getting.

XML Parsing Error: XML or text declaration not at start of entity
Location: Only registered users can see links on this board! Get registered or login!
Line Number 64, Column 1:<?xml version="1.0" encoding="ISO-8859-1"?>

Any help to fix this would be appreciated.
Micah
 
View user's profile Send private message
jakec
Site Admin


Joined: Feb 06, 2006
Posts: 3048
Location: United Kingdom

PostPosted: Mon Mar 16, 2009 12:22 pm Reply with quote

What version of nuke are you using?
 
View user's profile Send private message
micah
PostPosted: Mon Mar 16, 2009 1:10 pm Reply with quote

7.6 patched
 
micah
PostPosted: Mon Mar 16, 2009 1:11 pm Reply with quote

no that's not true .. i just checked the config - 7.9
 
Raven
Site Admin/Owner


Joined: Aug 27, 2002
Posts: 17077

PostPosted: Mon Mar 16, 2009 5:44 pm Reply with quote

Get rid of those 63 blank lines and it should work just fine.
 
View user's profile Send private message
micah
PostPosted: Mon Mar 16, 2009 7:25 pm Reply with quote

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
PostPosted: Mon Mar 16, 2009 10:46 pm Reply with quote

Prayer, Mr. Micah. The Klingons don't take prisoners Wink

Check your backend.php file.
 
micah
PostPosted: Tue Mar 17, 2009 8:21 am Reply with quote

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&amp;file=article&amp;sid=$rsid</link>\n";
echo "<description>".htmlentities($rtext)."</description>\n";
echo "</item>\n\n";
}
echo "</channel>\n";
echo "</rss>";

?>
 
Raven
PostPosted: Wed Mar 18, 2009 12:16 am Reply with quote

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
PostPosted: Wed Mar 18, 2009 11:20 am Reply with quote

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
PostPosted: Wed Mar 18, 2009 11:29 am Reply with quote

I know that getting rid of those will fix the problem because I tried it Wink

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
PostPosted: Wed Mar 18, 2009 11:32 am Reply with quote

yes ... that is exactly what I am doing ... but I didn't know that was a problem
 
Raven
PostPosted: Wed Mar 18, 2009 2:45 pm Reply with quote

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 Wink. 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 Wink to Unix.
 
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> Post Installation Help

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©