PHP Web Host - Quality Web Hosting For All PHP Applications Sign up for PayPal and start accepting credit card payments instantly
  Login or Register
 • Home • Downloads • Your Account • Forums • 

View next topic
View previous topic


Google
 
Web RavenPHPScripts (This Site)
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.
Author Message
Vchat20
Hangin' Around


Joined: Nov 27, 2004
Posts: 31

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

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 to the forums!
View user's profile Send private message
Raven
Site Admin/Owner


Joined: Aug 27, 2002
Posts: 16987
Location: Kansas

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

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 Visit poster's website AIM Address Yahoo Messenger
Vchat20
Hangin' Around


Joined: Nov 27, 2004
Posts: 31

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

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.
View user's profile Send private message
Vchat20
Hangin' Around


Joined: Nov 27, 2004
Posts: 31

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

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.
View user's profile Send private message
Raven
Site Admin/Owner


Joined: Aug 27, 2002
Posts: 16987
Location: Kansas

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

You need to fetch it
Code:
$row = $db->sql_fetchrow($db->sql_query("SELECT * FROM ".$user_prefix."_config"));
$nukeurl = $row[nukeurl];
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger
64bitguy
The Mouse Is Extension Of Arm


Joined: Mar 06, 2004
Posts: 1156
Location: Sanbornton, NH USA

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

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";
View user's profile Send private message Visit poster's website
Vchat20
Hangin' Around


Joined: Nov 27, 2004
Posts: 31

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

64bitguy's solution ended up the same as before with it not showing the domain. raven's worked though.
View user's profile Send private message
64bitguy
The Mouse Is Extension Of Arm


Joined: Mar 06, 2004
Posts: 1156
Location: Sanbornton, NH USA

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

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 to the forums!
View user's profile Send private message Visit poster's website
Raven
Site Admin/Owner


Joined: Aug 27, 2002
Posts: 16987
Location: Kansas

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

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
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger
Vchat20
Hangin' Around


Joined: Nov 27, 2004
Posts: 31

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

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>";

?>
View user's profile Send private message
64bitguy
The Mouse Is Extension Of Arm


Joined: Mar 06, 2004
Posts: 1156
Location: Sanbornton, NH USA

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

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 to the forums!


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 to the forums!


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 to the forums!
property as news readers do not understand deprecated links.

Steph
View user's profile Send private message Visit poster's website
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.

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
Forums ©
 

All logos and trademarks in this site are property of their respective owner.
The comments are property of their posters, all the rest © 2002-2011 by Raven

You can syndicate our news using the file xml

CSE HTML Validator Helped Clean up This Page! [Valid RSS] valid RSS 2.0 Valid robots.txt Stop Spam Harvesters, Join Project Honey Pot

Website engines core code is © copyright by PHP-Nuke but has been heavily patched and modified by myself and others.
PHP-Nuke is a free software released under the GNU/GPL.


:: fisubice phpbb2 style by Daz :: PHP-Nuke theme by www.nukemods.com ::
:: fisubice Theme Modified by the RavenNuke™ Team ::

:: W3C CSS Compliance Validation :: W3C HTML 4.01 Transitional Compliance Validation ::

zerosum