Welcome, Guest. Please login or register.
Did you miss your activation email?
May 27, 2012, 04:17:10 AM

Login with username, password and session length
Search:     Advanced search
Wollen Sie dem WebsiteBaker Team beitreten?
Nähere Informationen finden Sie unter hier und auf unserer neuen Webseite.
155555 Posts in 21715 Topics by 7737 Members
Latest Member: gx-world
* Home Help Search Login Register
Pages: [1]   Go Down
Print
Author Topic: RSS Feeder for Individual News Pages  (Read 2963 times)
mercator

Offline Offline

Posts: 79


« on: March 15, 2008, 02:55:12 PM »

Module RSSFeeder - for WB 2.6.x and 2.7

Purpose:  This modules creates individual RSS feeds of the News post of a page.

Installation: Download the ZIP and install it in the WebsiteBaker Administration (Add-ons -> Modules -> Install Module). That's it.

Activation: Add this page module as a new section to a page containing a News module. It will then create a respective RSS feed of the 10 latest news and show an RSS icon. Note that the page must be visible (public). Otherwise, the feed does not show.

Compatibility: I've tested it on IE 7 on Windows, and Firefox 2/3. It worked just fine.

License: GPL. Please note that I use two classes from http://www.phpclasses.org/. These two files are free to use under BSD license.


Please, provide feedback. This is my first module...


Regards,
Mercator
« Last Edit: March 16, 2008, 07:55:31 AM by mercator » Logged
ruebenwurzel
WebsiteBaker Org e.V.

Offline Offline

Posts: 7973



WWW
« Reply #1 on: March 21, 2008, 05:13:42 PM »

Hello,

sorry for my late response. Tested the modul and it seems to work ok.

The news modul has an rss.php included, wich does the same but you have to manually link to the rss.php by using the news page id.

By the way, thanks for your contribution.

Matthias
Logged
komdeurtje

Offline Offline

Posts: 1


« Reply #2 on: March 28, 2008, 01:59:07 PM »

nice module thanx
Logged
nielsr

Offline Offline

Posts: 7


WWW
« Reply #3 on: July 17, 2008, 06:02:20 PM »

Hi I have installed excactly as described and I can't get it to work? Also I am not sure I have done it correctly, but reading your description "Add this page module as a new section to a page containing a News module", doesn't really make sence to me... sorry! I have tried adding RSSFeeder as an added section in the News Module and I also tried to add it to my Home-page wich is "containing" the newsmodule and neither works. Maybe Im just stupid...?  rolleyes  But when You have a chance please advice, Thanks from NielsR
Logged
mercator

Offline Offline

Posts: 79


« Reply #4 on: July 17, 2008, 09:00:29 PM »

it is exactly ass descibed. create a page with a "News" module, then edit that page, press "Manage Section" and add the "RSSFeeder" as a section to that page. The RSS icon then shows up just beneth the News page. Done.
Logged
Argos
Moderator
**
Offline Offline

Posts: 2161


WWW
« Reply #5 on: September 21, 2008, 01:57:06 AM »

it is exactly ass descibed. create a page with a "News" module, then edit that page, press "Manage Section" and add the "RSSFeeder" as a section to that page. The RSS icon then shows up just beneth the News page. Done.

Did that... It shows an empty page when clicked on the RSS button. Source code:
Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=windows-1252"></HEAD>
<BODY></BODY></HTML>
Logged

Jurgen Nijhuis
Argos Media
Heiloo, The Netherlands
WB Showcase: http://www.mywebsitebaker.com/pages/showcase.php?v&category_id=1242&count=30
----------------------------------------------------------------
Please don't request personal support, use the forums!
Xagone
AddOn Development
*
Offline Offline

Posts: 478



WWW
« Reply #6 on: October 12, 2008, 08:26:01 PM »

it does the exact same thing on my news page : http://dev.votreespace.net/pages/nouvelles.php
Logged

Xagone Inc. (formerly VotreEspace)
http://www.xagone.com/
erpe

Offline Offline

Posts: 2077


WWW
« Reply #7 on: October 13, 2008, 10:01:46 AM »

But if you click on the rss button you get a white page.

rgds

erpe
Logged

Xagone
AddOn Development
*
Offline Offline

Posts: 478



WWW
« Reply #8 on: October 13, 2008, 02:52:52 PM »

I've activate E_ALL error repoporting, here is the problem :
Fatal error: Call to a member function fetchRow() on a non-object in /home/xagone/public_html/dev/modules/rssfeeder/rssfeeder.php on line 71
Logged

Xagone Inc. (formerly VotreEspace)
http://www.xagone.com/
mercator

Offline Offline

Posts: 79


« Reply #9 on: October 15, 2008, 01:17:18 PM »

Are the news articles visible on your page?
Logged
Xagone
AddOn Development
*
Offline Offline

Posts: 478



WWW
« Reply #10 on: October 15, 2008, 02:06:45 PM »

yes, here they are :
http://dev.votreespace.net/pages/nouvelles.php

Logged

Xagone Inc. (formerly VotreEspace)
http://www.xagone.com/
mercator

Offline Offline

Posts: 79


« Reply #11 on: October 15, 2008, 04:12:53 PM »

ok

can u uncomment the echo line in /home/xagone/public_html/dev/modules/rssfeeder/rssfeeder.php just above line 71 and send me the outcome? it seems that the query does not yield any result. additionally, can u please check if the query can be executed in mySQL?

// echo $query;
$result = $database->query($query);

Logged
Xagone
AddOn Development
*
Offline Offline

Posts: 478



WWW
« Reply #12 on: October 15, 2008, 07:53:03 PM »

SELECT wb_mod_news_posts.l ink, wb_mod_news_posts.t itle, wb_mod_news_posts.c ontent_short FROM wb_mod_news_posts, wb_pages WHERE active=1 AND visibility = "public" AND wb_mod_news_posts.w b_page_id=wb_pages.page_id AND wb_pages.page_id=9 ORDER BY wb_mod_news_posts.p ost_id DESC LIMIT 0 , 10

left it runing : http://www.votreespace.ca/modules/rssfeeder/rssfeeder.php?page=9
Logged

Xagone Inc. (formerly VotreEspace)
http://www.xagone.com/
Xagone
AddOn Development
*
Offline Offline

Posts: 478



WWW
« Reply #13 on: October 15, 2008, 08:14:48 PM »

ah ah !

repaired!

maybe it was not working with 2.7... there was 3 bugs... here they are :

1- the query was misconstructed

it added a "wb_" on a record when it shouldn't : "visibility = "public" AND '. TABLE_PREFIX.'mod_news_posts.'.TABLE_PREFIX.'page_id='.TABLE_PREFIX.'pages.page_id"

2- as soon as i removed that, a second bug come to view...

line 84 "$properties['dc:date']=date("Y-M-d, H:i",$item["modified_when"]);"

was telling no index "modified_when"...

found out that on my version, "modified_when" is indeed "posted_when" so i'bve changed it

3- but the code still called for a non-existant index on that line, so i've found that this was not called in the query, so i've added ", '.TABLE_PREFIX.'mod_news_posts.post ed_when" at the end of the select... TADA ... working.

here the query needed :
Code:
$query = 'SELECT '.TABLE_PREFIX.'mod_news_posts.link, '.TABLE_PREFIX.'mod_news_posts.title, '.TABLE_PREFIX.'mod_news_posts.content_short, '.TABLE_PREFIX.'mod_news_posts.posted_when FROM '.TABLE_PREFIX.'mod_news_posts, '.TABLE_PREFIX.'pages WHERE active=1 AND visibility = "public" AND '. TABLE_PREFIX.'mod_news_posts.page_id='.TABLE_PREFIX.'pages.page_id AND '.TABLE_PREFIX.'pages.page_id='."$newsPage".' ORDER BY '.TABLE_PREFIX.'mod_news_posts.post_id DESC LIMIT 0 , 10';
and the line 84 "$properties['dc:date']=date("Y-M-d, H:i",$item["modified_when"]);" need to be changed to :
Code:
$properties['dc:date']=date("Y-M-d, H:i",$item["posted_when"]);

thank you for your help, i've wouldn't have checked the code without your help
Logged

Xagone Inc. (formerly VotreEspace)
http://www.xagone.com/
Xagone
AddOn Development
*
Offline Offline

Posts: 478



WWW
« Reply #14 on: October 15, 2008, 08:29:21 PM »

there is however, a problem with some accent...

http://www.votreespace.ca/modules/rssfeeder/rssfeeder.php?page=10

the line "La différence entre Scripteur, Codeur, Programmeur et Developpeur"

should be "La différence entre Scripteur, Codeur, Programmeur et Developpeur
Logged

Xagone Inc. (formerly VotreEspace)
http://www.xagone.com/
mercator

Offline Offline

Posts: 79


« Reply #15 on: October 15, 2008, 09:33:30 PM »

Thanks.. it did not occur w/ my pages as I do not have a prefix. I will re-package in the next few days. Enjoy!
Logged
jar

Offline Offline

Posts: 62


« Reply #16 on: January 12, 2009, 06:10:07 PM »

problem with latin characters

example :


 preºedintele Comitetului Judeþean pentru Situaþii de Urgenþã
Logged
Xagone
AddOn Development
*
Offline Offline

Posts: 478



WWW
« Reply #17 on: January 12, 2009, 06:16:23 PM »

jar, it's a unicode prob, the output should be the same as your webpage (if utf8, then output utf8) and the input (rss) should be utf8... i dont think it's wise to use any other.
Logged

Xagone Inc. (formerly VotreEspace)
http://www.xagone.com/
Pages: [1]   Go Up
Print
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!