Support Forum
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; }
Visit Cruise Talk Central and Mr Papa's World
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?
Yes, code can be added. What would you want it to do?
Visit Cruise Talk Central and Mr Papa's World
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!
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...
Visit Cruise Talk Central and Mr Papa's World
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!
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.
YELLOW
SWORDFISH
|
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...
Visit Cruise Talk Central and Mr Papa's World
1 Guest(s)