Keyword

Retrieve all RSSfeeds except those containing THAT

More
6 years 1 month ago - 6 years 1 month ago #55906 by huki
Hi!

I am using your module to retrieve post from a twitter account and I would like to display only the tweets that don't contain the profil name "@that".
@that is always at the start of the$ feedItemTitle and of the $feedItemDescription.

I guess I have to add an exception rule inside this :
<?php foreach($output as $key=>$feed): ?>

but my knowledge of php is very limited so I couldn't find a solution.

Thanks a lot for your help!
Last edit: 6 years 1 month ago by huki.

Please Log in or Create an account to join the conversation.

More
6 years 1 month ago #55915 by Lefteris
Hi. Try this:
<?php foreach($output as $key=>$feed): ?>
<?php if(strpos($feed->itemTitle, '@that') === false): ?>
....
....
....
<?php endif; ?>
<?php endforeach; ?>

IMPORTANT: Please search the forum before posting a question!

JoomlaWorks Support Team Member

---
JoomlaWorks
www.joomlaworks.net/

Please Log in or Create an account to join the conversation.

More
6 years 1 month ago #55925 by huki
Thanks Lefteris! This is working great!

- question 1: I have set up the feed items limit to 5 and if there are two post with @that in the rss feeds, then the module will only display 3 feeds.
is there a way to apply the feed items limit after the exclusion of @that?

- question 2: I wonder if it's possible to add others exception. If for example I am trying to remove all the post for @that, @this and/or @those, how should I then change the code?

Thanks a lot for your help!

Please Log in or Create an account to join the conversation.

More
6 years 1 month ago #55927 by Lefteris
Regarding your new questions:

1. No. The only thing you can do is set the limit higher.

2. Yes you can the exact same way. You can add an AND to the condition:
...
<?php if(strpos($feed->itemTitle, '@that') === false && strpos($feed->itemTitle, '@this') === false ): ?>
...

IMPORTANT: Please search the forum before posting a question!

JoomlaWorks Support Team Member

---
JoomlaWorks
www.joomlaworks.net/

Please Log in or Create an account to join the conversation.

More
6 years 1 month ago #55929 by huki
Thanks so much!
1. Too bad! But it's ok, I was pushing it a bit
2 That's awesome!

Thanks a lot for your great support and your fast answer!

Please Log in or Create an account to join the conversation.

More
6 years 1 month ago #55931 by Lefteris
You are welcome.

IMPORTANT: Please search the forum before posting a question!

JoomlaWorks Support Team Member

---
JoomlaWorks
www.joomlaworks.net/

Please Log in or Create an account to join the conversation.


Powered by Kunena Forum