Support Forum

Advanced Search
Forum Scope


Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
plugins-topic
RSS Specific forums topics only
Avatar
OPShots
Member
Free Members
sp_UserOfflineSmall Offline
Jun 9, 2012 - 7:40 pm

I am wanting to pass through RSS to facebook and twitter only new topics and not replies to those topics for specific forums.

Is this possible through RSS can someone help me set it up so it won't degrade with future updates? I had it with 4.4.4 with the help of one of the generous admins here.

Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
Jun 9, 2012 - 8:44 pm

I am sorry, not sure I follow what you want to do...  you want rss to only include new topics?  you can do this using the filters available in the rss feeds routine...

Avatar
OPShots
Member
Free Members
sp_UserOfflineSmall Offline
Jun 9, 2012 - 9:56 pm

Exactly. I am trying to take existing rss feeds from certain forums only and include topics only but do not want the replies to show in the rss to said topics.

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
Jun 10, 2012 - 5:34 am

I think Steve (Mr Papa) is probably wrong - I don't see a filter in the RSS code that would help.

But - I would have no problem adding one into the core that you could use. I will need a little time to investigate and see what I can come up with...

andy-signature.png
YELLOW
SWORDFISH
Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
Jun 10, 2012 - 5:56 am

OK - you can try this but be warned - not tested out that much so you might have to undo it again!

First up edit the core file /simple-press/forum/feeds/sp-feeds.php

Locate the comment that reads '# Execute the query' and immediately ABOVE that line add this:

$where = apply_filters('sph_rss_where', $where, $feed);

Then open up the spFunctions.php file of your SP theme - in the templates folder. And add this function:

add_filter('sph_rss_where', 'rssFirstPostOnly', 1, 2);
function rssFirstPostOnly($where, $feed) {
    $where.= ' AND '.SFPOSTS.'.post_index = 1';
    return $where;
}

Be careful with all the full-stops and spaces in there. It needs to be exact!

See if this does the trick. If it does we can add that filter to the RSS feeds code so you know it will be there in the next update of SP.

As always we recommend that you create your own SP theme so that any customisation is not lost during a future update. (http://codex.simple-press.com/.....g-a-theme/)

andy-signature.png
YELLOW
SWORDFISH
Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
Jun 10, 2012 - 9:05 am

I was talking about a filter on the post list class query for feeds...  would have accomplished the same thing...

but no issue with a specific rss filter either...  think there is an existing ticket on that anyways...

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
Jun 10, 2012 - 9:34 am

Separation of powers.

andy-signature.png
YELLOW
SWORDFISH
Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
Jun 11, 2012 - 2:37 pm

OPShots: Can you tell me if this worked for you please? It wont get into the core for the next update without some feedback...

andy-signature.png
YELLOW
SWORDFISH
Avatar
OPShots
Member
Free Members
sp_UserOfflineSmall Offline
Jun 11, 2012 - 6:51 pm

Working great! Thank you very much. Sorry for the late reply, my internet connection had some hiccups. Awesome feature!

Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
Jun 11, 2012 - 9:52 pm

okay, thanks... we will get the function specific filter in place for this...

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: 17363
Moderators: 0
Admins: 4
Forum Stats:
Groups: 7
Forums: 17
Topics: 10127
Posts: 79625