Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> NSN News
Author Message
nb1
Regular
Regular



Joined: Mar 03, 2005
Posts: 94
Location: OZ

PostPosted: Thu Aug 03, 2006 1:31 pm Reply with quote

Here's my question when I make a post it shows the time as
Posted by NB on Wednesday, August 02 @ 05:33:21 EEST
Should it not be
Posted by NB on Wednesday, August 02 @ 05:33:21 EST
I Was trying to validate the backend.php rss feed tells me it needs to be corrected how does one go about doing this ?
NSN News 2.0.0
RavenNuke76 v2.02.02 FULL [ Only registered users can see links on this board! Get registered or login! ]
[ Only registered users can see links on this board! Get registered or login! ]

lastBuildDate must be an RFC-822 date-time: Thu, 03 Aug 2006 06:16:20 EEST

needs to be
<pubDate>Wed, 02 Oct 2002 08:00:00 EST</pubDate>

are these the same problem are two different ones?

_________________
Member Of The Windows Vista help and Support Community 
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
montego
Site Admin



Joined: Aug 29, 2004
Posts: 9457
Location: Arizona

PostPosted: Thu Aug 03, 2006 2:06 pm Reply with quote

nb1, I cannot find this issue in the core PHP-nuke backend (at least for RN), so your backend.php must be a replacement in the NSN News distro? Can you post the code from that script here so we can take a look?

If this is true that it is from NSN News, I will move this thread over to that Forum so it has better visibility as such.

_________________
Where Do YOU Stand?
HTML Newsletter::ShortLinks::Mailer::Downloads and more... 
View user's profile Send private message Visit poster's website
nb1







PostPosted: Thu Aug 03, 2006 2:11 pm Reply with quote

Exactly which script do I need two post ?
 
montego







PostPosted: Thu Aug 03, 2006 2:13 pm Reply with quote

You are saying that your backend.php is not valid right? Post that one please.
 
nb1







PostPosted: Thu Aug 03, 2006 2:15 pm Reply with quote

Code:
<?php


/************************************************************************/
/* PHP-NUKE: Advanced Content Management System                         */
/* ============================================                         */
/*                                                                      */
/* Copyright (c) 2002 by Francisco Burzi                                */
/* http://phpnuke.org                                                   */
/*                                                                      */
/* This program is free software. You can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation; either version 2 of the License.       */
/*                                                                      */
/************************************************************************/
/* Additional coding modifications by Raven 2004                        */
/* http://ravenphpscripts.com -- http://ravenwebhosting.com             */
/************************************************************************/
/* 100% RSS/XML and W3C Compliance by Gaylen Fraley (aka Raven)         */
/* http://ravenphpscripts.com -- http://ravenwebhosting.com             */
/************************************************************************/
$rssFeedLimit = 15;
header("Content-Type: text/xml");
include("mainfile.php");
if (isset($cat) AND !empty($cat)) {
    $cat = intval($cat);
    $catid = $db->sql_fetchrow($db->sql_query("SELECT catid FROM ".$user_prefix."_stories_cat WHERE title LIKE '%$cat%' LIMIT 1"));
    if (empty($catid)) {
      $result = $db->sql_query("SELECT sid, title FROM ".$user_prefix."_stories ORDER BY sid DESC LIMIT $rssFeedLimit");
    } else {
      $catid = intval($catid);
      $result = $db->sql_query("SELECT sid, title FROM ".$user_prefix."_stories WHERE catid='$catid' ORDER BY sid DESC LIMIT $rssFeedLimit");
    }
} else {
    $result = $db->sql_query("SELECT sid, title FROM ".$user_prefix."_stories ORDER BY sid DESC LIMIT $rssFeedLimit");
}

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 = superhtmlentities($row['title']);
    $rtitle = str_replace('_',' ',$rtitle); //added 9/1/2004
    echo "<item>\n";
    echo "<title>".htmlspecialchars($rtitle)."</title>\n";
    echo "<link>$nukeurl/article-$rsid--0-0.html</link>\n";
    echo "</item>\n\n";
}
echo "</channel>\n";
echo "</rss>";

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;
                    case 153:
                    $new_text .= '(tm)';
                    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;
    }
?>

And actually the time and date when posting on man page is incorrect I think this is causing the issue
 
montego







PostPosted: Thu Aug 03, 2006 2:30 pm Reply with quote

This is not the one that is failing validation. In your link from your first post, that one is showing RSS version 2.0. There is no PubDate node in the code you posted.
 
nb1







PostPosted: Thu Aug 03, 2006 2:52 pm Reply with quote

I'm extremely sorry I forgot I had put some extra chatters in front of the original file name for backup purposes Okay my next question is changing the time when the post was made
Posted by NB on Wednesday, August 02 @ 05:33:21 EEST
Should it not be
Posted by NB on Wednesday, August 02 @ 05:33:21 EST
theme is fiapple
 
montego







PostPosted: Thu Aug 03, 2006 3:25 pm Reply with quote

Unfortunately, I am not sure how NSN News is doing it. In the core PHP-Nuke News module, it is formatted in modules/News/article.php (may be a few other places), but it seems to be calling a function in mainfile.php:

// Beta 3 code by Quake 08/19/2005
// Written for Nuke-Evolution and Nuke Patched
function formatTimestamp($time) {
global $datetime, $locale;
setlocale(LC_TIME, $locale);
if (!is_numeric($time)) {
preg_match('/([0-9]{4})-([0-9]{1,2})-([0-9]{1,2}) ([0-9]{1,2})Sad[0-9]{1,2})Sad[0-9]{1,2})/', $time, $datetime);
$time = gmmktime($datetime[4],$datetime[5],$datetime[6],$datetime[2],$datetime[3],$datetime[1]);
}
$time -= date('Z');
$datetime = strftime(_DATESTRING, $time);
$datetime = ucfirst($datetime);
return $datetime;
}

I have a feeling that NSN News is not using this function. It may be a bug but I will need to defer to someone who has NSN News 2.0.0 downloaded and installed. I don't have time to do that right now.

I will move this thread over to the NSN News forum.
 
nb1







PostPosted: Thu Aug 03, 2006 3:30 pm Reply with quote

Thank you sir I do appreciate your time and effort
 
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> NSN News

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 ©