Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Ravens PHP Scripts And Web Hosting Forum Index -> phpnuke 7.8
Author Message
Vchat20
Hangin' Around



Joined: Nov 27, 2004
Posts: 31

PostPosted: Fri Sep 23, 2005 1:49 pm Reply with quote

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:
[ Only registered users can see links on this board! Get registered or login! ]
 
View user's profile Send private message
Raven
Site Admin/Owner



Joined: Aug 27, 2002
Posts: 17088

PostPosted: Fri Sep 23, 2005 3:02 pm Reply with quote

If you have these 2 lines in your file
Code:
include("mainfile.php");

include("includes/ipban.php");

try commenting them out and replacing them with
Code:
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.
 
View user's profile Send private message
Vchat20







PostPosted: Fri Sep 23, 2005 3:17 pm Reply with quote

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







PostPosted: Fri Sep 23, 2005 3:22 pm Reply with quote

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







PostPosted: Fri Sep 23, 2005 3:29 pm Reply with quote

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

PostPosted: Fri Sep 23, 2005 3:39 pm Reply with quote

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&amp;file=article&amp;sid=$rsid</link>\n";

To:
Code:
echo "<link>".htmlentities("$nukeurl/modules.php?name=News&amp;file=article&amp;sid=$rsid")."</link>\n";

_________________
Steph Benoit
100% Section 508 and W3C HTML5 and CSS Compliant (Truly) Code, because I love compliance. 
View user's profile Send private message
Vchat20







PostPosted: Fri Sep 23, 2005 3:50 pm Reply with quote

64bitguy's solution ended up the same as before with it not showing the domain. raven's worked though.
 
64bitguy







PostPosted: Fri Sep 23, 2005 3:55 pm Reply with quote

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&amp;file=article&amp;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 [ Only registered users can see links on this board! Get registered or login! ]
 
Raven







PostPosted: Fri Sep 23, 2005 5:59 pm Reply with quote

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&amp;file=article&amp;sid=$rsid</link>\n";

CHANGE IT TO
Code:
echo "<link>".htmlentities("$nukeurl/modules.php?name=News&amp;file=article&amp;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 Wink
 
Vchat20







PostPosted: Tue Sep 27, 2005 10:46 pm Reply with quote

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

?>
 
64bitguy







PostPosted: Tue Sep 27, 2005 11:04 pm Reply with quote

Those &amp; 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 &amp;

All & in news must be coded as &amp;

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: [ Only registered users can see links on this board! Get registered or login! ]

Compare your non-compliant results to the backend.php code that I provided you with above, which is running at my test domain: [ Only registered users can see links on this board! Get registered or login! ]

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 [ Only registered users can see links on this board! Get registered or login! ] property as news readers do not understand deprecated links.

Steph
 
Display posts from previous:       
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Ravens PHP Scripts And Web Hosting Forum Index -> phpnuke 7.8

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 ©