Advertisement:

Author Topic: Getting the Most Out of SMF - XML, RSS and RSS2 (and Atom and RDF) feeds  (Read 706118 times)

Offline humbleworld

  • Sr. Member
  • ****
  • Posts: 886
    • best article
Re: Getting the Most Out of SMF - XML, RSS and RSS2 (and Atom and RDF) feeds
« Reply #260 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.

Offline Oldiesmann

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 24,866
  • Gender: Male
  • Ask me about the function DB :)
    • oldiesmann on Facebook
    • Oldiesmann on GitHub
    • https://www.linkedin.com/in/michaeleshom on LinkedIn
    • @oldiesmann on Twitter
    • Archie Comics Fan Forum
Re: Getting the Most Out of SMF - XML, RSS and RSS2 (and Atom and RDF) feeds
« Reply #261 on: April 08, 2008, 12:32:19 AM »
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
Cincy Space - now open!

Offline humbleworld

  • Sr. Member
  • ****
  • Posts: 886
    • best article
Re: Getting the Most Out of SMF - XML, RSS and RSS2 (and Atom and RDF) feeds
« Reply #262 on: April 08, 2008, 01:23:52 AM »
Thanks OldiesMann. I'll check this out.

Offline jmanpa

  • Semi-Newbie
  • *
  • Posts: 28
Re: Getting the Most Out of SMF - XML, RSS and RSS2 (and Atom and RDF) feeds
« Reply #263 on: April 15, 2008, 10:56:38 AM »
Anyway to get the next x calendar entries?

Offline poveyjo

  • Semi-Newbie
  • *
  • Posts: 16
Re: Getting the Most Out of SMF - XML, RSS and RSS2 (and Atom and RDF) feeds
« Reply #264 on: April 23, 2008, 02:52:27 AM »
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

Offline Lavarinth

  • Semi-Newbie
  • *
  • Posts: 13
  • Gender: Male
    • Campaign Creations
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]

Offline poveyjo

  • Semi-Newbie
  • *
  • Posts: 16
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

Offline Oldiesmann

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 24,866
  • Gender: Male
  • Ask me about the function DB :)
    • oldiesmann on Facebook
    • Oldiesmann on GitHub
    • https://www.linkedin.com/in/michaeleshom on LinkedIn
    • @oldiesmann on Twitter
    • Archie Comics Fan Forum
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
Code: [Select]
'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
Cincy Space - now open!

Offline poveyjo

  • Semi-Newbie
  • *
  • Posts: 16
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

Offline Oldiesmann

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 24,866
  • Gender: Male
  • Ask me about the function DB :)
    • oldiesmann on Facebook
    • Oldiesmann on GitHub
    • https://www.linkedin.com/in/michaeleshom on LinkedIn
    • @oldiesmann on Twitter
    • Archie Comics Fan Forum
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
Cincy Space - now open!

Offline Oldiesmann

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 24,866
  • Gender: Male
  • Ask me about the function DB :)
    • oldiesmann on Facebook
    • Oldiesmann on GitHub
    • https://www.linkedin.com/in/michaeleshom on LinkedIn
    • @oldiesmann on Twitter
    • Archie Comics Fan Forum
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
Cincy Space - now open!

Offline poveyjo

  • Semi-Newbie
  • *
  • Posts: 16
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?

Offline Lavarinth

  • Semi-Newbie
  • *
  • Posts: 13
  • Gender: Male
    • Campaign Creations
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
Code: [Select]
'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
Code: [Select]
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]

Offline poveyjo

  • Semi-Newbie
  • *
  • Posts: 16
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.

Offline fredda88

  • Semi-Newbie
  • *
  • Posts: 21
What do i have to edit to get the date posted along with my news on my frontpage?

www.digitalsat.nu [nofollow]

Offline MarChelo

  • Semi-Newbie
  • *
  • Posts: 24
Can I feed the news with some feeder different than my SMF forum? By example a Blog or something...

Thank you

Offline yourlocal3

  • Newbie
  • *
  • Posts: 1
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

Offline rodrigosoares

  • Newbie
  • *
  • Posts: 4
Hello, is there a way to show only posts from the last week ?

Offline H

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 21,662
  • Gender: Male
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)
                             

Offline Low

  • Jr. Member
  • **
  • Posts: 211
    • Free Forum and Blog Hosting
Re: Getting the Most Out of SMF - XML, RSS and RSS2 (and Atom and RDF) feeds
« Reply #279 on: August 15, 2008, 10:20:36 AM »
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