Skip to:
Content
Pages
Categories
Search
Top
Bottom

Forum Replies Created

Viewing 14 replies - 1 through 14 (of 14 total)

  • Myg0t
    Participant

    @myg0t

    Ah! Very nice!

    Many many thanks!
    M


    Myg0t
    Participant

    @myg0t

    @henrywright Oh! I see! Thank you for that!


    @danbp
    Holy cow! Thank you so much for this! Your a genius. You really just made my day. I appreciate you taking the time to write so much about it. It makes it much easier to learn from my mistakes!

    Thanks again guys!
    M

    *EDIT* I just thought about this, but is there a way to tell whether the video ID in the field is from youtube or some other video service such as Vimeo?

    I’m noticing after looking at a few Vimeo videos that there IDs seem to be all numbers. Would be a reliable way to distinguish youtube from vimeo?


    Myg0t
    Participant

    @myg0t

    Yeah, still nothin 🙁

    I’ve also tried making the field a text box instead of a text-area. That didn’t change anything either lol.

    I just tested Oembed in an activity stream and it works fine..

    No clue whats going on here…

    Thanks for all help @naijaping!

    \M


    Myg0t
    Participant

    @myg0t

    Hmm, yes I did.

    Just to clarify, it should be fine putting this in my functions.php, right?

    This is what I have:

    // Enable oembed  in profile
    function bp_youtube_in_profile() {
      add_filter( 'bp_get_the_profile_field_value', 'bp_enable_youtube_in_profile', 9, 3 );
    }
    add_action( 'bp_init', 'bp_youtube_in_profile', 0 );
    
    function bp_enable_youtube_in_profile( $val, $type, $key ) {
    
    	$field = new BP_XProfile_Field( $key );
    	$field_name = $field->name;
    
    	$val = strip_tags( $val );
    	
    	if(  strtolower( $field_name ) == 'Spotlight Video' ) {
    		return wp_oembed_get( $val, array('width'=>300) );	
    	}
    		return $val;
    }

    I assume spaces in the field name aren’t an issue right?

    thanks,

    \M


    Myg0t
    Participant

    @myg0t

    @aces

    hmmm… Your exactly right… Now that you say that, I had it in the plugins folder at one point, but some where along the lines I some how moved it over to the buddypress folder.. Not sure why…

    Either way, I moved it back to the plugins folder and still nothin’ 🙁


    Myg0t
    Participant

    @myg0t

    @mcpeanut I’ve posted the material in the codex now, so you may want to bookmark this page instead:

    https://codex.buddypress.org/developer/useful_func_s2_bp/

    I’ve already posted the option2 for the field import function. Once I get some more time and figure out how to use bp_parse_args() i’ll update the first section as well. Along with any other usefull s2member/buddypress tweaks that I find along the way.

    Glad you could find this useful!


    @hnla

    what’s the trick to formatting code in the codex? I’ve wrapped all the code in the tags, but it rips apart the formatting for the text (like indention’s)

    \M


    Myg0t
    Participant

    @myg0t

    @naijaping Sadly, it is not working still 🙁

    I tried the code in both childtheme/functions.php and plugins/buddypress/bp-custom.php…

    Just to clarify I should be using a link like this, yes?

    thanks guys,

    \M


    Myg0t
    Participant

    @myg0t

    @henrywright Thanks for the reply!

    unfortunately, that did not work.

    I tried putting it in both my childtheme/functions.php and my plugins/buddypress/bp-custom.php and no dice. :\


    Myg0t
    Participant

    @myg0t

    Okay great, much appreciated!


    Myg0t
    Participant

    @myg0t

    Cool cool, i’ll take a look at those things.

    When creating the codex page, What would you two suggest for components, types, and contexts tabs?

    I assume I should just put 2.1 for version?

    Thanks,
    \M


    Myg0t
    Participant

    @myg0t

    @hugo
    Thanks for the reply!

    Touche’, I should’ve mentioned that in my post. I’ve integrated all of it using a child theme, so it’ll be simple for me to show how to do that.

    That’s a good idea using bp_parse_args(). I’ll check it out and see if I can make it happen.

    I tried using the user visibility option to change the visibility of the s2member fields, but sadly, the options (when allowing s2member to integrate with BP) were grayed out. So it seemed that BP had no control over the options themselves. Which is why I decided to go the route that I did.

    One other reason that I went the way I did, is I know that all the information that I’m grabbing from my users is entirely gathered by the s2member application. In no way does my setup gather information using BP. So it seemed to me to be a better option.

    All in all, i’d be happy to post this up in the codex. If I do, will I be able to edit it? Cause i’d like to keep it updated with all the other things I find along the way.

    Thanks,
    \M


    Myg0t
    Participant

    @myg0t

    Nice, I was actually looking at that a couple of days ago. I had tried a few things out, but to no avail.

    Here’s where i’m at: I’ve commented the above edited section of members-loop.php.

    In my bp-custom.php i’ve copy/pasted the code from the link you sent, and have applied the following edits to it:

        private function get_custom_ids() {
            global $wpdb;
     
            // collection based on an xprofile field
    		// WP_User_Query arguments
    		$args = array (
    			'role'           => 's2member_level2',
    			'fields'         => array( 'id' ),
    		);
    
    		// The User Query
    		$user_query = new WP_User_Query( $args );	
    		//The User Loop
    		if ( ! empty( $user_query->results ) ) {
    			foreach ( $user_query->results as $user ) {
    				$custom_ids = $user.",";
    			}
    		} else {
    			// no users found
    		}
            //$custom_ids = $wpdb->get_col("SELECT user_id FROM {$wpdb->prefix}bp_xprofile_data WHERE field_id = 8 AND value = 'no'");
    		
            return $custom_ids;
        }  

    I also, made the lower two edits you suggested to the $query_array and return $new_count.

    currently i’m getting this error:

    Catchable fatal error: Object of class stdClass could not be converted to string in /home/collegi8/public_html/wp-content/plugins/bp-custom.php on line 30

    line 30 is:

    $custom_ids = $user.",";

    Thanks for all your help man,

    M


    Myg0t
    Participant

    @myg0t

    Alright, so here’s my update. I’ve gotten the list of profiles filtered, here is the code i’m using:

    <?php while ( bp_members() ) : bp_the_member(); ?>
     
    	<?php $user=bp_get_member_user_id();
     
    	$s2member_var = get_user_field ("s2member_access_role", $user);
     
    	if ($s2member_var == "s2member_level2") {
     
    ?>

    The only issue remaining now is that the members page is still paginating based on the ~2000 members.

     photo Capture.png

    As should be seen in this snippet.

    I was thinking maybe I could get more support for this question since it’s purely related to buddypress and not S2member?

    Many thanks,

    M


    Myg0t
    Participant

    @myg0t

    Ummm… Bump?

Viewing 14 replies - 1 through 14 (of 14 total)
Skip to toolbar