BuddyDev

Search

Replies

  • Participant
    Level: Initiated
    Posts: 12
    Paul on #3162

    Hey, Brajesh,

    We will need to sort these by a numeric bp_xprofile_field. Is that possible with this solution? the search is going fine and I see how I can order by meta_keys but how would I sort by meta_keys present in bp_xprofile_fields?

    Thanks,
    Paul

  • Participant
    Level: Initiated
    Posts: 12
    Paul on #3160

    Brajesh,

    Thanks for your reply here. All works as expected except for it needs to be $args[‘search_terms’] instead of $args[‘search-terms’] (underscore, not a dash). Your reply was very helpful!

    Cheers,
    Paul

  • Participant
    Level: Initiated
    Posts: 12
    Paul on #3145

    Hi Brajesh,

    I am using this on a gallery in which the images are added from buddypress fields using mpp_add_media() so I’m guessing since we are using this on a gallery page it’s not a custom page but at the same time all of the images added to this gallery are custom from buddypress fields so I’m not sure.

    When I interact with MPP_Media_Query class using one of the loop styles described in the documentation you suggested where would you suggest I place that ocde? In the same plugin I created to populate the gallery with mpp_add_media? Which action would you suggest I use? Would I create the actual search box with html? How do I retrieve the submitted vars? There is no explanation of the “$args” variable. Can you give me a bit more insight to this: “It uses parent::query() and only allows limited options with query.”

    Thanks,
    Paul

  • Participant
    Level: Initiated
    Posts: 12
    Paul on #3129

    Hey Brajesh,

    We were able to make this work by changing the component_id to 1 in all cases.

    Thanks,
    Paul

  • Participant
    Level: Initiated
    Posts: 12
    Paul on #2982

    Brajesh,

    I looked into the meta info for one of the problem images:

    get_post_meta(1040

    array(3) {
    [“_wp_attached_file”]=>
    array(1) {
    [0]=>
    string(44) “/wp-content/uploads/profiles/15/IMG_3877.jpg”
    }
    [“_mpp_component_id”]=>
    array(1) {
    [0]=>
    string(2) “15”
    }
    [“_mpp_is_mpp_media”]=>
    array(1) {
    [0]=>
    string(1) “1”
    }
    }

    They appear to have the meta content you specified. I know you are working on a debugger but I thought this might be helpful.

    Thank You,
    Paul

  • Participant
    Level: Initiated
    Posts: 12
    Paul on #2931

    Hi Brajesh,

    The status was “Public”. I left it as Public and clicked “Update”. They are still not visible. Any help would be appreciated. Thank you.

    -Paul

  • Participant
    Level: Initiated
    Posts: 12
    Paul on #2918

    Hi Brajesh,

    I did as you instructed:

    1. Changed the component var from ‘sitewide’ to ‘members’
    2. Acted on a galley that used the ‘members’ component

    I experienced the same results, I see the images I add ONLY in the “Edit Media” view. Changing the component doesn’t make any difference that I can see.

    Thanks,
    Paul

  • Participant
    Level: Initiated
    Posts: 12
    Paul on #2849

    Thank you so much for the thorough and quick replies. Exactly what I needed.

  • Participant
    Level: Initiated
    Posts: 12
    Paul on #2839

    Hello Brajesh,

    Thank you for the very helpful reply. The following code does add the image to the gallery but with a few problems.

    1. Clicking on the image does not work, I get an “The page isn’t redirecting properly” error.
    2. I get wsod when running the script. After I comment out $id = mpp_add_media( $media_data ); and return to the gallery the image is there.

    I will also need to roll through the images in the gallery to remove unwanted images.

    add_action(‘init’, ‘add_member_images’);
    function add_member_images() {

    $title = ‘testing image’;
    $content = ‘checking this out’;
    $gallery_id = 292;
    $media_type = ‘photo’;
    $type = ‘image/jpeg’;
    $url = ‘http://sisters.dev/wp-content/uploads/profiles/4/large_22097.jpg’;
    $file = ‘/wp-content/uploads/profiles/4/large_22097.jpg’;
    $status = ‘public’;
    $component_id = 1;
    $component = ‘members’;

    $media_data = array(
    ‘title’ => $title,
    ‘description’ => $content,
    ‘gallery_id’ => $gallery_id,
    ‘user_id’ => get_current_user_id(),
    ‘is_remote’ => false,
    ‘type’ => $media_type,
    ‘mime_type’ => $type,
    ‘src’ => $file,
    ‘url’ => $url,
    ‘status’ => $status,
    ‘comment_status’ => ‘open’,
    ‘storage_method’ => mpp_get_storage_method(),
    ‘component_id’ => $component_id,
    ‘component’ => $component,
    //’context’ => $context,
    ‘is_orphan’ => 0,
    );

    //$id = mpp_add_media( $media_data );

    }

    Thank You,
    Paul

    • This reply was modified 8 years ago by Paul.
  • Participant
    Level: Initiated
    Posts: 12
    Paul on #2802

    Brajesh, thank you so much for the quick reply. I have a buddypress site with members via memberpress. I need to make sure they are a paying member and if they are add images and a few other fields from their buddypress profile to a custom gallery. In a new plugin I have tried the following code as a test but it breaks the site:
    add_action(‘mpp_loaded’, ‘add_member_images’);
    function add_member_images() {

    $args = array(
    ‘gallery_id’ => 292,
    ‘title’ => ‘testing’,
    ‘type’ => ‘image’,
    );

    $ret = mpp_add_media($args);

    }

    I assume I pass the image and other fields as args? If so how do I specify the image? Maybe I way off here? I would appreciate any help.