Skip to:
Content
Pages
Categories
Search
Top
Bottom

Forum Replies Created

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

  • synfrag
    Participant

    @synfrag

    That works to an extent but it filters everything on the page and what I need is essentially two user’s activity streams on the same page. Any advice on how to make that work? It sounds like someone was trying to do something very similar in this post but it was years ago


    synfrag
    Participant

    @synfrag

    I actually didn’t know about that, I’m fairly new to WordPress. I’ll certainly update that and the companion queries that go with it once I can get this function sorted out.


    synfrag
    Participant

    @synfrag

    My mistake on the first post, I had some things mixed up. Here is the full action & function.

     // Get partner ID
     function sw_partner_activity() {
    	 do_action('sw_partner_activity');
     }
     
     
    function sw_partner_id() {
    	
    	global $bp, $wpdb;
    	$myid = $bp->loggedin_user->id;
    	$ourlink = $wpdb->get_var("SELECT meta_value FROM $wpdb->usermeta WHERE meta_key = 'linkid' AND user_id = '$myid'");
    	$partnerid = $wpdb->get_var("SELECT user_id from $wpdb->usermeta where meta_key='linkid' AND meta_value = '$ourlink' AND user_id != '$myid'");
    	$partner =  '&user_id=' . $partnerid;
    	
    	return $partner;
    	
    }
    add_action('sw_partner_activity', 'sw_partner_id'); 

    And the proper call:
    <?php sw_partner_activity();?>

    And the error (with echo of query results):
    Error


    synfrag
    Participant

    @synfrag

    No, it’s a custom hook. I’ve tried using existing hooks as well. If I change the return to echo $partner it’s showing the result of the query, it just wont pass the variable to the activity loop here

    if ( bp_has_activities( bp_ajax_querystring( 'activity' ) . $partner ) ) :


    synfrag
    Participant

    @synfrag

    I realize the following is completely wrong but it does show what I am trying to do.

    $not_private = $wpdb->get_var("UPDATE wp_bp_friends SET private = '".$is_private."' WHERE private != '".$is_private."'");

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