Advertisement:

Author Topic: Advertising Your Board's RSS Feed...  (Read 78566 times)

Offline Oldiesmann

  • Developer
  • SMF Super Hero
  • *
  • Posts: 24,814
  • Gender: Male
  • Ask me about the function DB :)
    • oldiesmann on Facebook
    • Oldiesmann on GitHub
    • http://www.linkedin.com/in/michaeleshom on LinkedIn
    • @oldiesmann on Twitter
    • Archie Comics Fan Forum
Advertising Your Board's RSS Feed...
« on: November 22, 2004, 11:56:25 AM »
One of the great features in SMF is its XML and RSS functions. With one simple option enabled, SMF is capable of generating RSS and XML feeds for your board's news, member profiles and latest topics. Mozilla Firefox displays a special icon in the status bar when it detects an RSS feed on a site and even allows you to add RSS feeds to your bookmarks ("live bookmarks" - creates a folder in your bookmarks list for each feed and then puts the links generated by that feed in that folder, allowing you to easily access them). Anyway, Kelnage indicated that it would be nice to see SMF automatically "advertise" the fact that you've got RSS feeds on your board. Here's how you do that:

First, make sure you've got it enabled (Admin -> Edit Features and Options -> Enable XML/RSS News).

Next:

Themes/yourtheme/index.template.php

Find
Code: [Select]
// Show all the relative links, such as help, search, contents, and the like.
echo '
<link rel="help" href="', $scripturl, '?action=help" target="_blank" />
<link rel="search" href="' . $scripturl . '?action=search" />
<link rel="contents" href="', $scripturl, '" />';

Add after
Code: [Select]
// If RSS/XML news is enabled, indicate that an RSS feed is available
if (!empty($modSettings['xmlnews_enable']))
echo '
<link rel="alternate" type="application/rss+xml" title="RSS" href="', $scripturl, '?type=rss;action=.xml;limit=20" />';

You can change that to your liking. Check out Sources/News.php for more info on all the XML feeds available. Once again, thanks to Kelnage for mentioning how to "advertise" the feed.
« Last Edit: November 22, 2004, 08:38:41 PM by Oldiesmann »
Michael Eshom
Webmaster / SMF Lead Developer
oldiesmann@simplemachines.org

Offline jcompton

  • Semi-Newbie
  • *
  • Posts: 36
Re: Advertising Your Board's RSS Feed...
« Reply #1 on: November 22, 2004, 12:05:47 PM »
Is there more detail available on turning these feeds on? I do have that "one simple option enabled" but Yahoo's RSS module doesn't recognize my latest-post URL as a valid feed so presumably there's something a bit more to it than that.

Offline Kelnage

  • Semi-Newbie
  • *
  • Posts: 14
  • Gender: Male
    • My Website
Re: Advertising Your Board's RSS Feed...
« Reply #2 on: November 22, 2004, 12:31:48 PM »
Your latest post isn't an RSS feed.

To get the RSS feed manually, the link is:

http://www.yourserver.com/foldername/index.php?type=rss;action=.xml;limit=20 [nofollow]

That gets 20 messages. To get more or less, just change the last number.

Offline jcompton

  • Semi-Newbie
  • *
  • Posts: 36
Re: Advertising Your Board's RSS Feed...
« Reply #3 on: November 22, 2004, 04:21:41 PM »
Ah, thanks. Looks like half the time Yahoo claims there's no new posts for the past 3 days, but I have no way of knowing whose fault that is offhand...

Offline jcompton

  • Semi-Newbie
  • *
  • Posts: 36
Re: Advertising Your Board's RSS Feed...
« Reply #4 on: November 22, 2004, 04:47:25 PM »
Actually, no, I still seem to be missing something here.

http://forums.pocketplane.net/index.php?type=rss;action=.xml;limit=6

This URL pulled up 5 items into My Yahoo, but those items are not updating. They're just getting older and older...

Offline Oldiesmann

  • Developer
  • SMF Super Hero
  • *
  • Posts: 24,814
  • Gender: Male
  • Ask me about the function DB :)
    • oldiesmann on Facebook
    • Oldiesmann on GitHub
    • http://www.linkedin.com/in/michaeleshom on LinkedIn
    • @oldiesmann on Twitter
    • Archie Comics Fan Forum
Re: Advertising Your Board's RSS Feed...
« Reply #5 on: November 22, 2004, 04:56:49 PM »
Works fine in Firefox. It's displaying links to the 6 most recent posts. I don't know how Yahoo handles this though.
Michael Eshom
Webmaster / SMF Lead Developer
oldiesmann@simplemachines.org

Offline Oldiesmann

  • Developer
  • SMF Super Hero
  • *
  • Posts: 24,814
  • Gender: Male
  • Ask me about the function DB :)
    • oldiesmann on Facebook
    • Oldiesmann on GitHub
    • http://www.linkedin.com/in/michaeleshom on LinkedIn
    • @oldiesmann on Twitter
    • Archie Comics Fan Forum
Re: Advertising Your Board's RSS Feed...
« Reply #6 on: November 22, 2004, 05:03:13 PM »
Everything Yahoo is showing is an hour old. I'm guessing it only gets headlines every hour or so.
Michael Eshom
Webmaster / SMF Lead Developer
oldiesmann@simplemachines.org

Offline Lum-chan

  • Semi-Newbie
  • *
  • Posts: 88
  • Gender: Male
  • Lum-chan is cute!
    • The World of Urusei Yatsura's Lum
Re: Advertising Your Board's RSS Feed...
« Reply #7 on: November 22, 2004, 07:44:17 PM »
Thanks for the tip Oldiesman, I finally got it working  ;D
Lum-chan


Offline [Unknown]

  • SMF Friend
  • SMF Master
  • *
  • Posts: 36,102
  • Gender: Male
Re: Advertising Your Board's RSS Feed...
« Reply #8 on: November 22, 2004, 07:52:06 PM »
I'm pretty sure the content type should be application/rss+xml.

-[Unknown]

Offline Oldiesmann

  • Developer
  • SMF Super Hero
  • *
  • Posts: 24,814
  • Gender: Male
  • Ask me about the function DB :)
    • oldiesmann on Facebook
    • Oldiesmann on GitHub
    • http://www.linkedin.com/in/michaeleshom on LinkedIn
    • @oldiesmann on Twitter
    • Archie Comics Fan Forum
Re: Advertising Your Board's RSS Feed...
« Reply #9 on: November 22, 2004, 08:38:02 PM »
That's just what Kelnage had. I'll change it though.
Michael Eshom
Webmaster / SMF Lead Developer
oldiesmann@simplemachines.org

Offline Kelnage

  • Semi-Newbie
  • *
  • Posts: 14
  • Gender: Male
    • My Website
Re: Advertising Your Board's RSS Feed...
« Reply #10 on: November 23, 2004, 03:31:21 PM »
Cheers [Unknown], I wasn't certain, but RSS worked with Firefox, and seeing as RSS readers are supposed to be extremely strict, I didn't think there was a problem.

Offline Oldiesmann

  • Developer
  • SMF Super Hero
  • *
  • Posts: 24,814
  • Gender: Male
  • Ask me about the function DB :)
    • oldiesmann on Facebook
    • Oldiesmann on GitHub
    • http://www.linkedin.com/in/michaeleshom on LinkedIn
    • @oldiesmann on Twitter
    • Archie Comics Fan Forum
Re: Advertising Your Board's RSS Feed...
« Reply #11 on: November 23, 2004, 09:59:27 PM »
You can add multiple links too...

For example:

Code: [Select]
echo '
  <link rel="alternate" type="application/rss+xml" title="20 Most Recent Topics" href="', $scripturl, '?type=rss;action=.xml;limit=20" />
  <link rel="alternate" type="application/rss+xml" title="News" href="', $scripturl, '?type=rss;action=.xml;sa=news" />';

Then when you click on the little icon in Firefox, you will be given an option of which feed you want to subscribe to. :)
Michael Eshom
Webmaster / SMF Lead Developer
oldiesmann@simplemachines.org

Offline nosleep

  • Semi-Newbie
  • *
  • Posts: 56
Re: Advertising Your Board's RSS Feed...
« Reply #12 on: December 13, 2004, 05:00:14 AM »
Quote
Actually, no, I still seem to be missing something here.

http://forums.pocketplane.net/index.php?type=rss;action=.xml;limit=6

This URL pulled up 5 items into My Yahoo, but those items are not updating. They're just getting older and older...


and what would the link be for example a section like this: Video and Photo Room

http://www.yourserver.com/foldername/index.php?type=rss;action=.xml;limit=20

because the quoted link doesn't pull from a specific section of the forum...

Offline [Unknown]

  • SMF Friend
  • SMF Master
  • *
  • Posts: 36,102
  • Gender: Male
Re: Advertising Your Board's RSS Feed...
« Reply #13 on: December 13, 2004, 05:03:09 AM »
Put ;board=XYZ on the link for a specific board.

-[Unknown]

Offline nosleep

  • Semi-Newbie
  • *
  • Posts: 56
Re: Advertising Your Board's RSS Feed...
« Reply #14 on: December 13, 2004, 06:03:04 AM »
like this?

http://myhomepage.com/portal/forum/index.php?type=rss;action=.xml;limit=20;board=Politics and Sports

because I get this error when calling the feed:

Completed: with problems:
http://myhomepage.com/portal/forum/index.php?type=rss;action=.xml;limit=20;board=Politics and Sports


additionally: must I be logged in to call the feed, as that section is only available to loged in users.

can I possibly add my login and password to the string?
« Last Edit: December 13, 2004, 06:09:34 AM by nosleep »

Offline [Unknown]

  • SMF Friend
  • SMF Master
  • *
  • Posts: 36,102
  • Gender: Male
Re: Advertising Your Board's RSS Feed...
« Reply #15 on: December 13, 2004, 06:05:29 AM »
I'm afraid you have to look at the board's number.  For example, Tips and Tricks is 72 - you cna tell from the URL.

-[Unknown]

Offline nosleep

  • Semi-Newbie
  • *
  • Posts: 56
Re: Advertising Your Board's RSS Feed...
« Reply #16 on: December 13, 2004, 06:35:04 AM »
thank you, mine was a silly question on afterthought, should have known that from phpbb, on which it is the same.


but it won't pull the news. The board no. looks like this (on default template 1.0 preview):

....index.php/board,5.0.html

so do I have to call only the 5, or the 5.0, ot 5.0.html ?

have tried all three, but none will pull the news.

again, this section is only for logged in users.......
« Last Edit: December 13, 2004, 06:59:33 AM by nosleep »

Offline [Unknown]

  • SMF Friend
  • SMF Master
  • *
  • Posts: 36,102
  • Gender: Male
Re: Advertising Your Board's RSS Feed...
« Reply #17 on: December 13, 2004, 07:07:11 AM »
It's just 5.  The 0 is the page number.

http://www.simplemachines.org/community/index.php?board=72;type=rss;action=.xml

Works here?

-[Unknown]

Offline nosleep

  • Semi-Newbie
  • *
  • Posts: 56
Re: Advertising Your Board's RSS Feed...
« Reply #18 on: December 13, 2004, 07:13:41 AM »
tried that now as well, it won't pull the feed.... no clue why.

tried axatly you string above, only changed to my url.

Offline Atari

  • Jr. Member
  • **
  • Posts: 114
  • Gender: Male
  • Hello
    • Old Sk00L Gamers
Re: Advertising Your Board's RSS Feed...
« Reply #19 on: December 16, 2004, 08:36:06 PM »
I finally got a look at this but still not sure about something. Do I really need to edit? I tried the direct link and added to my bookmarks and it seems to work. I tried to look for that stuff in my template but its not there so I didn't add the extra code. ( I'm using helios template). Does that code give you some more control on what shows?

There are 10 kinds of people in this World.
Those who understand Binary and those who don't