PHP Web Host - Quality Web Hosting For All PHP Applications Free RavenNuke(tm) Add Ons
  Login or Register
 • Home • Downloads • Your Account • Forums • 

View next topic
View previous topic


Google
 
Web RavenPHPScripts (This Site)
Post new topic   This topic is locked: you cannot edit posts or make replies.
Author Message
Raven
Site Admin/Owner


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

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

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 Visit poster's website AIM Address Yahoo Messenger
BobMarion
Former Admin in Good Standing


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

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

I uploaded a copy to fullaccess.us which is running NukeSentinel and now I can add his news feed to my site Smile
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 Back to top

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
Site Admin/Owner


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

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

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?
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger
BobMarion
Former Admin in Good Standing


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

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

It works for me Raven Smile
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:52 pm Reply with quote Back to top

opss, no, it's ok
work for me too Rolling Eyes
View user's profile Send private message Send e-mail Visit poster's website
sixonetonoffun
Spouse Contemplates Divorce


Joined: Jan 02, 2003
Posts: 2499

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

One small issue now IE wants to download the php file backend.php instead of showing the xml document.
View user's profile Send private message
Raven
Site Admin/Owner


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

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

Are you clicking on it or using the rss feed block?
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger
sixonetonoffun
Spouse Contemplates Divorce


Joined: Jan 02, 2003
Posts: 2499

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

Trying to directly access it maybe thats a feature lol!
View user's profile Send private message
sixonetonoffun
Spouse Contemplates Divorce


Joined: Jan 02, 2003
Posts: 2499

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

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.
View user's profile Send private message
BobMarion
Former Admin in Good Standing


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

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

Everyone give this a try:
Only registered users can see links on this board!
Get registered or login to the forums!


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!
View user's profile Send private message Send e-mail Visit poster's website
BobMarion
Former Admin in Good Standing


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

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

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


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

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

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
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger
sixonetonoffun
Spouse Contemplates Divorce


Joined: Jan 02, 2003
Posts: 2499

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

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;
}
View user's profile Send private message
BobMarion
Former Admin in Good Standing


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

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

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

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.
View user's profile Send private message Send e-mail Visit poster's website
64bitguy
The Mouse Is Extension Of Arm


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

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

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
View user's profile Send private message Visit poster's website
BobMarion
Former Admin in Good Standing


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

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

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


Joined: Apr 14, 2004
Posts: 193

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

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
Site Admin/Owner


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

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

Comment it out too.
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger
BobMarion
Former Admin in Good Standing


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

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

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.
View user's profile Send private message Send e-mail Visit poster's website
BobMarion
Former Admin in Good Standing


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

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

This thread is locked in favor of the new thread at
Only registered users can see links on this board!
Get registered or login to the forums!
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:       
Post new topic   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