Support Forum

Advanced Search
Forum Scope


Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
general-topic
Is it possible to have an RSS feed which displays topics only?
Avatar
Duke Leto III
Member
Free Members
sp_UserOfflineSmall Offline
Oct 11, 2012 - 2:47 pm

Currently, the rss feeds show every post.... so when i have an rss feed watching a forum which has one busy thread, the feed has the same topic shown four times. 

Thanks!

Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
Oct 11, 2012 - 8:59 pm

not entirely sure I understand your use case here...  the feed will contain different posts within that topic...

but if I understand what you want, to your spFunctions.php theme template file, try adding:

add_filter('sph_post_list_query', 'my_rss_feeds', 10, 2);
function my_rss_feeds($spdb, $this) {
    global $sfvars;
    if ($sfvars['feed'] == 'forum') {
        $spdb->where.= ' AND '.SFPOSTS.'.post_id = (SELECT alt.post_id FROM '.SFPOSTS.' AS alt WHERE alt.topic_id = '.SFPOSTS.'.topic_id ORDER BY alt.post_id DESC LIMIT 1)';
    }
    return $spdb;
}
Avatar
Duke Leto III
Member
Free Members
sp_UserOfflineSmall Offline
Oct 12, 2012 - 12:46 pm

Mr Papa, you seem to have understood perfectly! I didn't want multiple posts from the same thread showing up in the feed. I had a topic, "Do you offer real music?", and there were several replies. So my feed looked like: 

> Do you offer real music?

> Do you offer real music?

> Do you offer real music? 

I'm curious, is there something i can add to the code you provided to also work on group feeds? 

 

Thanks very much, sir!

 

edit: oh and one more question: is the spFunctions.php replaced often when updated? Is this something i can move to the theme i created, or should i just back up these changes and apply them when you put out new versions of Simple-Press?

Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
Oct 12, 2012 - 2:38 pm

Yes, code can be added. What would you want it to do?

Avatar
Duke Leto III
Member
Free Members
sp_UserOfflineSmall Offline
Oct 12, 2012 - 4:29 pm

Mr Papa said
Yes, code can be added. What would you want it to do?

It'd be nice to have the same functionality you wrote above apply to all feeds, including feeds for an entire group of forums. 

 

Also, did you see the question i edited in above? I want to make sure i know how to save these changes you're helping me with, so when i update to newer versions of Simple-Press i don't over-write them.

 

Thanks!

Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
Oct 13, 2012 - 12:59 am

yes, when wp updates a theme or plugin, it removes the previous theme or plugin before updating to the new one... so spFunctions.php will be overwritten on all theme updates...

see:  http://codex.simple-press.com/.....g-a-theme/

will have to think on the group view rss feed...

Avatar
Duke Leto III
Member
Free Members
sp_UserOfflineSmall Offline
Oct 19, 2012 - 12:06 pm

Mr Papa said
yes, when wp updates a theme or plugin, it removes the previous theme or plugin before updating to the new one... so spFunctions.php will be overwritten on all theme updates...

see:  http://codex.simple-press.com/.....g-a-theme/

will have to think on the group view rss feed...

Thanks for the info! It turns out that I had already done that theme creations stuff when I first installed Simple Press, and I'm glad I did, because the filter you created for me above was already in the correct spFunctions.php file within my theme folder. 

Well done!

Have you perhaps thought of a way to apply the same filter concept to the group feed? You can look at my site's footer for an example of where this is causing duplication: http://www.woodstockmediagroup.com

Thanks!

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
Oct 19, 2012 - 2:28 pm

Well I am not totally sure what Steve has done for you there but hey - if it works then great!

So why not try changing this to:

if ($sfvars['feed'] == 'forum' || $sfvars['feed'] == 'group') {

I don't know if that will work because as I say, I am unsure at the moment how the first code works but it is maybe worth a try.

andy-signature.png
YELLOW
SWORDFISH
Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
Oct 20, 2012 - 7:46 pm

would be interested if that worked...  first thing I tried was that and essentially locked up my system... hence my post about let me think about it... should work, and wanted to see what was going on with mine...  sorry, never got back to it... so yeah, please let me know...

Avatar
Duke Leto III
Member
Free Members
sp_UserOfflineSmall Offline
Oct 22, 2012 - 3:21 pm

This didn't lock anything up or break anything, but it also didn't seem to do anything. It's been a few hours and the problem remains. It is still fixed though in the forum feeds though. 

Forum Timezone: Europe/Stockholm
Most Users Ever Online: 1170
Currently Online:
Guest(s) 1
Currently Browsing this Page:
1 Guest(s)
Top Posters:
Mr Papa: 19448
Ike: 2086
Brandon: 864
kvr28: 804
jim: 650
FidoSysop: 577
Conrad_Farlow: 531
fiddlerman: 358
Stefano Prete: 325
Member Stats:
Guest Posters: 619
Members: 17362
Moderators: 0
Admins: 4
Forum Stats:
Groups: 7
Forums: 17
Topics: 10127
Posts: 79625