Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   This topic is locked: you cannot edit posts or make replies.    Ravens PHP Scripts And Web Hosting Forum Index -> NukeSentinel(tm)
Author Message
Raven
Site Admin/Owner



Joined: Aug 27, 2002
Posts: 17088

PostPosted: Thu Aug 26, 2004 1:01 pm Reply with quote

I have edited my last post. Anyway, with that code above, it all validates. Does it work for you now?
 
View user's profile Send private message
BobMarion
Former Admin in Good Standing



Joined: Oct 30, 2002
Posts: 1037
Location: RedNeck Land (known as Kentucky)

PostPosted: Thu Aug 26, 2004 1:12 pm Reply with quote

I uploaded a copy to fullaccess.us which is running NukeSentinel and now I can add his news feed to my site Smile

_________________
Bob Marion
Codito Ergo Sum
http://www.nukescripts.net 
View user's profile Send private message Send e-mail Visit poster's website
molten2
New Member
New Member



Joined: Jun 27, 2004
Posts: 16

PostPosted: Thu Aug 26, 2004 2:12 pm Reply with quote

The Chatserv approach don't resolve the problem... Sad
Raven's backend.php remain unloadable without Bob solution.
for me...
bye
 
View user's profile Send private message Send e-mail Visit poster's website
Raven







PostPosted: Thu Aug 26, 2004 2:38 pm Reply with quote

molten2 wrote:
The Chatserv approach don't resolve the problem... Sad
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







PostPosted: Thu Aug 26, 2004 2:48 pm Reply with quote

It works for me Raven Smile
 
molten2







PostPosted: Thu Aug 26, 2004 2:52 pm Reply with quote

opss, no, it's ok
work for me too Rolling Eyes
 
sixonetonoffun
Spouse Contemplates Divorce



Joined: Jan 02, 2003
Posts: 2496

PostPosted: Thu Aug 26, 2004 3:13 pm Reply with quote

One small issue now IE wants to download the php file backend.php instead of showing the xml document.

_________________
[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 
View user's profile Send private message
Raven







PostPosted: Thu Aug 26, 2004 3:15 pm Reply with quote

Are you clicking on it or using the rss feed block?
 
sixonetonoffun







PostPosted: Thu Aug 26, 2004 3:18 pm Reply with quote

Trying to directly access it maybe thats a feature lol!
 
sixonetonoffun







PostPosted: Thu Aug 26, 2004 3:22 pm Reply with quote

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







PostPosted: Thu Aug 26, 2004 3:49 pm Reply with quote

Everyone give this a try: [ Only registered users can see links on this board! Get registered or login! ]

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 Smile 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







PostPosted: Thu Aug 26, 2004 3:50 pm Reply with quote

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







PostPosted: Thu Aug 26, 2004 3:52 pm Reply with quote

I'm not seeing the [direct] correllation with the original thread Confused

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







PostPosted: Thu Aug 26, 2004 3:53 pm Reply with quote

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







PostPosted: Thu Aug 26, 2004 7:50 pm Reply with quote

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 ( [ Only registered users can see links on this board! Get registered or login! ] ) as compared to having it set to text/rss which simply displays in the browsers xml display system ( [ Only registered users can see links on this board! Get registered or login! ] ).

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 Smile

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: 1164

PostPosted: Thu Aug 26, 2004 8:54 pm Reply with quote

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

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







PostPosted: Thu Aug 26, 2004 9:21 pm Reply with quote

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
Worker



Joined: Apr 14, 2004
Posts: 193

PostPosted: Thu Aug 26, 2004 10:11 pm Reply with quote

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&amp;file=article&amp;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?
 
View user's profile Send private message
Raven







PostPosted: Thu Aug 26, 2004 10:15 pm Reply with quote

Comment it out too.
 
BobMarion







PostPosted: Thu Aug 26, 2004 10:27 pm Reply with quote

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







PostPosted: Thu Aug 26, 2004 11:28 pm Reply with quote

This thread is locked in favor of the new thread at [ Only registered users can see links on this board! Get registered or login! ]
 
Display posts from previous:       
Post new topic   This topic is locked: you cannot edit posts or make replies.    Ravens PHP Scripts And Web Hosting Forum Index -> NukeSentinel(tm)

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 ©