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™
Author Message
beetraham
Regular
Regular


Joined: Dec 13, 2003
Posts: 94
Location: Finland (EU)

PostPosted: Tue Oct 26, 2004 8:54 am Reply with quote

NukeSentinel™ and RSS feeds via backenddownloads.php

Please find attached fairly sufficiently tested/validated Add-On to be used for providing RSS Feeds on PHP-Nuke Site's Downloads "News".

The underneath code is 99% unison with the mainframe approach(es) provided by ChatServ, BoB, Raven & several other People at RavenPHPScripts' Forums.

Code:


<?php
/************************************************************************/
/* PHP-NUKE: Advanced Content Management System                         */
/* ============================================                         */
/*                                                                      */
/* Copyright (c) 2002 by Francisco Burzi                                */
/* http://phpnuke.org                                                   */
/* http://thatware.org (PHP-Nuke originated from)                       */
/*                                                                      */
/* 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.       */
/*                                                                      */
/************************************************************************/
/* By beetraham (c) 2004 along with the given guidelines provided by the*/
/* additionally generated security checking code by chatserv (c) 2003   */
/* [chatserv @ http://www.nukefixes.com | http://www.nukeresources.com] */
/* [beetraham aka ZenoCide | http://www.ec-clan.org]                    */
/*                                                                      */
/* PHP-Nuke Environment & Test Compatibility Characteristics [Oct-26-04]*/
/*   - PHP-Nuke v7.3                                                    */
/*   - Sentinel(TM) 2.1.0                                               */
/*   - Admin Secure v1.7                                                */
/*   - EDL 2.1                                                          */
/*   - "More News" RSS Feed Parser (OK)                                 */
/*   - "My Headlines" PHP-Nuke, Built-In RSS Feed Parser (OK)           */
/*   - Feed Validator FOR ATOM AND RSS                                  */
/*      <-> http://feeds.archive.org/validator/check.cgi... (OK)        */
/*                                                                      */
/************************************************************************/

//include("mainfile.php");
require_once("config.php");
require_once("db/db.php");
$row = $db->sql_fetchrow($db->sql_query("SELECT * FROM ".$prefix."_config"));
$sitename = $row[sitename];
$nukeurl = $row[nukeurl];
$backend_title = $row[backend_title];
$backend_language = $row[backend_language];

header("Content-Type: application/rss+xml");

$result = $db->sql_query("SELECT lid, cid, title, date, name FROM ".$prefix."_downloads_downloads ORDER BY lid 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 ($row2 = $db->sql_fetchrow($result)) {
    $lid = intval($row2['lid']);
    $cid = intval($row2['cid']);
    $title = $row2['title'];
    $title2 = ereg_replace(" ", "_", $title);
    $date = $row2['date'];
    $name = $row2['name'];
    echo "<item>\n";
    echo "<title>".htmlspecialchars($title)." [added: ".$date." | author: ".htmlspecialchars($name)."]</title>\n";
    echo "<link>$nukeurl/modules.php?name=Downloads&amp;d_op=viewdownloaddetails&amp;cid=$cid&amp;lid=$lid&amp;ttitle=$title2#dldetails</link>\n";
    echo "</item>\n\n";
}
echo "</channel>\n";
echo "</rss>";

?>



RSS Feed Reader Screenshots:

RSS Feed Reader : *More News*, PHP-Nuke dedicated RSS Feed Reader (modified)

Image
RSS Feed Reader : *My Headlines*, PHP-Nuke Built-In RSS Feed Reader* (PHP-Nuke 7.3, standard)

Image


Regards,

-beetraham

_________________
- Let there be no windows at your home - 
View user's profile Send private message
64bitguy
The Mouse Is Extension Of Arm


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

PostPosted: Wed Oct 27, 2004 12:55 am Reply with quote

That may or may not be valid depending on what the link properties/contents are. In some cases, the validator doesn't like them (actually, it didn't like MOST of mine). I'm not sure what can be done about this for those that aren't running GoogleTap, but for those that are, by replacing the link properties with the hard coded GoogleTap properties, it fixes the problem while also making the backend file Already GoogleTapped.

For example, in my case, (using GT-NextGen), I changed the link properties from the long ugly php code:
Code:
echo "<link>$nukeurl/modules.php?name=Downloads&amp;d_op=viewdownloaddetails&amp;cid=$cid&amp;lid=$lid&amp;ttitle=$title2#dldetails</link>\n";


To:

Code:
    echo "<link>$nukeurl/downloadview-details-".$cid."-".$lid.".html</link>\n";



Tada! Validated, where it would not before!
Only registered users can see links on this board! Get registered or login!

Smile

More and more I think it's important that only FULLY validated solutions be published. I guess the reason why is that now that I'm reading a lot of feeds in my Syndicated News module, I get really frustrated when I run into feeds that aren't valid and that instead generate errors. (I hate it when that happens... Don't you just hate it when that happens?). Smile

Anyway... Just thought I'd provide this input and solution for anyone else that can use it!

_________________
Steph Benoit Only registered users can see links on this board! Get registered or login!
1CMS, 100% Section 508 and W3C XHTML/CSS Compliant (Truly) 
View user's profile Send private message Visit poster's website
beetraham
PostPosted: Wed Oct 27, 2004 9:08 am Reply with quote

64bitguy,

First of all, thank you for your excellent feedback on implicitly pointing out an IMPORTANT GENERAL ISSUE, which as resolved, will dramatically boost the contemporary QUALITY related to PHP-Nuke associated RSS Feeds' - USABILITY and INTEGRITY to it.

Furthemore, the reply of yours may well be considered as a fire starter pointing out a need to consider necessary actions to be taken in order to have RSS Feeds STANDARDIZED WITHIN the PHP-Nuke Community (before things get *really wild* in uncontrollable sense). This being said, I'd therefore like to "suggest"/"inquire" a possibility to consider opening up a FORUM being dedicated for PHP-Nuke RSS BACKEND ISSUES ONLY.

Clearly, there's an extreme unchained WILD potential out there, and as a conquence, we probably need to figure out the necessary means to have it brought (back) under the control - a.s.a.p.

Please find inline my comments to your feedback/clarification in (2) sections + CONCLUSIONS


Quote:

That may or may not be valid depending on what the link properties/contents are. In some cases, the validator doesn't like them (actually, it didn't like MOST of mine). I'm not sure what can be done about this for those that aren't running GoogleTap, but for those that are, by replacing the link properties with the hard coded GoogleTap properties, it fixes the problem while also making the backend file Already GoogleTapped.

For example, in my case, (using GT-NextGen), I changed the link properties from the long ugly php code:

Code:
 

echo "<link>$nukeurl/modules.php?name=Downloads&amp;d_op=viewdownloaddetails&amp;cid=$cid&amp;lid=$lid&amp;ttitle=$title2#dldetails</link>\n";


To:

Code:
 

    echo "<link>$nukeurl/downloadview-details-".$cid."-".$lid.".html</link>\n";



Tada! Validated, where it would not before!
Only registered users can see links on this board! Get registered or login!



The RSS Feed Validation outcome, as per your made/confirmed observations, may indeed differ, when applying *an approach* different to that of being stated to have used in *code's VALIDATION STAGE [header section insert];

Code:


/* PHP-Nuke Environment & Test Compatibility Characteristics [Oct-26-04]*/
/*   - PHP-Nuke v7.3                                                    */
/*   - Sentinel(TM) 2.1.0                                               */
/*   - Admin Secure v1.7                                                */
/*   - EDL 2.1                                                          */
/*   - "More News" RSS Feed Parser (OK)                                 */
/*   - "My Headlines" PHP-Nuke, Built-In RSS Feed Parser (OK)           */
/*   - Feed Validator FOR ATOM AND RSS                                  */
/*      <-> http://feeds.archive.org/validator/check.cgi... (OK)        */


As a general made observation; so far I have not been acquinted with a PHP-Nuke *backend[xxx].php* entities that would EXPLICITLY cover all the configuration line-ups regarding *Google Tapping" characterized approach either applied or not actively in mod-rewriting the URLs being specific to PHP-Nuke Environment. (just as a background clarification...)

So, the latter mentioned being the very reason for NOT EQUIPPING the *Code* with *Google Tapped* support (any form of GT), I have therefore left it totally up to end-user to ALTER THE CODE ARCHITECTURE per needs originating from existing differencies in CASE SPECIFIC PHP-Nuke Enviroment(s) (just like most of the Authors have dealt in past with publishing equal entities)

Quote:

More and more I think it's important that only FULLY validated solutions be published. I guess the reason why is that now that I'm reading a lot of feeds in my Syndicated News module, I get really frustrated when I run into feeds that aren't valid and that instead generate errors. (I hate it when that happens... Don't you just hate it when that happens?).

Anyway... Just thought I'd provide this input and solution for anyone else that can use it!


[Please do note that due to cultural differencies (and the present language barrier Smile ), it's extremely difficult for me to indirectly express my strong will in attempt to be constructive and polite herein - i.e. I'm not being either attacking or defensive herein. There's really no substitute for open discussion.]

In case that the reference; "only FULLY validated solutions be published", is intended to imply a potential failure in VALIDATING the CODE entity regarding to present non-GT'ed approach, I'd then wish to inform gently disagreeing, as per currently existing information on CODE's VALIDITY AND PERFORMANCE within a PHP-Nuke Enviroment being stated in the *header section of the CODE*.

On the other hand, if the "implication" is addressed as a general statement on the preferable QUALITY STANDARDS, then I fully agree.


Now, let's get down to the CONCLUSIONS...


In my opinion your observation is extremely valuable *knock-off* to all of us (those), who are struggling in the presence of *apparently corrupted* RSS Feeds.

Your observation raises is question (at least this one) - whether or not we should get organized, and assemble our powers to create STANDARDIZED *backend[xxx].php* ENTITIES, preferably in CVS managed environment [CVS == version control system]) for PHP-Nuke Community via such approach, that would cover the most generally applied PHP-Nuke *configurations*, such as:

Legend (as per given example naming convention guideline (by 64bitguy) making it differ from existing wild copies of *backend[xxx].php entities)
* backend-news.php (PHP-Nuke *News Module* dedicated XML RSS Driver)
* backend-forums.php (PHP-Nuke *Forums Module* dedicated XML RSS Driver)
* backend-downloads.php (PHP-Nuke *Downloads Module* dedicated XML RSS Driver)

Quote:

PHP-Nuke ["6.5-7.4"]

#
# *** backend-news.php ***
#

- standard PHP-Nuke [non *Google Tapped* approach]
- standard PHP-Nuke [*Google Tapped* approach - "variant#1"]
- standard PHP-Nuke [*Google Tapped* approach - "variant#2"]
...
- standard PHP-Nuke [*Google Tapped* approach - "variant#n"]

#
# *** backend-forums.php ***
#

- standard PHP-Nuke [non *Google Tapped* approach]
- standard PHP-Nuke [*Google Tapped* approach - "variant#1"]
- standard PHP-Nuke [*Google Tapped* approach - "variant#2"]
...
- standard PHP-Nuke [*Google Tapped* approach - "variant#n"]

#
# *** backend-downloads.php ***
#

- standard PHP-Nuke [non *Google Tapped* approach]
- standard PHP-Nuke [*Google Tapped* approach - "variant#1"]
- standard PHP-Nuke [*Google Tapped* approach - "variant#2"]
...
- standard PHP-Nuke [*Google Tapped* approach - "variant#n"]


Quote:

PHP-Nuke ["7.5" - if the required approach is different to that of "6.5-7.4"]

(same basic line-up requirements as above, in case that an altered approach would be required)


So, how about some more discussion on this Topic? I'd really appreciate it, as I sense that it might be well worth for focusing to.

All comments appreciated.

BR,

-beetraham
 
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> NukeSentinel™

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 ©