| Author |
Message |
Raven Site Admin/Owner

Joined: Aug 27, 2002 Posts: 16987 Location: Kansas
|
Posted:
Thu Aug 26, 2004 1:01 pm |
|
I have edited my last post. Anyway, with that code above, it all validates. Does it work for you now? |
|
|
|
 |
BobMarion Former Admin in Good Standing

Joined: Oct 30, 2002 Posts: 1043 Location: RedNeck Land (known as Kentucky)
|
Posted:
Thu Aug 26, 2004 1:12 pm |
|
I uploaded a copy to fullaccess.us which is running NukeSentinel and now I can add his news feed to my site  |
|
|
|
 |
molten2 New Member


Joined: Jun 27, 2004 Posts: 16
|
Posted:
Thu Aug 26, 2004 2:12 pm |
|
The Chatserv approach don't resolve the problem...
Raven's backend.php remain unloadable without Bob solution.
for me...
bye |
|
|
|
 |
Raven Site Admin/Owner

Joined: Aug 27, 2002 Posts: 16987 Location: Kansas
|
Posted:
Thu Aug 26, 2004 2:38 pm |
|
| molten2 wrote: | The Chatserv approach don't resolve the problem...
Raven's backend.php remain unloadable without Bob solution.
for me...
bye | But I have Bob's solution applied. Is mine still not working for you? |
|
|
|
 |
BobMarion Former Admin in Good Standing

Joined: Oct 30, 2002 Posts: 1043 Location: RedNeck Land (known as Kentucky)
|
Posted:
Thu Aug 26, 2004 2:48 pm |
|
It works for me Raven  |
|
|
|
 |
molten2 New Member


Joined: Jun 27, 2004 Posts: 16
|
Posted:
Thu Aug 26, 2004 2:52 pm |
|
opss, no, it's ok
work for me too  |
|
|
|
 |
sixonetonoffun Spouse Contemplates Divorce

Joined: Jan 02, 2003 Posts: 2499
|
Posted:
Thu Aug 26, 2004 3:13 pm |
|
One small issue now IE wants to download the php file backend.php instead of showing the xml document. |
|
|
|
 |
Raven Site Admin/Owner

Joined: Aug 27, 2002 Posts: 16987 Location: Kansas
|
Posted:
Thu Aug 26, 2004 3:15 pm |
|
Are you clicking on it or using the rss feed block? |
|
|
|
 |
sixonetonoffun Spouse Contemplates Divorce

Joined: Jan 02, 2003 Posts: 2499
|
Posted:
Thu Aug 26, 2004 3:18 pm |
|
Trying to directly access it maybe thats a feature lol! |
|
|
|
 |
sixonetonoffun Spouse Contemplates Divorce

Joined: Jan 02, 2003 Posts: 2499
|
Posted:
Thu Aug 26, 2004 3:22 pm |
|
Grr I added description to the backend.php so I had to add it to the reader in your account too before it would work. That thing is like really crude and outdated. |
|
|
|
 |
BobMarion Former Admin in Good Standing

Joined: Oct 30, 2002 Posts: 1043 Location: RedNeck Land (known as Kentucky)
|
Posted:
Thu Aug 26, 2004 3:49 pm |
|
Everyone give this a try:
This is a RSS 2.0 RDF. Tell me what you think of it.
Also, genoxide emailed about an even better fix for the blocking of feeds See below: | Code: | Hello bob,
I've read the feedback about rss and sentinel over raven's site and since i had the snippet against DDoS attacks before it was added in sentinel i have a quick fix for it.
original code
if($ab_config['prevent_dos'] == 1) {
if ($_SERVER['HTTP_USER_AGENT'] == "" || $_SERVER['HTTP_USER_AGENT'] == "-" || !isset($_SERVER['HTTP_USER_AGENT'])) {
die(_AB_GETOUT);
}
}
replace with
if($ab_config['prevent_dos'] == 1) {
if ($_SERVER['HTTP_USER_AGENT'] == "" || (($_SERVER['HTTP_USER_AGENT'] == "-") && !defined('XMLFEED')) || !isset($_SERVER['HTTP_USER_AGENT'])) {
die(_AB_GETOUT);
}
}
Then open backend.php
and add define("XMLFEED","TRUE"); before the include("mainfile.php"); line and u will be all fine, no need to do a sql query again! |
|
|
|
|
 |
BobMarion Former Admin in Good Standing

Joined: Oct 30, 2002 Posts: 1043 Location: RedNeck Land (known as Kentucky)
|
Posted:
Thu Aug 26, 2004 3:50 pm |
|
Oh, the reason IE and FireFox wants to download backend.php now is due to the header("Content-Type: application/rss+xml"); line. If you make it header("Content-Type: text/xml"); it will display in hte broser but won't pass the validators because of the language issue. |
|
|
|
 |
Raven Site Admin/Owner

Joined: Aug 27, 2002 Posts: 16987 Location: Kansas
|
Posted:
Thu Aug 26, 2004 3:52 pm |
|
I'm not seeing the [direct] correllation with the original thread
Are you using the other code above?
What if you don't have the dDos setting ON?
What if you have to use a proxy? I believe that code won't allow a proxy?
I'm not slamming the code, I just need clarification. |
Last edited by Raven on Thu Aug 26, 2004 3:54 pm; edited 1 time in total |
|
|
 |
sixonetonoffun Spouse Contemplates Divorce

Joined: Jan 02, 2003 Posts: 2499
|
Posted:
Thu Aug 26, 2004 3:53 pm |
|
Nice on both counts Bob
Here is a little snippet off phpnet I modified a little to return the last 5 sentences or 500 words which ever comes first. Might be useful.
function doti($str, $len=500, $dots = "...") {
if (strlen($str) > $len) {
$str = explode(".", $str);
$dotlen = strlen($dots);
$str = substr_replace($str[0].$str[1].$str[2].$str[3].$str[4], $dots, $len - $dotlen);
}
return $str;
} |
|
|
|
 |
BobMarion Former Admin in Good Standing

Joined: Oct 30, 2002 Posts: 1043 Location: RedNeck Land (known as Kentucky)
|
Posted:
Thu Aug 26, 2004 7:50 pm |
|
I believe he is referering to just typing it into the browsers address bar. When you have the header set the content to application/rss+xml it opens a download stream ( ) as compared to having it set to text/rss which simply displays in the browsers xml display system ( ).
In nuke it shows up the same no matter which of the two header contents you set since it pulls it as a stream and then parses it unlike the browser which parses dependant on the header content setting
It's not directly related to the topic but a valid point due to the change of header content settings changing how your browser reacts when entering the path to the backend.php in it's address bar. |
|
|
|
 |
64bitguy The Mouse Is Extension Of Arm

Joined: Mar 06, 2004 Posts: 1156 Location: Sanbornton, NH USA
|
Posted:
Thu Aug 26, 2004 8:54 pm |
|
Not to go off on a rant or anything, but all of the code offered in this thread is making my head spin.... I'm not sure exactly WHICH code I should be using now.
I must ask the questions:
Should there be two backends now?
one for the old RSS style and one for the new?
I read the RSS reader in the YA posts, but I haven't had any problems reading ANYONE'S feeds in via my YA module... Am I missing something here? As far as I know (given that you can only read one site at a time) none of my users are using this feature anyway... Has something (in terms of an RSS reader inside YA) evolved that I don't know about?
Anyway, to sum up with one last question, is there a way we can turn this into a sticky with just the information that we need regarding exactly how the backend.php should look? And if we are going to have 2 backend files (one for the 2.0 RSS readers) can someone provide the code for each one of those files?
Thanks |
|
|
|
 |
BobMarion Former Admin in Good Standing

Joined: Oct 30, 2002 Posts: 1043 Location: RedNeck Land (known as Kentucky)
|
Posted:
Thu Aug 26, 2004 9:21 pm |
|
I'm going to make two new threads. 1) to cover the change(s) in backend.php relating to nuke it's self abd 2) to cover the change(s) in backend.php reltaing to valodating and and direct browser linkage. |
|
|
|
 |
dean Worker


Joined: Apr 14, 2004 Posts: 193
|
Posted:
Thu Aug 26, 2004 10:11 pm |
|
My code for backend in nuke 7.3 is slightly different:
| Code: | include("mainfile.php");
global $prefix, $db, $nukeurl;
header("Content-Type: text/xml");
$cat = intval($cat);
if ($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 FROM ".$prefix."_stories ORDER BY sid DESC LIMIT 10");
} else {
$catid = intval($catid);
$result = $db->sql_query("SELECT sid, title FROM ".$prefix."_stories WHERE catid='$catid' ORDER BY sid DESC LIMIT 10");
}
} else {
$result = $db->sql_query("SELECT sid, title 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>".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)) {
$rsid = intval($row['sid']);
$rtitle = $row['title'];
echo "<item>\n";
echo "<title>".htmlspecialchars($rtitle)."</title>\n";
echo "<link>$nukeurl/modules.php?name=News&file=article&sid=$rsid</link>\n";
echo "</item>\n\n";
}
echo "</channel>\n";
echo "</rss>";
?> |
Theres a global line in between the first two lines you suggested editing. Should I delete that also? |
|
|
|
 |
Raven Site Admin/Owner

Joined: Aug 27, 2002 Posts: 16987 Location: Kansas
|
Posted:
Thu Aug 26, 2004 10:15 pm |
|
|
|
 |
BobMarion Former Admin in Good Standing

Joined: Oct 30, 2002 Posts: 1043 Location: RedNeck Land (known as Kentucky)
|
Posted:
Thu Aug 26, 2004 10:27 pm |
|
I've been doing even more testing and found some very usefull information and a patch that will work without editing anything other then includes/sentinel.php and I will post that in a new thread. This thread has been very helpfull in the testing process and I would like to lock it to direct reads to the new thread once I start it. |
|
|
|
 |
BobMarion Former Admin in Good Standing

Joined: Oct 30, 2002 Posts: 1043 Location: RedNeck Land (known as Kentucky)
|
Posted:
Thu Aug 26, 2004 11:28 pm |
|
This thread is locked in favor of the new thread at |
|
|
|
 |
|
|
|
|