News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

Getting the Most Out of SMF - XML, RSS and RSS2 (and Atom and RDF) feeds

Started by Oldiesmann, January 20, 2005, 12:55:32 PM

Previous topic - Next topic

humbleworld

May I know where I can edit the RSS? Should it be in index.php? or news.php? I'm sorry I don't get the instruction here. Thank you.

Oldiesmann

Quote from: humbleworld on April 07, 2008, 11:34:47 PM
May I know where I can edit the RSS? Should it be in index.php? or news.php? I'm sorry I don't get the instruction here. Thank you.

All of the feeds are handled by functions in Sources/News.php.
Michael Eshom
Christian Metal Fans


jmanpa


poveyjo

Hi,  Back on page 5 of this thread, Carla asked the following:

"Is there a way to create an RSS feed of a single topic?. For example this one that we're reading. Can it be downloaded it as an RSS feed?. I wrote the URL and the XML option at the end but I keep getting the whole forum RSS feed.

Best regards,
Carla"

Someone else asked it again later in the thread, but I haven't seen any answers.   is there a way to do this?

I tried topic=x, but that didn't seem to work. 

Any ideas?

Many thanks

Lavarinth

Hi there- I used RSS2HTML to come up with the following page:
http://www.campaigncreations.org [nofollow]
Which uses the following feed:
http://www.campaigncreations.org/forum/index.php?action=.xml;board=8;limit=20;type=rss2;sa=news [nofollow]

(Link to RSS2HTML: http://www.rss2html.com/ [nofollow] )

However if you look on the result of the feed, no author is displayed. Instead of just says "Campaign Creations Staff Member."

I read the following post in this thread:
http://www.simplemachines.org/community/index.php?topic=25009.msg1068731#msg1068731
Which stated changes to make to get this to work, in I believe, 1.1.3

And then read the following from another member:
http://www.simplemachines.org/community/index.php?topic=25009.msg1277150#msg1277150
He upgraded to 1.1.4 and the changes no longer function. I have attempted to perform the same function and had the same result of it not showing anything.

Are the any edits to the code that we could perform that would work to display the author?
- - Lavarinth
http://www.campaigncreations.org [nofollow]

poveyjo

Lavarinth, I also just tried making that change to get the author to display.  I'm on 1.1.5 so I thought perhaps it might work in that.  But no luck...

So I too, would like a solution to this problem if anyone has some ideas....
Thanks

Oldiesmann

In 1.1.5, SMF uses cdata_parse() on the poster name for another format, so it's likely that CDATA tags were added in 1.1.4...

So...


Sources/News.php

Find
Code (Lines 548 and 654) Select
'author' => (!empty($modSettings['guest_hideContacts']) && $user_info['is_guest']) || (!empty($row['hideEmail']) && !empty($modSettings['allow_hideEmail']) && !allowedTo('moderate_forum')) ? null : $row['posterEmail'],

Replace
'author' => (!empty($modSettings['guest_hideContacts']) && $user_info['is_guest']) || (!empty($row['hideEmail']) && !empty($modSettings['allow_hideEmail']) && !allowedTo('moderate_forum')) ? null : $row['posterEmail'] . ' (' . cdata_parse($row['posterName']) . ')',

That should fix the issue.
Michael Eshom
Christian Metal Fans

poveyjo

Mmm, thanks for this Michael, but unless I'm doing something wrong, it doesn't seem to work for me.

Here is my feed: http://www.peakbagging.co.nz/forums/index.php?action=.xml;board=64;limit=20;type=rss2;sa=news [nofollow]

and here's my line 548 and 654:

'author' => (!empty($modSettings['guest_hideContacts']) && $user_info['is_guest']) || (!empty($row['hideEmail']) && !empty($modSettings['allow_hideEmail']) && !allowedTo('moderate_forum')) ? null : $row['posterEmail'] . ' (' . cdata_parse($row['posterName']) . ')',

Cheers, Jon

Oldiesmann

Can you send me your copy of Sources/News.php?

I just tried this on my SMF test board and it worked fine (the author shows up in the code, though I couldn't get Thunderbird, Google or Yahoo to actually display the author).
Michael Eshom
Christian Metal Fans

Oldiesmann

Looked at the file that you emailed me and it looks fine. However, I didn't think of something before... Do you have the "Do not reveal contact details of members to guests" setting enabled? If so, the author won't be shown at all if you're viewing the feed as a guest (which, in most cases, you will be).
Michael Eshom
Christian Metal Fans

poveyjo

Mmm, well I found that setting, and it was checked, so I unchecked, saved it and tried again.... but still it doesn't show the poster.  And I was sure that would be the cause to!

I'm using Firefox to view the feed.  Does the author show in Firefox for you?

Lavarinth

Quote from: Oldiesmann on May 13, 2008, 07:06:23 PM
In 1.1.5, SMF uses cdata_parse() on the poster name for another format, so it's likely that CDATA tags were added in 1.1.4...

So...


Sources/News.php

Find
Code (Lines 548 and 654) Select
'author' => (!empty($modSettings['guest_hideContacts']) && $user_info['is_guest']) || (!empty($row['hideEmail']) && !empty($modSettings['allow_hideEmail']) && !allowedTo('moderate_forum')) ? null : $row['posterEmail'],

Replace
'author' => (!empty($modSettings['guest_hideContacts']) && $user_info['is_guest']) || (!empty($row['hideEmail']) && !empty($modSettings['allow_hideEmail']) && !allowedTo('moderate_forum')) ? null : $row['posterEmail'] . ' (' . cdata_parse($row['posterName']) . ')',

That should fix the issue.

Thank you so much, this worked out perfectly. I personally cut it down to
cdata_parse($row['posterName'])
only, hoping this wont pose an issue, since I didn't want the e-mail to show up either way.
- - Lavarinth
http://www.campaigncreations.org [nofollow]

poveyjo

Just in case anyone else has the issue I was having, it looks like you also have to have "Allow users to hide their email from everyone except admins?" unchecked to get the author to show.

Not ideal for me, so I've chosen not put the author in the feed, as I'd rather allow my members to hide their email if the want.

fredda88

What do i have to edit to get the date posted along with my news on my frontpage?

www.digitalsat.nu

MarChelo

Can I feed the news with some feeder different than my SMF forum? By example a Blog or something...

Thank you

yourlocal3

Hi I want to have the rss feed use a specific topic and use the 10 msg that are most recently posted to it as the feed. Here is how I modified it.

hxxp:www.yourlocal3.com/forums/index.php?action=.xml;sa=recent;topic=2.0;limit=10 [nonactive]

will it work?
Thanks

rodrigosoares

Hello, is there a way to show only posts from the last week ?

H

Quote from: rodrigosoares on July 23, 2008, 08:24:51 AM
Hello, is there a way to show only posts from the last week ?

Not by default. The nearest thing would obviously be the recent posts. Why do you specifically need this feature?
-H
Former Support Team Lead
                              I recommend:
Namecheap (domains)
Fastmail (e-mail)
Linode (VPS)
                             

Low

I see the same bunch of people on hear thanklesly helping everyone day after day. Thank you.

I have SMF 1.1.5 installed with a few mods, just checked my IE feeds button and I'm getting the last 5 posts. Does this mean it's already been implemented into SMF or do I still have to mod some stuff?

Thanks

Advertisement: