Author |
Message |
Raven
Site Admin/Owner

Joined: Aug 27, 2002
Posts: 17088
|
Posted:
Wed Sep 01, 2004 12:36 am |
|
Please watch the language I edited your post.
I just modified my backend.php for 2.0 (hopefully). Try it and let me know. |
|
|
|
 |
sixonetonoffun
Spouse Contemplates Divorce

Joined: Jan 02, 2003
Posts: 2496
|
Posted:
Wed Sep 01, 2004 6:35 am |
|
Quote: |
Again, the other code provided in this thread SHOULD NOT BE USED as it corrupts the data in your feeds, whereas this code does not.
|
I don't agree with you. But thats ok. |
_________________ [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 |
|
|
 |
VxJasonxV
New Member


Joined: Sep 01, 2004
Posts: 6
|
Posted:
Wed Sep 01, 2004 6:32 pm |
|
|
|
 |
Raven

|
Posted:
Wed Sep 01, 2004 8:00 pm |
|
VxJasonxV wrote: | My apologies. | NP! |
|
|
|
 |
VxJasonxV

|
Posted:
Wed Sep 01, 2004 8:33 pm |
|
It seems as if a recent title update (or something of that sort) broke your feed once again.
Only registered users can see links on this board! Get registered or login!. |
|
|
|
 |
Raven

|
Posted:
Wed Sep 01, 2004 8:40 pm |
|
I'm working on trying to get htmlenities in but there is no way. It should be fixed momentarily. |
|
|
|
 |
VxJasonxV

|
Posted:
Wed Sep 08, 2004 8:21 pm |
|
I'm trying to kinda hack the RSS2 together with the new header information, and the queries and variables from the first post. I added in all the image information and now all I'm stuck on is:
This feed does not validate.
line 12, column 19: lastBuildDate must be an RFC-822 date [help]
<lastBuildDate></lastBuildDate>
line 13, column 20: managingEditor must include an email address [help]
<managingEditor></managingEditor>
line 14, column 15: webMaster must include an email address [help]
<webMaster></webMaster>
Those lines in the backend2.php are:
echo " <lastBuildDate>$last_built</lastBuildDate>\n";
echo " <managingEditor>$adminmail</managingEditor>\n";
echo " <webMaster>$adminmail</webMaster>\n";
Where are those variables supposed to be populated? |
|
|
|
 |
jureboga
New Member


Joined: Sep 15, 2004
Posts: 1
|
Posted:
Wed Sep 15, 2004 3:49 pm |
|
Here you the valid RSS2 feed generator:
Code:<?php
/********************************************************/
/* NukeSentinel(tm) Universal */
/* By: NukeScripts Network (webmaster@nukescripts.net) */
/* http://www.nukescripts.net */
/* Copyright © 2000-2004 by NukeScripts Network */
/********************************************************/
/* Based on: */
/* PHP-NUKE's: backend.php file */
/********************************************************/
include("mainfile.php");
$sitename = stripEntities($sitename);
$backend_title = stripEntities($backend_title);
$last_built = gmdate("D, d M Y H:i:s")." GMT";
$copy_year = "Copyright ".date("Y");
function stripEntities($s) {
$s = preg_replace('!&[^;\s]+;!', '', $s);
## remove HTML entities.
$s = preg_replace('![^\w\s]!', '', $s);
## remove non-word/space chars.
return $s;
}
function superhtmlentities($text) {
// Thanks to mirrorball_girl for this
$entities = array(128 => 'euro', 130 => 'sbquo', 131 => 'fnof', 132 => 'bdquo', 133 => 'hellip', 134 => 'dagger', 135 => 'Dagger', 136 => 'circ', 137 => 'permil', 138 => 'Scaron', 139 => 'lsaquo', 140 => 'OElig', 145 => 'lsquo', 146 => 'rsquo', 147 => 'ldquo', 148 => 'rdquo', 149 => 'bull', 150 => '#45', 151 => 'mdash', 152 => 'tilde', 153 => 'trade', 154 => 'scaron', 155 => 'rsaquo', 156 => 'oelig', 159 => 'Yuml');
$new_text = '';
for($i = 0; $i < strlen($text); $i++) {
$num = ord($text {
$i }
);
if (array_key_exists($num, $entities)) {
switch ($num) {
case 150:
$new_text .= '-';
break;
default:
$new_text .= '&'.$entities[$num].';';
}
}
else
if ($num < 127 || $num > 159) {
$new_text .= htmlentities($text {
$i }
);
}
}
$new_text = ereg_replace(" +", " ", $new_text);
## remove double spaces.
return $new_text;
}
function doti($str, $len = 500, $dots = "...") {
// $len=max length of hometext displayed
if (strlen($str) > $len) {
// $dot = " whatever you want here ")
$str = explode(".", $str);
// Displayed at the end of hometext
$dotlen = strlen($dots);
$str = substr_replace($str[0].$str[1].$str[2].$str[3].$str[4], $dots, $len - $dotlen);
}
return $str;
}
header("Content-Type: text/xml");
$cat = intval($cat);
$topic = intval($topic);
if ($cat != "") {
$sql = "SELECT * FROM ".$prefix."_stories WHERE catid='$catid' ORDER BY sid DESC LIMIT 10";
$result = $db->sql_query($sql);
} elseif ($topic != "") {
$sql = "SELECT * FROM ".$prefix."_stories WHERE topic='$topic' ORDER BY sid DESC LIMIT 10";
$result = $db->sql_query($sql);
} else {
$sql = "SELECT * FROM ".$prefix."_stories ORDER BY sid DESC LIMIT 10";
$result = $db->sql_query($sql);
}
echo "<?xml version=\"1.0\"?>\n\n";
echo "<rss version=\"2.0\">\n\n";
echo " <channel>\n";
echo " <title>".htmlspecialchars($sitename)."</title>\n";
echo " <link>$nukeurl</link>\n";
echo " <description>".htmlspecialchars($backend_title)."</description>\n";
echo " <copyright>$copy_year $sitename</copyright>\n";
echo " <generator>$sitename $Version_Num</generator>\n";
echo " <language>$backend_language</language>\n";
echo " <lastBuildDate>$last_built</lastBuildDate>\n";
echo " <managingEditor>$adminmail</managingEditor>\n";
echo " <webMaster>$adminmail</webMaster>\n";
echo " <ttl>60</ttl>\n\n";
echo " <image>\n";
echo " <title>".htmlspecialchars($sitename)."</title>\n";
echo " <url>$nukeurl/images/sxml.gif</url>\n";
echo " <link>$nukeurl</link>\n";
echo " <width></width>\n"; // Max width is 144 pixels
echo " <height></height>\n"; // Max height is 400 pixels
echo " <description>".check_html($backend_title, "nohtml")."</description>\n";
echo " </image>\n\n";
while ($row = $db->sql_fetchrow($result)) {
$title = $row[title];
$title = stripEntities($title);
$hometext = $row[hometext];
$hometext = check_html($hometext, "nohtml");
$hometext = doti($hometext);
$hometext = superhtmlentities($hometext);
$pubdate = gmdate("D, d M Y H:i:s", strtotime($row['time']))." GMT";
echo " <item>\n";
echo " <title>".htmlspecialchars($title)."</title>\n";
echo " <link>$nukeurl/modules.php?name=News&file=article&sid=$row[sid]</link>\n";
echo " <description>$hometext</description>\n";
echo " <pubDate>$pubdate</pubDate>\n";
echo " <guid>$nukeurl/modules.php?name=News&file=article&sid=$row[sid]</guid>\n";
echo " </item>\n\n";
}
echo " </channel>\n\n";
echo "</rss>";
?>
|
|
|
|
|
 |
VxJasonxV

|
Posted:
Wed Sep 15, 2004 8:35 pm |
|
You sir (ma'am?) are a winner . |
|
|
|
 |
VxJasonxV

|
Posted:
Tue Sep 21, 2004 2:44 pm |
|
It appears that the RSS2 backend.php now strips line breaks... formatting is kind of iffy. |
|
|
|
 |
Deseroka
Client

Joined: Apr 15, 2003
Posts: 466
Location: FL
|
Posted:
Sat Oct 09, 2004 1:20 am |
|
I give. I've done everything Bob has suggested. I'm running Sentinal 2.02. No good for me. |
|
|
|
 |
Raven

|
Posted:
Sat Oct 09, 2004 1:44 am |
|
Deseroka wrote: | I give. I've done everything Bob has suggested. I'm running Sentinal 2.02. No good for me. | What's the problem? |
|
|
|
 |
Deseroka

|
Posted:
Sat Oct 09, 2004 1:47 am |
|
Still comes up with "there is a problem with the news from this site right now".
Not like I had people beating at the door wanting it, just bugs me that it doesn't work. |
|
|
|
 |
Raven

|
Posted:
Sat Oct 09, 2004 1:59 am |
|
I just replaced your backend.php file and when I click on this http://redwebz.org/backend.php it looks perfect. When I look at the newsfeed via Your Account, it looks perfect. Are you ok now? |
|
|
|
 |
Deseroka

|
Posted:
Sat Oct 09, 2004 2:06 am |
|
Yes, thank you Raven. How come when you do what I just did, it always works for you?? You got that magic touch! |
|
|
|
 |
Raven

|
Posted:
Sat Oct 09, 2004 2:07 am |
|
The ring is extended |
|
|
|
 |
64bitguy
The Mouse Is Extension Of Arm

Joined: Mar 06, 2004
Posts: 1164
|
Posted:
Sat Oct 09, 2004 2:08 am |
|
Midas eh?
I've got a couple of 0.91 feeds I've been playing with:
http://64bit.us/backend.php is my regular feed.
http://64bit.us/backendfull1.php is my new "special" feed.
Check them out in Firefox.  |
_________________ Steph Benoit
100% Section 508 and W3C HTML5 and CSS Compliant (Truly) Code, because I love compliance. |
|
|
 |
Deseroka

|
Posted:
Sat Oct 09, 2004 2:14 am |
|
I'm smooching away too! Hey this is a prime moment for me to remind all the members that it's time to cough up a couple of bucks to help support the site. I know if I managed to come up with a couple of bucks, most of you can too. Funny thing is, I usually get it back within a day or two in donations at my site.
64, I'm just happy to have my regular backend working, LOL I might get a bit of extra exposure from some of the other Native sites on the web if I can offer this to them. |
|
|
|
 |
64bitguy

|
Posted:
Sat Oct 09, 2004 2:18 am |
|
Well, you should modify your profile to show your site name.. (see my www icon?) that way I can at least see it.. maybe add it to my syndicated news module too if it's really cool!  |
|
|
|
 |
Deseroka

|
Posted:
Sat Oct 09, 2004 2:23 am |
|
I forgot that I needed to re-add that. Thanks for the reminder. I removed it one day when having some trouble with getting Sentinal right. I figured since I had just announced that I was defenseless, I would not tell anyone where I was at.
Female reasoning, what can I say?? |
|
|
|
 |
Raven

|
Posted:
Sat Oct 09, 2004 2:33 am |
|
That's my girl  |
|
|
|
 |
64bitguy

|
Posted:
Sat Oct 09, 2004 2:35 am |
|
Hmmm... Your dynamic menu is messing up your header in Firefox....
You must have a lot of ads in there too cause I see about 10 empty boxes on my screen (I should mention that I filter about 2000 ad providers in my hosts file.) |
|
|
|
 |
Deseroka

|
Posted:
Sat Oct 09, 2004 10:18 am |
|
Yeah, you can't please all of the browsers all of the time. Most if my visitors are using IE. The sites too large to try to list it all with just links.
There are alot of ads. The site runs entirely on ad sales and donations. A necessary evil if I wish to keep the darn thing up and running. Thanks for the thought tho.. |
|
|
|
 |
64bitguy

|
Posted:
Sat Oct 09, 2004 5:04 pm |
|
Well, I could tell you how to fix it, but I can't post the correcting code in here... Blast those nuke restriction requirements that prevent me from saying the word J-A B A S C L I P T! In the below code, I have to say because I can't say the other word.... without causing a crash... anyway..
You'd think by now, there'd be a way to make forum data inside certain things be just text and non-interpretable...... Which supposedly is the case now for PHPbb forums in [ code ] statements... but oh well, not here.
In a nutshell, the problem is with the code:
Code:<!--//
new menu (MENU_ITEMS, MENU_POS, MENU_STYLES);
//-->
</scccript>
</center><br><br>
|
AND THE 4 Lines of code above that, which I can't say in here.... that are in your header.php.
That section needs to be CUT out of there and PASTED up JUST before the line that reads:
Code:<!-- PayPopup.com Advertising Code Begin -->
|
|
|
|
|
 |
Deseroka

|
Posted:
Sat Oct 09, 2004 5:09 pm |
|
Thanks, 64! I'll give it a go sometime this weekend! |
|
|
|
 |
|