Skip to:
Content
Pages
Categories
Search
Top
Bottom

Creating Circles


  • synfrag
    Participant

    @synfrag

    Hello,

    With the absence of a circles type feature for friends, I need to be able to have my members flag their friends for a permissions issue I’m working on. Just a simple yes or no flag to allow them to see photo galleries and certain activity updates. I’m having trouble deciding on how to approach this. My first though is to add into the friend items an ajax checkbox that will update the friends table with a yes/no or boolean values.

    The JS / Ajax

    $('#private').on('click', function() {
        var checkStatus = this.checked ? 'ON' : 'OFF';
    
        $.post("private_update.php", {"$is_private": checkStatus}, 
        function(data) {
            $('#update').html(data);
        });
    });

    The PHP/SQL

    function private_friends($friend_userid) {
    	global $wpdb;
    	if (isset($_POST['private'])):
    		$is_private = $_POST['private'];
    		$not_private = $wpdb->get_var("UPDATE wp_bp_friends SET private = '".$is_private."' WHERE private != '".$is_dirty."'");
    	endif;
    };
    

    Does anyone have some insight here? I haven’t written anything dealing with Buddypress functions before so it’s new territory for me.

Viewing 1 replies (of 1 total)

  • 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 1 replies (of 1 total)
  • The topic ‘Creating Circles’ is closed to new replies.
Skip to toolbar