function get_status_sql($link_owner_user_id = false, $format_string = '%s') { global $bp; // everyone can see the public links $status_opts = array(self::STATUS_PUBLIC); // if user is the site admin or is logged in and viewing their own links, then no limitations if (bp_links_is_admin() || bp_is_my_profile()) { // add all statuses $status_opts[] = self::STATUS_FRIENDS; $status_opts[] = self::STATUS_HIDDEN; } else { // if logged in user is a friend, show friends only links too if (bp_links_is_friends_enabled()) { if ($link_owner_user_id && $link_owner_user_id != $bp->loggedin_user->id && friends_check_friendship($link_owner_user_id, $bp->loggedin_user->id)) { $status_opts[] = self::STATUS_FRIENDS; } } } // return the sql string return sprintf($format_string, sprintf('status IN (%s)', join(',', $status_opts))); }
function bp_link_is_admin() { return true === bp_is_item_admin() || true === bp_links_is_admin(); }
/** * Load profile Links personal activity page */ function bp_links_screen_personal_links_activity() { global $bp; if (false === bp_links_is_admin()) { $bp->is_item_admin = false; } do_action('bp_links_screen_personal_links_activity'); bp_core_load_template(apply_filters('bp_links_template_activity_personal_links', 'members/single/home')); }