WPSessions - Thinking Outside The Box With BuddyPress

Preview:

Citation preview

Customizing BuddyPress And Impressing Your Friends

David “DANGER” Bisset davidbisset.com / @dimensionmedia WoRDCAMP TAMPA 2014 #WCTPA

What Are We Not Going To Talk About?

What Are We Not Going To Talk About?

HOW TO GET FRIENDS

What Are We Not Going To Talk About?

FRIENDS = CLIENTS

What Are We Going To Talk About?

WHAT IS BUDDYPRESS?

What Are We Going To Talk About?

WHAT IS BUDDYPRESS?WHAT IS THE DEFAULT?

What Are We Going To Talk About?

WHAT IS BUDDYPRESS?WHAT IS THE DEFAULT?

WHAT OTHERS HAVE DONE

What Are We Going To Talk About?

WHAT IS BUDDYPRESS?WHAT IS THE DEFAULT?

CODING EXAMPLES FOR DEVELOPERS

WHAT OTHERS HAVE DONE

What Are We Going To Talk About?

WHAT IS BUDDYPRESS?WHAT IS THE DEFAULT?

CODING EXAMPLES FOR DEVELOPERS

START THINKING DIFFERENT

WHAT OTHERS HAVE DONE

BPTESTDRIVE.ORG

Extended Profile Fields

ACCOUNT SETTINGS

FRIEND CONNECTIONS

PRIVATE MESSAGING

ACTIVITY STREAMS

GROUPSNOTIFICATIONS

SITE TRACKING

PROFILE PRIVACY

THEME COMPATIBILITY

REGISTRATION

Activity Streams

ACTIVITY STREAMS

ACTIVITY STREAMS

EXTENDED PROFILE FIELDS

EXTENDED PROFILE FIELDS

EXTENDED PROFILE FIELDS

EXTENDED PROFILE FIELDS

ACCOUNT SETTINGS

FRIEND CONNECTIONS

Friendship Connections

Friendship Connections

PRIVATE MESSAGING

PRIVATE MESSAGING

PRIVATE MESSAGING

GROUPS

GROUPS

BuddyPress “Big Wins”

• OPEN SOURCE

• WORKS WITH ALMOST ANY WORDPRESS THEME

• CONTROL YOUR OWN DATA (NSA PERMITTING)

• CUSTOMIZATION - YOU ARE IN CONTROL

• Great for internal sites, proof of concepts

Is Like Saying...

SAYING BUDDYPRESS JUST “ADDS SOCIAL TO A SITE”

WORDPRESS IS JUST “BLOG SOFTWARE”

FACEBOOK

LINKEDIN

TWITTER

GOOGLE PLUS

INSTAGRAM

INSTAGRAM

The World (And Your Client) Doesn’t Need Another Facebook

IT NEEDS A SOLUTION CUSTOM TAILORED FOR CLIENTS THAT MAKE SENSE

STRAIGHT-FORWARD CONCEPTS

LET’S TAKE A LOOK

RUNNERNETWORK.COMSOCIAL NETWORK SPECIALLY DESIGNED FOR RUNNERS

RUNNERNETWORK.COMSOCIAL NETWORK SPECIALLY DESIGNED FOR RUNNERS

GOVLOOP.COM“KNOWLEDGE NETWORK FOR GOVERNMENT"

GOVLOOP.COM“KNOWLEDGE NETWORK FOR GOVERNMENT"

LIVENINJA.COMLIVE VIDEO CHAT COMMUNITY + NETWORKING

LIVENINJA.COMLIVE VIDEO CHAT COMMUNITY + NETWORKING

STUDYCROSSING.COMINTERACTIVE STUDY GROUPS USING BUDDYPRESS / BBPRESS

STUDYCROSSING.COMINTERACTIVE STUDY GROUPS USING BUDDYPRESS / BBPRESS

STUDYCROSSING.COMINTERACTIVE STUDY GROUPS USING BUDDYPRESS / BBPRESS

STUDYCROSSING.COMINTERACTIVE STUDY GROUPS USING BUDDYPRESS / BBPRESS

STUDYCROSSING.COMINTERACTIVE STUDY GROUPS USING BUDDYPRESS / BBPRESS

Great Ways To Customize BuddyPress

GROUPS EXTENSION API EXTENDING MEMBER PROFILES

CUSTOM NOTIFICATIONS Gamification

SHARING FILES AND DOCUMENTS LIVE CHAT / VIDEO

MOBILE APPS

Great Ways To Customize BuddyPress

GROUPS EXTENSION API EXTENDING MEMBER PROFILES

CUSTOM NOTIFICATIONS Gamification

SHARING FILES AND DOCUMENTS LIVE CHAT / VIDEO

MOBILE APPS

MEMBER PROFILE METADATA

LET’S TAKE A LOOK

function bpupex_update_lat_lon( $user_id, $posted_field_ids, $errors ) {

if ( empty( $errors ) ) {

// safely get the address information

$address = sanitize_text_field( $_POST['field_4'] );$address2 = sanitize_text_field( $_POST['field_5'] );$city = sanitize_text_field( $_POST['field_6'] );$state = sanitize_text_field( $_POST['field_7'] );$zip = sanitize_text_field( $_POST['field_8'] );

if ( $address && $city && $state && $zip ) {

$full_address = urlencode($address . ' ' . $address2 . ' ' . $city . ', ' . $state . ' ' . $zip);

$request_url = "http://maps.googleapis.com/maps/api/geocode/xml?address=".$full_address."&sensor=true";

$xml = wp_remote_get( $request_url, array( 'timeout' => 120, 'sslverify' => false ) );

$xml_response = simplexml_load_string( $xml['body'] );

if ( $xml_response->status->__toString() == "OK" ) {

$lat = $xml_response->result->geometry->location->lat->__toString();$lon = $xml_response->result->geometry->location->lng->__toString();

xprofile_set_field_data ('Latitude', $user_id, $lat);xprofile_set_field_data ('Longitude', $user_id, $lon);

}

} else {

// clear the fields

xprofile_set_field_data ('Latitude', $user_id, false);xprofile_set_field_data ('Longitude', $user_id, false);

}

}

}add_action( 'xprofile_updated_profile', 'bpupex_update_lat_lon', 10, 3 );

xprofile_set_field_data ('Longitude', $user_id, false);

add_action( 'xprofile_updated_profile', 'bpupex_update_lat_lon', 10, 3 );

GROUPS EXTENSION API

LET’S TAKE A LOOK

MEmbers OWN ACTIVITY STREAM OWN FORUM (bbPRESS)

OWN METADATA OWN PRIVACY / INVITE SYSTEM

BuddyPress Groups Have:

GROUPS EXTENSION APIExample: Virtual Classroom

GROUPS EXTENSION APIExample: Crowdfunding Site

GAMEIFICATION

LET’S TAKE A LOOK

Achievements For WordPressDeveloper: Paul Gibbs

Achievements gamifies your WordPress site with challenges, badges, and points. Badges and points are the funnest way to reward and encourage members of your community to participate. Leaderboards and rankings bring friendly competition to your community.

HTTP://WORDPRESS.ORG/PLUGINS/ACHIEVEMENTS/

myCREDDeveloper: Gabriel Merovingi

myCRED is an adaptive points management system that lets you award / charge your users for interacting with your WordPress powered website.

HTTPS://WORDPRESS.ORG/PLUGINS/MYCRED/

BadgeOS Community Add-OnDeveloper: Credly / webdevstudios

BadgeOS™ turns your WordPress site into an achievement and badging system. And with BuddyPress enabled on your site, achievements are not only awarded by demonstrating skills and knowledge, but also by participating in community activities.

HTTP://WORDPRESS.ORG/PLUGINS/BADGEOS-COMMUNITY-ADD-ON/

SCOUT.PCLS.USPIERCE COUNTY LIBRARY (WA)

www.conference.com/groups/session-name

www.conference.com/SESSIONS/session-name

www.PROJECTSOCIAL.com/PROJECTS/PROJECT-name

www.SHARESTORIES.com/STORIES/STORY-name

www.MYFAMILY.com/FAMILIES/FAMILY-name

CUSTOM NOTIFICATIONS

LET’S TAKE A LOOK

CUSTOM NOTIFICATIONS

function wctpa_format_notifications_comments( $action, $item_id, $secondary_item_id, $total_items, $format = 'string' ) {

if ( 'new_comment' === $action ) {$link = get_permalink( $item_id );$title = __( 'New Comment On '.get_the_title( $item_id ), 'buddypress' );

if ( (int) $total_items > 1 ) {$text = sprintf( __('You have %d new comments', 'buddypress' ), (int) $total_items );$filter = 'wctpa_bp_notifications_multiple_new_comment_notification';

} else {if ( !empty( $secondary_item_id ) ) {

$text = sprintf( __('You have %d new comment on %s', 'buddypress' ), (int) $total_items, get_the_title( $item_id ) );

} else {$text = sprintf( __('You have %d new comment', 'buddypress' ), (int) $total_items );

}$filter = 'wctpa_bp_notifications_single_new_comment_notification';

}}

if ( 'string' === $format ) {$return = apply_filters( $filter, '<a href="' . esc_url( $link ) . '" title="' . esc_attr( $title ) . '">' . esc_html( $text ) .

'</a>', (int) $total_items, $text, $link, $item_id, $secondary_item_id );} else {

$return = apply_filters( $filter, array('text' => $text,'link' => $link

), $link, (int) $total_items, $text, $link, $item_id, $secondary_item_id );}

do_action( 'wctpa_format_notifications_comments', $action, $item_id, $secondary_item_id, $total_items );

return $return;}

CUSTOM NOTIFICATIONS

function wctpa_format_notifications_comments( $action, $item_id, $secondary_item_id, $total_items, $format = 'string' ) {

if ( 'new_comment' === $action ) {$link = get_permalink( $item_id );$title = __( 'New Comment On '.get_the_title( $item_id ), 'buddypress' );

if ( (int) $total_items > 1 ) {$text = sprintf( __('You have %d new comments', 'buddypress' ), (int) $total_items );$filter = 'wctpa_bp_notifications_multiple_new_comment_notification';

} else {if ( !empty( $secondary_item_id ) ) {

$text = sprintf( __('You have %d new comment on %s', 'buddypress' ), (int) $total_items, get_the_title( $item_id ) );

} else {$text = sprintf( __('You have %d new comment', 'buddypress' ), (int) $total_items );

}$filter = 'wctpa_bp_notifications_single_new_comment_notification';

}}

if ( 'string' === $format ) {$return = apply_filters( $filter, '<a href="' . esc_url( $link ) . '" title="' . esc_attr( $title ) . '">' . esc_html( $text ) .

'</a>', (int) $total_items, $text, $link, $item_id, $secondary_item_id );} else {

$return = apply_filters( $filter, array('text' => $text,'link' => $link

), $link, (int) $total_items, $text, $link, $item_id, $secondary_item_id );}

do_action( 'wctpa_format_notifications_comments', $action, $item_id, $secondary_item_id, $total_items );

return $return;}

CUSTOM NOTIFICATIONS

function wctpa_format_notifications_comments( $action, $item_id, $secondary_item_id, $total_items, $format = 'string' ) {

if ( 'new_comment' === $action ) {$link = get_permalink( $item_id );$title = __( 'New Comment On '.get_the_title( $item_id ), 'buddypress' );

if ( (int) $total_items > 1 ) {$text = sprintf( __('You have %d new comments', 'buddypress' ), (int) $total_items );$filter = 'wctpa_bp_notifications_multiple_new_comment_notification';

} else {if ( !empty( $secondary_item_id ) ) {

$text = sprintf( __('You have %d new comment on %s', 'buddypress' ), (int) $total_items, get_the_title( $item_id ) );

} else {$text = sprintf( __('You have %d new comment', 'buddypress' ), (int) $total_items );

}$filter = 'wctpa_bp_notifications_single_new_comment_notification';

}}

if ( 'string' === $format ) {$return = apply_filters( $filter, '<a href="' . esc_url( $link ) . '" title="' . esc_attr( $title ) . '">' . esc_html( $text ) .

'</a>', (int) $total_items, $text, $link, $item_id, $secondary_item_id );} else {

$return = apply_filters( $filter, array('text' => $text,'link' => $link

), $link, (int) $total_items, $text, $link, $item_id, $secondary_item_id );}

do_action( 'wctpa_format_notifications_comments', $action, $item_id, $secondary_item_id, $total_items );

return $return;}

CUSTOM NOTIFICATIONS

The Best BuddyPress Sites ARE THE ONES WHERE THERE’s NO CLUE

BUDDYPRESS WAS USED

The Best BuddyPress Sites ARE THE ONES WHERE THERE’s NO CLUE

BUDDYPRESS WAS USED

Software As A Service (SaaS)Flox Developer: John JAMES JACOBY

first WordPress-powered application to jump into hosting full-featured social networks.

HTTPS://FLOX.IO/ HTTPS://STORE.FLOX.IO/DOWNLOADS/BUDDIOS/

Software As A Service (SaaS)Flox Developer: John JAMES JACOBY

first WordPress-powered application to jump into hosting full-featured social networks.

HTTPS://FLOX.IO/ HTTPS://STORE.FLOX.IO/DOWNLOADS/BUDDIOS/

The Challenge: NOT MANY UNIQUE / NICHE

BUDDYPRESS THEMES EXIST

Don’t Sit There!GET INVOLVED!

Resources:BUDDYPRESS.ORG CODEX

Bp-TRICKS.com - BuddyPress Web Hosting GUIDE

wordpress.tv/tag/buddypress

github.com/dimensionmedia

PEOPLE TO FOLLOW@jjj @bmess @pgibbs @boone @buddypressdev @BoweFrankema @karmatosed

@modemlooper @r-a-y @slaFFik @imath @pollyplummer @konradsroka @rociovaldi

THANK YOU.David “SHOULD HAVE HAD A V8” Bisset davidbisset.com / @dimensionmedia