buddy press activity loop, using the search_terms parameter….

I want to filter my activity loop to only contain blogs with certain keywords. Over here: http://codex.buddypress.org/developer/developer-docs/loops-reference/the-activity-stream-loop/

it says to use the search_terms parameter. I can only get this line of code to accept 1 keyword. I have a table of 20 keywords I want to filter the blogs by so that if they contain ANY of those keywords the blog should appear on my feed.

How do I do this?

Many thanks in advance,

Amit

  • PC
    • WPMU DEV Initiate

    Hiya,

    I tried to find an answer to it but it seems to be coding issue which is beyond the scope of support we can provide here on the forums. We provide support on general BP issues, the best place for coding support is the BP support forums

    Cheers, PC

  • amit_misra
    • Flash Drive

    we actually ended up using a custom script. if anyone has the syntax for multiple keywords we’d appreciate it. here is the custom filter we used:

    $i = 0;

    $all_feeds = array();

    $feeds_logo = array();

    $feed_logo = array();

    foreach($get_feed_key as $gf)

    {

    if(in_array($gf, $feed_keywords))

    {

    $all_feeds[] = $feed_urls[$gf];

    }

    $i++;

    }

    foreach($all_feeds as $feed_url)

    {

    $rss = fetch_feed($feed_url);

    $maxitems = $rss->get_item_quantity(1);

    $rss_items = $rss->get_items(0, $maxitems);

    foreach ( $rss_items as $item )

    {

    $flag = false;

    $get_content = explode(‘ ‘,$item->get_description());

    foreach($get_content as $get_w)

    {

    if(in_array($get_w, $get_filter_keywords))

    {

    $flag = true;

    }

    }

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.