Author |
Message |
BobMarion
Former Admin in Good Standing
![](modules/Forums/images/avatars/4a8223e348325d1641ec3.png)
Joined: Oct 30, 2002
Posts: 1037
Location: RedNeck Land (known as Kentucky)
|
Posted:
Wed Aug 25, 2004 9:23 pm |
|
Any site running NukeSentinel™ that allows other sites to add their backend.php news feed needs to do the following:
Open backend.php in a text editor and find:Code:include("mainfile.php");
header("Content-Type: text/xml");
|
Replace it with:Code://include("mainfile.php");
require_once("config.php");
require_once("db/db.php");
$row = $db->sql_fetchrow($db->sql_query("SELECT * FROM ".$prefix."_config"));
$sitename = $row[sitename];
$nukeurl = $row[nukeurl];
$backend_title = $row[backend_title];
$backend_language = $row[backend_language];
header("Content-Type: application/rss+xml");
|
NukeSentinel™ is blocking outside sites from adding your backend.php into a block on their sites and the above corrects it.
UPDATED: This post has been updated to include those items found below. |
_________________ Bob Marion
Codito Ergo Sum
Only registered users can see links on this board! Get registered or login!
Last edited by BobMarion on Thu Aug 26, 2004 10:15 am; edited 2 times in total |
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
64bitguy
The Mouse Is Extension Of Arm
![](modules/Forums/images/avatars/183ecd6a404a3683445de.gif)
Joined: Mar 06, 2004
Posts: 1164
|
Posted:
Thu Aug 26, 2004 2:37 am |
|
Excellent Development Support = Going to lookup a solution to a problem that you just found, only to find that an annoucement was posted 4 hours earlier.
I'm getting the feeling that Bob:
A) Is A Voodoo Priest.
B) Is spending non-coding time developing ESP skills.
C) Has one hell of a crystal ball.
D) Got an email from someone that is syndicating RSS feeds wondering why they won't load anymore.
In any event, its all good to me! Thanks! |
_________________ Steph Benoit
100% Section 508 and W3C HTML5 and CSS Compliant (Truly) Code, because I love compliance. |
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
BobMarion
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Thu Aug 26, 2004 2:39 am |
|
To confess, it came from a bug report on my site ![Smile](modules/Forums/images/smiles/icon_smile.gif) |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
Muffin
Client
![](modules/Forums/images/avatars/acb9e660413114ce222fd.jpg)
Joined: Apr 10, 2004
Posts: 649
Location: UK
|
Posted:
Thu Aug 26, 2004 5:48 am |
|
Thanks Bob.
I had a newsfeed on my site, but in a block. It worked fine with Sentinel.
The only thing that went wonky was when the newsfeed site was down and it screwed up the display on the page. |
_________________ Classic Mini rules the bends & bends the rules!
[img] |
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
mesa
New Member
![New Member New Member](modules/Forums/images/ranks/1star.gif)
![](modules/Forums/images/avatars/cb7d105c410ae93909c50.gif)
Joined: Jul 30, 2004
Posts: 1
|
Posted:
Thu Aug 26, 2004 6:34 am |
|
Here are the results after reediting with the code on the backend.php
http://www.ravenphpscripts.com/backend.php
--------------------------------------------------------
Sorry
This feed does not validate.
Your feed appears to be encoded as "ISO-8859-1", but your server is reporting "US-ASCII" [help]
line 9, column 26: title contains bad characters (2 occurrences) [help]
<title>Ravens PHP Scripts </title> ^
line 10, column 6: link must be a full and valid URL [help]
<link></link> ^
line 15, column 19: title contains bad characters (4 occurrences) [help]
<title>NukeSentinel and RSS feeds</title> ^
line 16, column 57: link must be a full and valid URL (10 occurrences) [help]
<link>/modules.php?name=News&file=article&sid=471</link> ^
Source: http://www.ravenphpscripts.com/backend.php
Rssults are pull from http://feeds.archive.org/validator/
to reconfirm Only registered users can see links on this board! Get registered or login! |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
sixonetonoffun
Spouse Contemplates Divorce
![](modules/Forums/images/avatars/d1ecfa674c890aee2698b.jpg)
Joined: Jan 02, 2003
Posts: 2496
|
Posted:
Thu Aug 26, 2004 6:44 am |
|
Doesn't really say if that validater supports out of date rss 0.91 I'd guess it is for 2.0 but anyway if you hunt around there are some efforts to create updated backend.php out there. |
_________________ [b][size=5]openSUSE 11.4-x86 | Linux 2.6.37.1-1.2desktop i686 | KDE: 4.6.41>=4.7 | XFCE 4.8 | AMD Athlon(tm) XP 3000+ | MSI K7N2 Delta-L | 3GB Black Diamond DDR
| GeForce 6200@433Mhz 512MB | Xorg 1.9.3 | NVIDIA 270.30[/size:2b8 |
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
molten2
New Member
![New Member New Member](modules/Forums/images/ranks/1star.gif)
![](modules/Forums/images/avatars/Misc/x13.gif)
Joined: Jun 27, 2004
Posts: 16
|
Posted:
Thu Aug 26, 2004 6:54 am |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
GeekyGuy
Client
![](modules/Forums/images/avatars/455145a540d60199e57fd.gif)
Joined: Jun 03, 2004
Posts: 302
Location: Huber Heights Ohio
|
Posted:
Thu Aug 26, 2004 7:11 am |
|
I'll get this info added to the next update to the NukeSentinel™ User Guide FAQ. |
_________________ "The Daytona 500 is ours! We won it, we won it, we won it!", Dale Earnhardt, February 15th, 1998, Daytona 500 |
|
![ICQ Number ICQ Number](themes/RavenIce/forums/images/lang_english/icon_icq_add.gif) |
![](themes/RavenIce/forums/images/spacer.gif) |
sixonetonoffun
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Thu Aug 26, 2004 7:16 am |
|
I have to ask what setting has to be anabled to create this issue Bob? Because I just tested a feed and it seems to function ok without the additional code? So I assume ther are specific circumstances under which there is an issue?? |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
molten2
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Thu Aug 26, 2004 7:27 am |
|
in my experience the news feeds don't work only for sentinel protected sites... |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
sixonetonoffun
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Thu Aug 26, 2004 7:46 am |
|
Yes the feed comes from a Sentinel protected site but its shown on a PostNuke site in a core RSS block. Thats why I was wondering what circumstances created an issue with backend.php The one I use is slightly modified but not a lot. Validates fine runs on the mentioned block fine without the updates above? The only blocker not active on the site is the proxy blocker. I surrender! If it's not borke I'm not fixing it lol! |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
molten2
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Thu Aug 26, 2004 8:55 am |
|
try to use the rss reader coming from your_account module in a sentinel (2.0.1) protected site...
instead of reading it with a block. |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
chatserv
Member Emeritus
![](modules/Forums/images/avatars/Risque/fhf215.jpg)
Joined: May 02, 2003
Posts: 1389
Location: Puerto Rico
|
Posted:
Thu Aug 26, 2004 9:17 am |
|
If it works used on a block but doesn't on the YA module try editing its index, find:
Code: if ($fp) {
fputs($fp, "GET " . $rdf['path'] . "?" . $rdf['query'] . " HTTP/1.0\r\n");
|
change to:
Code: if ($fp) {
if ($rdf['query'] != '')
$rdf['query'] = "?" . $rdf['query'];
fputs($fp, "GET " . $rdf['path'] . $rdf['query'] . " HTTP/1.0\r\n");
|
That is the only variant i could find between the two. |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
sixonetonoffun
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Thu Aug 26, 2004 9:51 am |
|
Thanks molten2
I'd have never thought of using the reader in Your Account its not a feature I really think of often.
Though Ravens site will read in the reader mine won't pre or post changes guess I'll have to dig a little more. Works in the blocks fine both before and after but the reader it doesn't and also it validated fine before the changes and now it gives a couple xml parse errors Grr!
Guess I'll keep playing with it and read up on the topic a little. |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
Raven
Site Admin/Owner
![](modules/Forums/images/avatars/45030c033f18773153cd2.gif)
Joined: Aug 27, 2002
Posts: 17088
|
Posted:
Thu Aug 26, 2004 9:51 am |
|
I added your url code. Does the feed from here work now? |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
BobMarion
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Thu Aug 26, 2004 9:58 am |
|
Glad I posted this, used the validator and discovered one other thing.
You also need to change the:Code:header("Content-Type: text/xml");
|
To:Code:header("Content-Type: application/rss+xml");
|
|
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
molten2
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Thu Aug 26, 2004 10:01 am |
|
Yes, It works well now
Thank-you all. |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
BobMarion
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Thu Aug 26, 2004 10:03 am |
|
One thing about title contains bad characters. Since Raven and I both use the (tm) by way of ™ it is getting that error. Until I figure out how to strip out the htmlentities I'll continue to get that error on my feed.
I've updated my backend.php to have this:Code://include("mainfile.php");
require_once("config.php");
require_once("db/db.php");
$row = $db->sql_fetchrow($db->sql_query("SELECT * FROM ".$prefix."_config"));
$sitename = $row[sitename];
$nukeurl = $row[nukeurl];
$backend_title = $row[backend_title];
$backend_language = $row[backend_language];
header("Content-Type: application/rss+xml");
|
Which got rid of all but the htmlentities error reported.
http://feeds.archive.org/validator/check.cgi?url=http://www.nukescripts.net/backend.php |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
Raven
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Thu Aug 26, 2004 10:06 am |
|
So you aren't using the updated header? |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
BobMarion
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Thu Aug 26, 2004 10:11 am |
|
Yes I am , had to edit the post above. Had two different copies of backend.php open at the same time and copied from the wrong one ![Bang Head](modules/Forums/images/smiles/banghead.gif) |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
sixonetonoffun
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Thu Aug 26, 2004 10:20 am |
|
Feed works from here on the Your Account from my site ok. I didnt' try it in a block.
I figured out why it was in part working ok on my PostNuke site in the block its because the PostNuke block adds a referer and user-agent to the fput request.
I haven't figured out why the rest was as it was yet so for the time being I have backend.php for nuke and backend1.php for myself. backend1.php has the image and copyright links though the copyright doesn't get parsed in the block as far as I can tell (From http://dev.queeries.net syndycation mod which I use if I move news out of the home page to run off a center block on the same site neat trick)
But anyway I can live with this cause no one gives a chit about my feeds but me lol! |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
Raven
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Thu Aug 26, 2004 10:51 am |
|
This fixes the $sitename variable, but not the $backend_title as there is no allowance for the non-space character before the entity. I'm sure it can be tweaked. I hacked some code I found on the netCode://include("mainfile.php");
require_once("config.php");
require_once("db/db.php");
$row = $db->sql_fetchrow($db->sql_query("SELECT * FROM ".$prefix."_config"));
$sitename = $row[sitename];
$backend_title = $row[backend_title];
$backend_language = $row[backend_language];
$nukeurl = $row[nukeurl];
$sitename = stripEntities($sitename);
$backend_title = stripEntities($backend_title);
function stripEntities($s) {
$s = preg_replace('!&[^;\s]+;!','',$s); ## remove HTML entities.
$s = preg_replace('![^\w\s]!','',$s); ## remove non-word/space chars.
return $s;
}
header("Content-Type: application/rss+xml");
|
|
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
Raven
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Thu Aug 26, 2004 11:56 am |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
Raven
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Thu Aug 26, 2004 12:00 pm |
|
To clarify, I now have this code for backend.php (this is from v6.9)Code:<?php
/************************************************************************/
/* PHP-NUKE: Advanced Content Management System */
/* ============================================ */
/* */
/* Copyright (c) 2002 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. */
/************************************************************************/
//include("mainfile.php");
require_once("config.php");
require_once("db/db.php");
$row = $db->sql_fetchrow($db->sql_query("SELECT * FROM ".$prefix."_config"));
$sitename = $row[sitename];
$backend_title = $row[backend_title];
$backend_language = $row[backend_language];
$nukeurl = $row[nukeurl];
$sitename = stripEntities($sitename);
$backend_title = stripEntities($backend_title);
function stripEntities($s) {
$s = preg_replace('!&[^;\s]+;!','',$s); ## remove HTML entities.
$s = preg_replace('![^\w\s]!','',$s); ## remove non-word/space chars.
return $s;
}
header("Content-Type: application/rss+xml");
if ($cat != "") {
$sql = "SELECT catid FROM ".$prefix."_stories_cat WHERE title LIKE '%$cat%' LIMIT 1";
$result = $db->sql_query($sql);
$catid = $db->sql_fetchrow($result);
if ($catid == "") {
$sql = "SELECT sid, title FROM ".$prefix."_stories ORDER BY sid DESC LIMIT 10";
$result = $db->sql_query($sql);
} else {
$sql = "SELECT sid, title FROM ".$prefix."_stories WHERE catid='$catid' ORDER BY sid DESC LIMIT 10";
$result = $db->sql_query($sql);
}
} else {
$sql = "SELECT sid, title FROM ".$prefix."_stories ORDER BY sid DESC LIMIT 10";
$result = $db->sql_query($sql);
}
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>".htmlspecialchars($sitename)."</title>\n";
echo "<link>$nukeurl</link>\n";
echo "<description>".htmlspecialchars($backend_title)."</description>\n";
echo "<language>$backend_language</language>\n\n";
while ($row = $db->sql_fetchrow($result)) {
echo "<item>\n";
$title = $row[title];
$title = stripEntities($title);
echo "<title>".htmlspecialchars($title)."</title>\n";
echo "<link>$nukeurl/modules.php?name=News&file=article&sid=$row[sid]</link>\n";
echo "</item>\n\n";
}
echo "</channel>\n";
echo "</rss>";
?>
|
|
Last edited by Raven on Thu Aug 26, 2004 12:59 pm; edited 2 times in total |
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
BobMarion
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Thu Aug 26, 2004 12:55 pm |
|
hehehehe, backend.php hasn't changed since 6.5 thru 7.4 with the exception of Chat's fixes
Anyway, the reason for commenting out the mainfile.php include line is this.
1) Your site is running NukeSentinel
2) I try to add your backend.php to my site thru Blocks Admin
3) With the mainfile pulled into backend.php my sites admin returns an error on adding yoru backend.php:
There is a problem with the RSS file URL
Please check the URL and RSS file name, then try again. |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
|