Author |
Message |
Vchat20
Hangin' Around

Joined: Nov 27, 2004
Posts: 31
|
Posted:
Fri Sep 23, 2005 1:49 pm |
|
ive been trying to get the RSS feed woring on one of my sites, but unfortunately phpnuke is embedding some style tags in it which is causing firefox to moan. heres the link:
http://www.simmersquarterly.com/backend.php |
|
|
|
 |
Raven
Site Admin/Owner

Joined: Aug 27, 2002
Posts: 17088
|
Posted:
Fri Sep 23, 2005 3:02 pm |
|
If you have these 2 lines in your fileCode:include("mainfile.php");
include("includes/ipban.php");
|
try commenting them out and replacing them withCode:require_once("config.php");
require_once("db/db.php");
|
If that still doesn't work then please either post your backend.php file here or a link to it. |
|
|
|
 |
Vchat20

|
Posted:
Fri Sep 23, 2005 3:17 pm |
|
well, it fixed it somewhat. accessing the backend.php directly shows no errors and the xml shows up fine. but the live bookmark feed in firefox still says it failed to load. im confused :S
edit: nvm. deleted the live bookmark feed from the toolbar and readded it. doesnt show it failed to load, but it just shows one line on the menu which is blank. |
|
|
|
 |
Vchat20

|
Posted:
Fri Sep 23, 2005 3:22 pm |
|
ok. fixed it. for some reason its not appending the site url where $nukeurl is. so in the rss feed, all the links are showing as /modules.php?..... . so i manually edited the backend and replaced $nukeurl with the domain name as it should be and it is working just fine now. |
|
|
|
 |
Raven

|
Posted:
Fri Sep 23, 2005 3:29 pm |
|
You need to fetch it
Code:$row = $db->sql_fetchrow($db->sql_query("SELECT * FROM ".$user_prefix."_config"));
$nukeurl = $row[nukeurl];
|
|
|
|
|
 |
64bitguy
The Mouse Is Extension Of Arm

Joined: Mar 06, 2004
Posts: 1164
|
Posted:
Fri Sep 23, 2005 3:39 pm |
|
Actually, it is not compliant
find your "link" line in the backend.php and change it from:
Code:echo "<link>$nukeurl/modules.php?name=News&file=article&sid=$rsid</link>\n";
|
To:
Code:echo "<link>".htmlentities("$nukeurl/modules.php?name=News&file=article&sid=$rsid")."</link>\n";
|
|
_________________ Steph Benoit
100% Section 508 and W3C HTML5 and CSS Compliant (Truly) Code, because I love compliance. |
|
|
 |
Vchat20

|
Posted:
Fri Sep 23, 2005 3:50 pm |
|
64bitguy's solution ended up the same as before with it not showing the domain. raven's worked though. |
|
|
|
 |
64bitguy

|
Posted:
Fri Sep 23, 2005 3:55 pm |
|
Something is awry. I'm assuming I should have been more clear about which one to replace.
Here is my fully functional and compliant Nuke 7.8 backend.php file.
Code:<?php
/************************************************************************/
/* PHP-NUKE: Web Portal System */
/* =========================== */
/* */
/* Copyright (c) 2005 by Francisco Burzi */
/* http://phpnuke.org */
/* */
/* 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. */
/************************************************************************/
/* 100% RSS/XML and W3C Compliance by Steph Benoit - http://64bit.us */
/* A component of "After-Patched" for PHP-Nuke 7.8.3.1.1 */
/************************************************************************/
include("mainfile.php");
global $prefix, $db, $nukeurl;
header("Content-Type: text/xml");
if (isset($cat) && !empty($cat)) {
$cat = htmlentities($cat);
list($catid) = $db->sql_fetchrow($db->sql_query("SELECT catid FROM ".$prefix."_stories_cat WHERE title LIKE '%$cat%' LIMIT 1"));
if (empty($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 (list($rsid, $rtitle, $rtext) = $db->sql_fetchrow($result)) {
$rsid = intval($rsid);
echo "<item>\n";
echo "<title>".htmlentities($rtitle)."</title>\n";
echo "<link>".htmlentities("$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>";
?>
|
You can see this demonstrated at http://78.64bit.us/backend.php |
|
|
|
 |
Raven

|
Posted:
Fri Sep 23, 2005 5:59 pm |
|
Vchat20 wrote: | 64bitguy's solution ended up the same as before with it not showing the domain. raven's worked though. | I may be mistaken, but I think 64bit's initial comment was meant to be in addition to mine. IOW, if you were to do this to your original code:
FIND AND COMMENT OUT THESE TWO LINES
Code:include("mainfile.php");
include("includes/ipban.php");
|
REPLACE THE COMMENTED LINES WITH THESE
Code:require_once("config.php");
require_once("db/db.php");
$row = $db->sql_fetchrow($db->sql_query("SELECT * FROM ".$user_prefix."_config"));
$nukeurl = $row[nukeurl];
|
FIND
Code:echo "<link>$nukeurl/modules.php?name=News&file=article&sid=$rsid</link>\n";
|
CHANGE IT TO
Code:echo "<link>".htmlentities("$nukeurl/modules.php?name=News&file=article&sid=$rsid")."</link>\n";
|
My code did nothing for compliancy. I was just trying to get you jump started. 64bit's code helps to clean it up.
I would recommend that you use the complete module code he posted. It's clean and should solve all your problems  |
|
|
|
 |
Vchat20

|
Posted:
Tue Sep 27, 2005 10:46 pm |
|
ok. this is bugging me. whatever current state of confusion my backend.php file is in, its spewing links like this one: "/modules.php?name=News&file=article&sid=13"
heres the current source code of the backend.php file:
Code:<?php
/************************************************************************/
/* PHP-NUKE: Web Portal System */
/* =========================== */
/* */
/* Copyright (c) 2005 by Francisco Burzi */
/* http://phpnuke.org */
/* */
/* 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. */
/************************************************************************/
/* 100% RSS/XML and W3C Compliance by Steph Benoit - http://64bit.us */
/* A component of "After-Patched" for PHP-Nuke 7.8.3.1.1 */
/************************************************************************/
require_once("config.php");
require_once("db/db.php");
$row = $db->sql_fetchrow($db->sql_query("SELECT * FROM ".$user_prefix."_config"));
$nukeurl = $row[nukeurl];
global $prefix, $db, $nukeurl;
header("Content-Type: text/xml");
if (isset($cat) && !empty($cat)) {
$cat = htmlentities($cat);
list($catid) = $db->sql_fetchrow($db->sql_query("SELECT catid FROM ".$prefix."_stories_cat WHERE title LIKE '%$cat%' LIMIT 1"));
if (empty($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 (list($rsid, $rtitle, $rtext) = $db->sql_fetchrow($result)) {
$rsid = intval($rsid);
echo "<item>\n";
echo "<title>".htmlentities($rtitle)."</title>\n";
echo "<link>".htmlentities("$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>";
?>
|
|
|
|
|
 |
64bitguy

|
Posted:
Tue Sep 27, 2005 11:04 pm |
|
Those & are not a problem. It is SUPPOSED to do that.
Those are automatically converted by the parser/aggregator or news reader into &
What is a problem is that you have non-compliant code in your articles themselves. Things like not having & in links coded as &
All & in news must be coded as &
You also have some color for example in the section:
Quote: | Reviews are coming in for The Sims 2 Nightlife and are for the most | where you do not end the color call.
These kinds of errors can mess up validation and your ability to propogate to aggregators. Your code in articles should always be compliant.
To test it, see: http://www.feedvalidator.org/check.cgi?url=http%3A%2F%2Fwww.simmersquarterly.com%2Fbackend.php
Compare your non-compliant results to the backend.php code that I provided you with above, which is running at my test domain:
http://www.feedvalidator.org/check.cgi?url=http%3A%2F%2F78.64bit.us%2Fbackend.php
You'll notice that my code is 100% validated because my articles are also 100% W3C Complaint.
Again, the problem you are dealing with is that your news articles are using non-compliant data and this is screwing up your backend.php validation.
The backend.php code that I provided is what you should be using, but it can't fix problems that exist in your articles. You'll have to go back and fix them where needed.
One other thing. Whenever referring to a link on your own domain, never refer to it simply as index.php... always code the entire http://whatever.com/index.php property as news readers do not understand deprecated links.
Steph |
|
|
|
 |
|