Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> NukeSentinel(tm)
Author Message
Raven
Site Admin/Owner



Joined: Aug 27, 2002
Posts: 17088

PostPosted: Wed Sep 01, 2004 12:36 am Reply with quote

Please watch the language Wink I edited your post.

I just modified my backend.php for 2.0 (hopefully). Try it and let me know.
 
View user's profile Send private message
sixonetonoffun
Spouse Contemplates Divorce



Joined: Jan 02, 2003
Posts: 2496

PostPosted: Wed Sep 01, 2004 6:35 am Reply with quote

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 
View user's profile Send private message
VxJasonxV
New Member
New Member



Joined: Sep 01, 2004
Posts: 6

PostPosted: Wed Sep 01, 2004 6:32 pm Reply with quote

My apologies.
 
View user's profile Send private message
Raven







PostPosted: Wed Sep 01, 2004 8:00 pm Reply with quote

VxJasonxV wrote:
My apologies.
NP!
 
VxJasonxV







PostPosted: Wed Sep 01, 2004 8:33 pm Reply with quote

It seems as if a recent title update (or something of that sort) broke your feed once again.
feedvalidator.org's validator results.
 
Raven







PostPosted: Wed Sep 01, 2004 8:40 pm Reply with quote

I'm working on trying to get htmlenities in but there is no way. It should be fixed momentarily.
 
VxJasonxV







PostPosted: Wed Sep 08, 2004 8:21 pm Reply with quote

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
New Member



Joined: Sep 15, 2004
Posts: 1

PostPosted: Wed Sep 15, 2004 3:49 pm Reply with quote

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&amp;file=article&amp;sid=$row[sid]</link>\n";
        echo "      <description>$hometext</description>\n";
        echo "      <pubDate>$pubdate</pubDate>\n";
        echo "      <guid>$nukeurl/modules.php?name=News&amp;file=article&amp;sid=$row[sid]</guid>\n";
        echo "    </item>\n\n";
    }
    echo "    </channel>\n\n";
    echo "</rss>";
?>
 
View user's profile Send private message
VxJasonxV







PostPosted: Wed Sep 15, 2004 8:35 pm Reply with quote

You sir (ma'am?) are a winner Smile.
 
VxJasonxV







PostPosted: Tue Sep 21, 2004 2:44 pm Reply with quote

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

PostPosted: Sat Oct 09, 2004 1:20 am Reply with quote

I give. I've done everything Bob has suggested. I'm running Sentinal 2.02. No good for me.
 
View user's profile Send private message
Raven







PostPosted: Sat Oct 09, 2004 1:44 am Reply with quote

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







PostPosted: Sat Oct 09, 2004 1:47 am Reply with quote

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







PostPosted: Sat Oct 09, 2004 1:59 am Reply with quote

I just replaced your backend.php file and when I click on this [ Only registered users can see links on this board! Get registered or login! ] it looks perfect. When I look at the newsfeed via Your Account, it looks perfect. Are you ok now?
 
Deseroka







PostPosted: Sat Oct 09, 2004 2:06 am Reply with quote

Yes, thank you Raven. How come when you do what I just did, it always works for you?? You got that magic touch!
 
Raven







PostPosted: Sat Oct 09, 2004 2:07 am Reply with quote

worship RavensScripts The ring is extended
 
64bitguy
The Mouse Is Extension Of Arm



Joined: Mar 06, 2004
Posts: 1164

PostPosted: Sat Oct 09, 2004 2:08 am Reply with quote

Midas eh?

I've got a couple of 0.91 feeds I've been playing with:
[ Only registered users can see links on this board! Get registered or login! ] is my regular feed. [ Only registered users can see links on this board! Get registered or login! ] is my new "special" feed.

Check them out in Firefox. Smile

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







PostPosted: Sat Oct 09, 2004 2:14 am Reply with quote

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







PostPosted: Sat Oct 09, 2004 2:18 am Reply with quote

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







PostPosted: Sat Oct 09, 2004 2:23 am Reply with quote

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







PostPosted: Sat Oct 09, 2004 2:33 am Reply with quote

That's my girl Wink
 
64bitguy







PostPosted: Sat Oct 09, 2004 2:35 am Reply with quote

Hmmm... Your dynamic menu is messing up your header in Firefox....

You must have a lot of ads in there too Sad 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







PostPosted: Sat Oct 09, 2004 10:18 am Reply with quote

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







PostPosted: Sat Oct 09, 2004 5:04 pm Reply with quote

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
Quote:
</scccript>
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







PostPosted: Sat Oct 09, 2004 5:09 pm Reply with quote

Thanks, 64! I'll give it a go sometime this weekend!
 
Display posts from previous:       
Post new topic   Reply to topic    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 ©