function bp_dtheme_js_terms() { ?> <script type="text/javascript"> <?php if (get_option('priority_loading') == 'enable') { ?> head.ready(function() { <?php } ?> var bp_terms_my_favs = '<?php _e("My Favorites", "buddypress"); ?> '; var bp_terms_accepted = '<?php _e("Accepted", "buddypress"); ?> '; var bp_terms_rejected = '<?php _e("Rejected", "buddypress"); ?> '; var bp_terms_show_all_comments = '<?php _e("Show all comments for this thread", "buddypress"); ?> '; var bp_terms_show_all = '<?php _e("Show all", "buddypress"); ?> '; var bp_terms_comments = '<?php _e("comments", "buddypress"); ?> '; var bp_terms_close = '<?php _e("Close", "buddypress"); ?> '; var bp_terms_mention_explain = '<?php printf(__("%s is a unique identifier for %s that you can type into any message on this site. %s will be sent a notification and a link to your message any time you use it.", "buddypress"), '@' . bp_get_displayed_user_username(), bp_get_user_firstname(bp_get_displayed_user_fullname()), bp_get_user_firstname(bp_get_displayed_user_fullname())); ?> '; <?php if (get_option('priority_loading') == 'enable') { ?> }); <?php } ?> </script> <?php }
function bp_tpack_init() { global $wp_themes; /* Check to make sure the active theme is not bp-default */ if ('bp-default' == get_option('template')) { return false; } /* Load the default BuddyPress AJAX functions */ if (!(int) get_option('bp_tpack_disable_js')) { require_once BP_PLUGIN_DIR . '/bp-themes/bp-default/_inc/ajax.php'; /* Load the default BuddyPress javascript */ wp_enqueue_script('bp-js', BP_PLUGIN_URL . '/bp-themes/bp-default/_inc/global.js', array('jquery')); // Add words that we need to use in JS to the end of the page so they can be // translated and still used. $params = array('my_favs' => __('My Favorites', 'buddypress'), 'accepted' => __('Accepted', 'buddypress'), 'rejected' => __('Rejected', 'buddypress'), 'show_all_comments' => __('Show all comments for this thread', 'buddypress'), 'show_all' => __('Show all', 'buddypress'), 'comments' => __('comments', 'buddypress'), 'close' => __('Close', 'buddypress'), 'mention_explain' => sprintf(__("%s is a unique identifier for %s that you can type into any message on this site. %s will be sent a notification and a link to your message any time you use it.", 'buddypress'), '@' . bp_get_displayed_user_username(), bp_get_user_firstname(bp_get_displayed_user_fullname()), bp_get_user_firstname(bp_get_displayed_user_fullname()))); wp_localize_script('bp-js', 'BP_DTheme', $params); } /* Add the wireframe BP page styles */ if (!(int) get_option('bp_tpack_disable_css')) { wp_enqueue_style('bp-css', plugins_url($path = basename(dirname(__FILE__))) . '/bp.css'); } }
/** * Enqueues BuddyPress JS and related AJAX functions * * @since 1.2 */ function bp_tpack_enqueue_scripts() { // Do not enqueue JS if it's disabled if (get_option('bp_tpack_disable_js')) { return; } // Add words that we need to use in JS to the end of the page so they can be translated and still used. $params = array('my_favs' => __('My Favorites', 'buddypress'), 'accepted' => __('Accepted', 'buddypress'), 'rejected' => __('Rejected', 'buddypress'), 'show_all_comments' => __('Show all comments for this thread', 'buddypress'), 'show_all' => __('Show all', 'buddypress'), 'comments' => __('comments', 'buddypress'), 'close' => __('Close', 'buddypress')); // BP 1.5+ if (version_compare(BP_VERSION, '1.3', '>')) { // Bump this when changes are made to bust cache $version = '20110818'; $params['view'] = __('View', 'buddypress'); } else { $version = '20110729'; if (bp_displayed_user_id()) { $params['mention_explain'] = sprintf(__("%s is a unique identifier for %s that you can type into any message on this site. %s will be sent a notification and a link to your message any time you use it.", 'buddypress'), '@' . bp_get_displayed_user_username(), bp_get_user_firstname(bp_get_displayed_user_fullname()), bp_get_user_firstname(bp_get_displayed_user_fullname())); } } // Enqueue the global JS - Ajax will not work without it nxt_enqueue_script('dtheme-ajax-js', BP_PLUGIN_URL . '/bp-themes/bp-default/_inc/global.js', array('jquery'), $version); // Localize the JS strings nxt_localize_script('dtheme-ajax-js', 'BP_DTheme', $params); }
/** * Output the username of the displayed user. */ function bp_displayed_user_username() { echo bp_get_displayed_user_username(); }
// Load the AJAX functions for the theme require_once( TEMPLATEPATH . '/_inc/ajax.php' ); // Load the javascript for the theme wp_enqueue_script( 'dtheme-ajax-js', get_template_directory_uri() . '/_inc/global.js', array( 'jquery' ) ); // Add words that we need to use in JS to the end of the page so they can be translated and still used. $params = array( 'my_favs' => __( 'My Favorites', 'buddypress' ), 'accepted' => __( 'Accepted', 'buddypress' ), 'rejected' => __( 'Rejected', 'buddypress' ), 'show_all_comments' => __( 'Show all comments for this thread', 'buddypress' ), 'show_all' => __( 'Show all', 'buddypress' ), 'comments' => __( 'comments', 'buddypress' ), 'close' => __( 'Close', 'buddypress' ), 'mention_explain' => sprintf( __( "%s is a unique identifier for %s that you can type into any message on this site. %s will be sent a notification and a link to your message any time you use it.", 'buddypress' ), '@' . bp_get_displayed_user_username(), bp_get_user_firstname( bp_get_displayed_user_fullname() ), bp_get_user_firstname( bp_get_displayed_user_fullname() ) ) ); wp_localize_script( 'dtheme-ajax-js', 'BP_DTheme', $params ); /** * Add the JS needed for blog comment replies * * @package BuddyPress Theme * @since 1.2 */ function bp_dtheme_add_blog_comments_js() { if ( is_singular() ) wp_enqueue_script( 'comment-reply' ); } add_action( 'template_redirect', 'bp_dtheme_add_blog_comments_js' ); /**
/** * Gets the item id of the item (eg group, user) associated with the page you're on. * * @since 1.0-beta * * @return str $view The current item type */ function setup_item() { global $bp; if (empty($this->item_type)) { return false; } $id = ''; $name = ''; $slug = ''; switch ($this->item_type) { case 'group': if (bp_is_active('groups') && bp_is_group()) { $group = groups_get_current_group(); $id = $group->id; $name = $group->name; $slug = $group->slug; } break; case 'user': if (bp_is_user()) { $id = bp_displayed_user_id(); $name = bp_get_displayed_user_fullname(); $slug = bp_get_displayed_user_username(); } break; } // Todo: abstract into groups. Will be a pain $this->item_id = apply_filters('bp_docs_get_item_id', $id); $this->item_name = apply_filters('bp_docs_get_item_name', $name); $this->item_slug = apply_filters('bp_docs_get_item_slug', $slug); // Put some stuff in $bp $bp->bp_docs->current_item = $this->item_id; }
/** * Map IdeaStream displayed username to BuddyPress one * * @package WP Idea Stream * @subpackage buddypress/functions * * @since 2.0.0 * * @param string $username the username * @uses bp_get_displayed_user_username() to get displayed user nicename * @return string the username */ function wp_idea_stream_buddypress_displayed_user_username($username = '') { if (empty($username)) { $username = bp_get_displayed_user_username(); } return $username; }
function meso_schema_breadcrumbs() { global $post; $schema_on = ''; $schema_link = ''; $schema_prop_url = ''; $schema_prop_title = ''; $showOnHome = 1; // 1 - show breadcrumbs on the homepage, 0 - don't show $delimiter = ' » '; // delimiter between crumbs $home = __('Home', 'mesocolumn'); // text for the 'Home' link $showCurrent = 1; // 1 - show current post/page title in breadcrumbs, 0 - don't show $before = '<span class="current">'; // tag before the current crumb $after = '</span>'; // tag after the current crumb $schema_breadcrumb_on = get_theme_mod('schema_breadcrumb_on'); if ($schema_breadcrumb_on == 'enable') { $schema_link = ' itemscope itemtype="http://data-vocabulary.org/Breadcrumb"'; $schema_prop_url = ' itemprop="url"'; $schema_prop_title = ' itemprop="title"'; } $homeLink = home_url(); if (is_home() || is_front_page()) { if ($showOnHome == 1) { echo '<div id="breadcrumbs"><div class="innerwrap">'; echo __('You are here: ', 'mesocolumn'); echo '<span' . $schema_link . '><a' . $schema_prop_url . ' href="' . $homeLink . '">' . '<span' . $schema_prop_title . '>' . $home . '</span>' . '</a></span>'; echo '</div></div>'; } } else { echo '<div id="breadcrumbs"><div class="innerwrap">'; if (!is_single()) { echo __('You are here: ', 'mesocolumn'); } echo '<span' . $schema_link . '><a' . $schema_prop_url . ' href="' . $homeLink . '">' . '<span' . $schema_prop_title . '>' . $home . '</span>' . '</a></span>' . $delimiter . ' '; if (is_category()) { $thisCat = get_category(get_query_var('cat'), false); if ($thisCat->parent != 0) { $category_link = get_category_link($thisCat->parent); echo '<span' . $schema_link . '><a' . $schema_prop_url . ' href="' . $category_link . '">' . '<span' . $schema_prop_title . '>' . get_cat_name($thisCat->parent) . '</span>' . '</a></span>' . $delimiter . ' '; } $category_id = get_cat_ID(single_cat_title('', false)); $category_link = get_category_link($category_id); echo '<span' . $schema_link . '><a' . $schema_prop_url . ' href="' . $category_link . '">' . '<span' . $schema_prop_title . '>' . single_cat_title('', false) . '</span>' . '</a></span>'; } elseif (is_search()) { echo __('Search results for', 'mesocolumn') . ' "' . get_search_query() . '"'; } elseif (is_day()) { echo '<span' . $schema_link . '><a' . $schema_prop_url . ' href="' . get_year_link(get_the_time('Y')) . '">' . '<span' . $schema_prop_title . '>' . get_the_time('Y') . '</span>' . '</a></span>' . $delimiter . ' '; echo '<span' . $schema_link . '><a' . $schema_prop_url . ' href="' . get_month_link(get_the_time('Y'), get_the_time('m')) . '">' . '<span' . $schema_prop_title . '>' . get_the_time('F') . '</span>' . '</a></span>' . $delimiter . ' '; echo '<span' . $schema_link . '><a' . $schema_prop_url . ' href="' . get_day_link(get_the_time('Y'), get_the_time('m'), get_the_time('d')) . '">' . '<span' . $schema_prop_title . '>' . get_the_time('d') . '</span>' . '</a></span>'; } elseif (is_month()) { echo '<span' . $schema_link . '><a' . $schema_prop_url . ' href="' . get_year_link(get_the_time('Y')) . '">' . '<span' . $schema_prop_title . '>' . get_the_time('Y') . '</span>' . '</a></span>' . $delimiter . ' '; echo '<span' . $schema_link . '><a' . $schema_prop_url . ' href="' . get_month_link(get_the_time('Y'), get_the_time('m')) . '">' . '<span' . $schema_prop_title . '>' . get_the_time('F') . '</span>' . '</a></span>'; } elseif (is_year()) { echo '<span' . $schema_link . '><a' . $schema_prop_url . ' href="' . get_year_link(get_the_time('Y')) . '">' . '<span' . $schema_prop_title . '>' . get_the_time('Y') . '</span>' . '</a></span>'; } elseif (is_single() && !is_attachment()) { if (get_post_type() != 'post') { $post_type = get_post_type_object(get_post_type()); $slug = $post_type->rewrite; echo '<span' . $schema_link . '><a' . $schema_prop_url . ' href="' . $homeLink . '/' . $slug['slug'] . '">' . '<span' . $schema_prop_title . '>' . $post_type->labels->singular_name . '</span>' . '</a></span>'; // get post type by post $post_type = $post->post_type; // get post type taxonomies $taxonomies = get_object_taxonomies($post_type, 'objects'); if ($taxonomies) { foreach ($taxonomies as $taxonomy_slug => $taxonomy) { // get the terms related to post $terms = get_the_terms($post->ID, $taxonomy_slug); if (!empty($terms)) { foreach ($terms as $term) { $taxlist .= ' ' . $delimiter . ' ' . '<span' . $schema_link . '><a' . $schema_prop_url . ' href="' . get_term_link($term->slug, $taxonomy_slug) . '">' . '<span' . $schema_prop_title . '>' . ucfirst($term->name) . '</span>' . '</a></span>'; } } } if ($taxlist) { echo $taxlist; } } echo ' ' . $delimiter . ' ' . __('You are reading »', 'mesocolumn'); } else { $category = get_the_category(); if ($category) { foreach ($category as $cat) { echo '<span' . $schema_link . '><a' . $schema_prop_url . ' href="' . get_category_link($cat->term_id) . '">' . '<span' . $schema_prop_title . '>' . $cat->name . '</span>' . '</a></span>' . $delimiter . ' '; } } echo __('You are reading »', 'mesocolumn'); } } elseif (!is_single() && !is_page() && get_post_type() != 'post' && !is_404()) { $post_type = get_post_type_object(get_post_type()); echo $before . $post_type->labels->singular_name . $after; } elseif (is_attachment()) { $parent = get_post($post->post_parent); $cat = get_the_category($parent->ID); $cat = $cat[0]; if ($cat) { echo get_category_parents($cat, TRUE, ' ' . $delimiter . ' '); } echo '<span' . $schema_link . '><a' . $schema_prop_url . ' href="' . get_permalink($parent) . '">' . '<span' . $schema_prop_title . '>' . $parent->post_title . '</span>' . '</a></span>'; if ($showCurrent == 1) { echo ' ' . $delimiter . ' ' . $before . get_the_title() . $after; } } elseif (is_page() && !$post->post_parent) { if (class_exists('buddypress')) { global $bp; if (bp_is_groups_component()) { echo '<span' . $schema_link . '><a' . $schema_prop_url . ' href="' . home_url() . '/' . bp_get_root_slug('groups') . '">' . '<span' . $schema_prop_title . '>' . bp_get_root_slug('groups') . '</span>' . '</a></span>'; if (!bp_is_directory()) { echo $delimiter . '<span' . $schema_link . '><a' . $schema_prop_url . ' href="' . home_url() . '/' . bp_get_root_slug('groups') . '/' . bp_current_item() . '">' . '<span' . $schema_prop_title . '>' . bp_current_item() . '</span>' . '</a></span>'; if (bp_current_action()) { echo $delimiter . '<span' . $schema_link . '><a' . $schema_prop_url . ' href="' . home_url() . '/' . bp_get_root_slug('groups') . '/' . bp_current_item() . '/' . bp_current_action() . '">' . '<span' . $schema_prop_title . '>' . bp_current_action() . '</span>' . '</a></span>'; } } } else { if (bp_is_members_directory()) { echo '<span' . $schema_link . '><a' . $schema_prop_url . ' href="' . home_url() . '/' . bp_get_root_slug('members') . '">' . '<span' . $schema_prop_title . '>' . bp_get_root_slug('members') . '</span>' . '</a></span>'; } else { if (bp_is_user()) { echo '<span' . $schema_link . '><a' . $schema_prop_url . ' href="' . home_url() . '/' . bp_get_root_slug('members') . '">' . '<span' . $schema_prop_title . '>' . bp_get_root_slug('members') . '</span>' . '</a></span>'; echo $delimiter . '<span' . $schema_link . '><a' . $schema_prop_url . ' href="' . bp_core_get_user_domain($bp->displayed_user->id) . '">' . '<span' . $schema_prop_title . '>' . bp_get_displayed_user_username() . '</span>' . '</a></span>'; if (bp_current_action()) { echo $delimiter . '<span' . $schema_link . '><a' . $schema_prop_url . ' href="' . bp_core_get_user_domain($bp->displayed_user->id) . bp_current_component() . '">' . '<span' . $schema_prop_title . '>' . bp_current_component() . '</span>' . '</a></span>'; } } else { if (bp_is_directory()) { echo '<span' . $schema_link . '><a' . $schema_prop_url . ' href="' . get_permalink() . '">' . '<span' . $schema_prop_title . '>' . bp_current_component() . '</span>' . '</a></span>'; } else { echo '<span' . $schema_link . '><a' . $schema_prop_url . ' href="' . get_permalink() . '">' . '<span' . $schema_prop_title . '>' . the_title_attribute('echo=0') . '</span>' . '</a></span>'; } } } } } else { echo '<span' . $schema_link . '><a' . $schema_prop_url . ' href="' . get_permalink() . '">' . '<span' . $schema_prop_title . '>' . the_title_attribute('echo=0') . '</span>' . '</a></span>'; } } elseif (is_page() && $post->post_parent) { $parent_id = $post->post_parent; $breadcrumbs = array(); while ($parent_id) { $page = get_page($parent_id); $breadcrumbs[] = '<span' . $schema_link . '><a' . $schema_prop_url . ' href="' . get_permalink($page->ID) . '">' . '<span' . $schema_prop_title . '>' . get_the_title($page->ID) . '</span>' . '</a></span>'; $parent_id = $page->post_parent; } $breadcrumbs = array_reverse($breadcrumbs); for ($i = 0; $i < count($breadcrumbs); $i++) { echo $breadcrumbs[$i]; if ($i != count($breadcrumbs) - 1) { echo ' ' . $delimiter . ' '; } } echo $delimiter . '<span' . $schema_link . '><a' . $schema_prop_url . ' href="' . get_permalink() . '">' . '<span' . $schema_prop_title . '>' . the_title_attribute('echo=0') . '</span>' . '</a></span>'; } elseif (is_tag()) { $tag_id = get_term_by('name', single_cat_title('', false), 'post_tag'); if ($tag_id) { $tag_link = get_tag_link($tag_id->term_id); } echo '<span' . $schema_link . '><a' . $schema_prop_url . ' href="' . $tag_link . '">' . '<span' . $schema_prop_title . '>' . single_cat_title('', false) . '</span>' . '</a></span>'; } elseif (is_author()) { global $author; $userdata = get_userdata($author); echo '<span' . $schema_link . '><a' . $schema_prop_url . ' href="' . get_author_posts_url($userdata->ID) . '">' . '<span' . $schema_prop_title . '>' . $userdata->display_name . '</span>' . '</a></span>'; } elseif (is_404()) { echo ' ' . $delimiter . ' ' . __('Error 404', 'mesocolumn'); } if (get_query_var('paged')) { if (is_category() || is_day() || is_month() || is_year() || is_search() || is_tag() || is_author()) { echo ' ('; } echo ' ' . $delimiter . ' ' . __('Page', 'mesocolumn') . ' ' . get_query_var('paged'); if (is_category() || is_day() || is_month() || is_year() || is_search() || is_tag() || is_author()) { echo ')'; } } echo '</div></div>'; } }
function bp_mytheme_post_update() { global $bp; // Check the nonce check_admin_referer('post_update', '_wpnonce_post_update'); if (!is_user_logged_in()) { echo '-1'; return false; } if (empty($_POST['content'])) { echo '-1<div id="message" class="error"><p>' . __('Please enter some content to post.', 'buddypress') . '</p></div>'; return false; } if (empty($_POST['object']) && function_exists('bp_activity_post_update')) { if (!bp_is_home() && bp_is_member()) { $content = "@" . bp_get_displayed_user_username() . " " . $_POST['content']; } else { $content = $_POST['content']; } $activity_id = bp_activity_post_update(array('content' => $content)); } elseif ($_POST['object'] == 'groups') { if (!empty($_POST['item_id']) && function_exists('groups_post_update')) { $activity_id = groups_post_update(array('content' => $_POST['content'], 'group_id' => $_POST['item_id'])); } } else { $activity_id = apply_filters('bp_activity_custom_update', $_POST['object'], $_POST['item_id'], $_POST['content']); } if (!$activity_id) { echo '-1<div id="message" class="error"><p>' . __('There was a problem posting your update, please try again.', 'buddypress') . '</p></div>'; return false; } if (bp_has_activities('include=' . $activity_id)) { ?> <?php while (bp_activities()) { bp_the_activity(); ?> <?php locate_template(array('activity/entry-wall.php'), true); ?> <?php } ?> <?php } }
function amt_buddypress_jsonld_schemaorg($metadata_arr, $post, $options, $attachments, $embedded_media) { // User Profiles // Determines if a BuddyPress user profile has been requested if (bp_is_user_profile()) { // https://codex.buddypress.org/developer/the-bp-global/ global $bp; // $user_id = $bp->displayed_user->id; $user_id = bp_displayed_user_id(); // $user_domain = $bp->displayed_user->domain; // bp_core_get_user_domain( bp_displayed_user_id() ) $user_domain = bp_displayed_user_domain(); $user_profile_url = trailingslashit(bp_displayed_user_domain() . amt_bp_get_profile_slug()); $user_fullname = $bp->displayed_user->fullname; // $user_fullname = bp_displayed_user_fullname(); // $user_username = $bp->displayed_user->user_login; $user_username = bp_get_displayed_user_username(); //$wp_user_obj = get_user_by( 'id', $user_id ); $wp_user_obj = get_userdata($user_id); //var_dump($wp_user_obj); // Context $metadata_arr['@context'] = 'http://schema.org'; // Schema.org type $metadata_arr['@type'] = 'Person'; // name $metadata_arr['name'] = esc_attr($user_fullname); // URL $metadata_arr['url'] = esc_url($user_profile_url, array('http', 'https')); // mainEntityOfPage $metadata_arr['mainEntityOfPage'] = esc_url($user_profile_url, array('http', 'https')); // Related resources as sameAs $metadata_arr['sameAs'] = array(); // Facebook Profile //$fb_author_url = get_the_author_meta('amt_facebook_author_profile_url', $user_id); $fb_author_url = get_user_meta($user_id, 'amt_facebook_author_profile_url', true); if (!empty($fb_author_url)) { $metadata_arr['sameAs'][] = esc_url($fb_author_url, array('http', 'https')); } // Twitter //$twitter_author_username = get_the_author_meta('amt_twitter_author_username', $user_id); $twitter_author_username = get_user_meta($user_id, 'amt_twitter_author_username', true); if (!empty($twitter_author_username)) { $metadata_arr['sameAs'][] = 'https://twitter.com/' . esc_attr($twitter_author_username); } // Google+ //$googleplus_author_url = get_the_author_meta('amt_googleplus_author_profile_url', $wp_user_obj); $googleplus_author_url = get_user_meta($user_id, 'amt_googleplus_author_profile_url', true); if (!empty($googleplus_author_url)) { $metadata_arr['sameAs'][] = esc_url($googleplus_author_url, array('http', 'https')); } // Determines if Extended Profiles component is active. if (!bp_is_active('xprofile')) { // Website //$website_url = get_user_meta($user_id, 'amt_googleplus_author_profile_url', true); $website_url = get_the_author_meta('user_url', $user_id); if (!empty($website_url)) { $metadata_arr['sameAs'][] = esc_url($website_url, array('http', 'https')); } // Description $author_description = sanitize_text_field(amt_sanitize_description($wp_user_obj->description)); if (empty($author_description)) { $metadata_arr['description'] = esc_attr(__('Profile of', 'add-meta-tags') . ' ' . $wp_user_obj->display_name); } else { $metadata_arr['description'] = esc_attr($author_description); } // Profile Image $author_email = sanitize_email($wp_user_obj->user_email); $avatar_size = apply_filters('amt_bp_avatar_size', array('width' => 50, 'height' => 50)); $avatar_url = ''; // First try to get the avatar link by using get_avatar(). // Important: for this to work the "Show Avatars" option should be enabled in Settings > Discussion. $avatar_img = get_avatar(get_the_author_meta('ID', $wp_user_obj->ID), $avatar_size, '', get_the_author_meta('display_name', $wp_user_obj->ID)); if (!empty($avatar_img)) { if (preg_match("#src=['\"]([^'\"]+)['\"]#", $avatar_img, $matches)) { $avatar_url = $matches[1]; } } elseif (!empty($author_email)) { // If the user has provided an email, we use it to construct a gravatar link. $avatar_url = "http://www.gravatar.com/avatar/" . md5($author_email) . "?s=" . $avatar_size; } if (!empty($avatar_url)) { //$avatar_url = html_entity_decode($avatar_url, ENT_NOQUOTES, 'UTF-8'); $metadata_arr['image'] = esc_url($avatar_url); } // familyName $last_name = $wp_user_obj->last_name; if (!empty($last_name)) { $metadata_arr['familyName'] = esc_attr($last_name); } // givenName $first_name = $wp_user_obj->first_name; if (!empty($first_name)) { $metadata_arr['givenName'] = esc_attr($first_name); } // Extended Profiles } else { // https://codex.buddypress.org/themes/guides/displaying-extended-profile-fields-on-member-profiles/ $xprofile_field_map = amt_buddypress_get_xprofile_field_map(); // Get list of IDs of public fields $xprofile_public_fields = bp_xprofile_get_fields_by_visibility_levels($user_id, array('public')); // Website $field_value = amt_bp_get_profile_field_data('website', $user_id, $xprofile_field_map, $xprofile_public_fields); $field_value = sanitize_text_field($field_value); if (!empty($field_value)) { $metadata_arr['sameAs'][] = esc_url($field_value, array('http', 'https')); } // Description $field_value = amt_bp_get_profile_field_data('description', $user_id, $xprofile_field_map, $xprofile_public_fields); $field_value = sanitize_text_field(amt_sanitize_description($field_value)); if (!empty($field_value)) { $metadata_arr['description'] = esc_attr($field_value); } else { $metadata_arr['description'] = esc_attr(__('Profile of', 'add-meta-tags') . ' ' . $user_fullname); } // Profile Image // Important: for this to work the "Show Avatars" option should be enabled in Settings > Discussion. $avatar_size = apply_filters('amt_bp_avatar_size', array('width' => 50, 'height' => 50)); $avatar_url = ''; $avatar_args = array('item_id' => $user_id, 'width' => $avatar_size['width'], 'height' => $avatar_size['height']); $avatar_img = bp_core_fetch_avatar($avatar_args); if (!empty($avatar_img)) { if (preg_match("#src=['\"]([^'\"]+)['\"]#", $avatar_img, $matches)) { $avatar_url = $matches[1]; } } if (!empty($avatar_url)) { //$avatar_url = html_entity_decode($avatar_url, ENT_NOQUOTES, 'UTF-8'); $metadata_arr['image'] = esc_url($avatar_url); } // familyName $has_last_name = false; $field_value = amt_bp_get_profile_field_data('last_name', $user_id, $xprofile_field_map, $xprofile_public_fields); $field_value = sanitize_text_field($field_value); if (!empty($field_value)) { $metadata_arr['familyName'] = esc_attr($field_value); $has_last_name = true; } // givenName $has_first_name = false; $field_value = amt_bp_get_profile_field_data('first_name', $user_id, $xprofile_field_map, $xprofile_public_fields); $field_value = sanitize_text_field($field_value); if (!empty($field_value)) { $metadata_arr['givenName'] = esc_attr($field_value); $has_first_name = true; } // Generate first and last name from full name if needed. if (!$has_last_name && !$has_first_name && !empty($user_fullname)) { $parts = explode(' ', $user_fullname); $last_name = sanitize_text_field(array_pop($parts)); // Removes and returns the element off the end of array if (!empty($last_name)) { $metadata_arr['familyName'] = esc_attr($last_name); } $first_name = sanitize_text_field(implode(' ', $parts)); if (!empty($first_name)) { $metadata_arr['givenName'] = esc_attr($first_name); } } // alternateName $field_value = amt_bp_get_profile_field_data('nickname', $user_id, $xprofile_field_map, $xprofile_public_fields); $field_value = sanitize_text_field($field_value); if (!empty($field_value)) { $metadata_arr['alternateName'] = esc_attr($field_value); } // additionalName $field_value = amt_bp_get_profile_field_data('additional_name', $user_id, $xprofile_field_map, $xprofile_public_fields); $field_value = sanitize_text_field($field_value); if (!empty($field_value)) { $metadata_arr['additionalName'] = esc_attr($field_value); } // honorificPrefix $field_value = amt_bp_get_profile_field_data('honorific_prefix', $user_id, $xprofile_field_map, $xprofile_public_fields); $field_value = sanitize_text_field($field_value); if (!empty($field_value)) { $metadata_arr['honorificPrefix'] = esc_attr($field_value); } // honorificSuffix $field_value = amt_bp_get_profile_field_data('honorific_suffix', $user_id, $xprofile_field_map, $xprofile_public_fields); $field_value = sanitize_text_field($field_value); if (!empty($field_value)) { $metadata_arr['honorificSuffix'] = esc_attr($field_value); } // gender $field_value = amt_bp_get_profile_field_data('gender', $user_id, $xprofile_field_map, $xprofile_public_fields); $field_value = sanitize_text_field($field_value); if (!empty($field_value)) { $metadata_arr['gender'] = esc_attr($field_value); } // nationality $field_value = amt_bp_get_profile_field_data('nationality', $user_id, $xprofile_field_map, $xprofile_public_fields); $field_value = sanitize_text_field($field_value); if (!empty($field_value)) { $metadata_arr['nationality'] = array(); $metadata_arr['nationality']['@type'] = 'Country'; $metadata_arr['nationality']['name'] = esc_attr($field_value); } // telephone $field_value = amt_bp_get_profile_field_data('telephone', $user_id, $xprofile_field_map, $xprofile_public_fields); $field_value = sanitize_text_field($field_value); if (!empty($field_value)) { $metadata_arr['telephone'] = esc_attr($field_value); } // faxNumber $field_value = amt_bp_get_profile_field_data('fax', $user_id, $xprofile_field_map, $xprofile_public_fields); $field_value = sanitize_text_field($field_value); if (!empty($field_value)) { $metadata_arr['faxNumber'] = esc_attr($field_value); } // email $field_value = amt_bp_get_profile_field_data('email', $user_id, $xprofile_field_map, $xprofile_public_fields); $field_value = sanitize_text_field($field_value); if (!empty($field_value)) { $metadata_arr['email'] = 'mailto:' . esc_attr($field_value); } // jobTitle $field_value = amt_bp_get_profile_field_data('job_title', $user_id, $xprofile_field_map, $xprofile_public_fields); $field_value = sanitize_text_field($field_value); if (!empty($field_value)) { $metadata_arr['jobTitle'] = esc_attr($field_value); } // worksFor $field_value = amt_bp_get_profile_field_data('works_for', $user_id, $xprofile_field_map, $xprofile_public_fields); $field_value = sanitize_text_field($field_value); if (!empty($field_value)) { $metadata_arr['worksFor'] = array(); $metadata_arr['worksFor']['@type'] = 'Organization'; $metadata_arr['worksFor']['name'] = esc_attr($field_value); } // worksFor URL $field_value = amt_bp_get_profile_field_data('works_for_url', $user_id, $xprofile_field_map, $xprofile_public_fields); $field_value = sanitize_text_field($field_value); if (!empty($field_value)) { if (!array_key_exists('worksFor', $metadata_arr) || !is_array($metadata_arr['worksFor'])) { $metadata_arr['worksFor'] = array(); $metadata_arr['worksFor']['@type'] = 'Organization'; } $metadata_arr['worksFor']['url'] = esc_attr($field_value); } // Home Location Geo Coordinates // home latitude $latitude = ''; $field_value = amt_bp_get_profile_field_data('home_latitude', $user_id, $xprofile_field_map, $xprofile_public_fields); $field_value = sanitize_text_field($field_value); if (!empty($field_value)) { $latitude = esc_attr($field_value); } // home longitude $longitude = ''; $field_value = amt_bp_get_profile_field_data('home_longitude', $user_id, $xprofile_field_map, $xprofile_public_fields); $field_value = sanitize_text_field($field_value); if (!empty($field_value)) { $longitude = esc_attr($field_value); } if (!empty($latitude) && !empty($longitude)) { $metadata_arr['homeLocation'] = array(); $metadata_arr['homeLocation']['@type'] = 'Place'; $metadata_arr['homeLocation']['latitude'] = esc_attr($latitude); $metadata_arr['homeLocation']['longitude'] = esc_attr($longitude); } // Work Location Geo Coordinates // work latitude $latitude = ''; $field_value = amt_bp_get_profile_field_data('work_latitude', $user_id, $xprofile_field_map, $xprofile_public_fields); $field_value = sanitize_text_field($field_value); if (!empty($field_value)) { $latitude = esc_attr($field_value); } // work longitude $longitude = ''; $field_value = amt_bp_get_profile_field_data('work_longitude', $user_id, $xprofile_field_map, $xprofile_public_fields); $field_value = sanitize_text_field($field_value); if (!empty($field_value)) { $longitude = esc_attr($field_value); } if (!empty($latitude) && !empty($longitude)) { $metadata_arr['workLocation'] = array(); $metadata_arr['workLocation']['@type'] = 'Place'; $metadata_arr['workLocation']['latitude'] = esc_attr($latitude); $metadata_arr['workLocation']['longitude'] = esc_attr($longitude); } } } // Allow filtering of the generated metadata // Customize with: add_filter('amt_buddypress_jsonld_schemaorg_extra', 'my_function', 10, 5); $metadata_arr = apply_filters('amt_buddypress_jsonld_schemaorg_extra', $metadata_arr, $post, $options, $attachments, $embedded_media); return $metadata_arr; }
function devb_aawire_post_update() { global $bp; $is_wire_post = false; /* Check the nonce */ check_admin_referer('post_update', '_wpnonce_post_update'); if (!is_user_logged_in()) { echo '-1'; exit(0); } if (empty($_POST['content'])) { echo '-1<div id="message"><p>' . __('Please enter some content to post.', 'buddypress') . '</p></div>'; exit(0); } if (empty($_POST['object']) && function_exists('bp_activity_post_update')) { //this is what I have changed if (!bp_is_my_profile() && bp_is_user()) { $content = '@' . bp_get_displayed_user_username() . ' ' . $_POST['content']; $is_wire_post = true; } else { $content = $_POST['content']; } //let us get the last activity id, we will use it to reset user's last activity $last_update = bp_get_user_meta(bp_loggedin_user_id(), 'bp_latest_update', true); if ($is_wire_post) { add_filter('bp_activity_new_update_action', 'devb_aawire_filter_action'); } $activity_id = bp_activity_post_update(array('content' => $content)); if ($is_wire_post) { remove_filter('bp_activity_new_update_action', 'devb_aawire_filter_action'); //add activity meta to remember that it was a wire post and we may use it in future if ($activity_id) { bp_activity_update_meta($activity_id, 'is_wire_post', 1); } //let us remember it for future //for 2.0 Let us add the mentioned user in the meta, so in future if we plan eo extend the wall beyond mention, we can do that easily bp_activity_update_meta($activity_id, 'wire_user_id', bp_displayed_user_id()); //let us remember it for future } //reset the last update bp_update_user_meta(get_current_user_id(), 'bp_latest_update', $last_update); //end of my changes } elseif ($_POST['object'] == 'groups') { if (!empty($_POST['item_id']) && function_exists('groups_post_update')) { $activity_id = groups_post_update(array('content' => $_POST['content'], 'group_id' => $_POST['item_id'])); } } else { $activity_id = apply_filters('bp_activity_custom_update', $_POST['object'], $_POST['item_id'], $_POST['content']); } if (!$activity_id) { echo '-1<div id="message"><p>' . __('There was a problem posting your update, please try again.', 'buddypress') . '</p></div>'; exit(0); } if (bp_has_activities('include=' . $activity_id)) { ?> <?php while (bp_activities()) { bp_the_activity(); ?> <?php bp_locate_template(array('activity/entry.php'), true); ?> <?php } ?> <?php } exit(0); }
define('BP_DISABLE_ADMIN_BAR', true); define('BP_DTHEME_DISABLE_CUSTOM_HEADER', true); add_filter('bp_core_fetch_avatar_no_grav', '__return_true'); remove_action('wp_print_styles', 'bp_tpack_enqueue_styles'); remove_filter('wp_nav_menu', 'remove_ul'); // Stop the theme from killing WordPress if BuddyPress is not enabled. if (!class_exists('BP_Core_User')) { return false; } // Load the AJAX functions for the theme require_once WP_PLUGIN_DIR . '/buddypress/bp-themes/bp-default/_inc/ajax.php'; // Load the javascript for the theme wp_enqueue_script('dtheme-ajax-js', get_template_directory_uri() . '/_inc/global.js', array('jquery')); // Add words that we need to use in JS to the end of the page so they can be translated and still used. $params = array('my_favs' => __('My Favorites', 'buddypress'), 'accepted' => __('Accepted', 'buddypress'), 'rejected' => __('Rejected', 'buddypress'), 'show_all_comments' => __('Show all comments for this thread', 'buddypress'), 'show_all' => __('Show all', 'buddypress'), 'comments' => __('comments', 'buddypress'), 'close' => __('Close', 'buddypress'), 'mention_explain' => sprintf(__("%s is a unique identifier for %s that you can type into any message on this site. %s will be sent a notification and a link to your message any time you use it.", 'buddypress'), '@' . bp_get_displayed_user_username(), bp_get_user_firstname(bp_get_displayed_user_fullname()), bp_get_user_firstname(bp_get_displayed_user_fullname()))); wp_localize_script('dtheme-ajax-js', 'BP_DTheme', $params); /** * Add the JS needed for blog comment replies * * @package BuddyPress Theme * @since 1.2 */ function bp_dtheme_add_blog_comments_js() { if (is_singular()) { wp_enqueue_script('comment-reply'); } } add_action('template_redirect', 'bp_dtheme_add_blog_comments_js'); /**
// Add the new warning to the array $warnings[] = array('points' => $points, 'reason' => trim($reason), 'moderator' => $moderator, 'date' => $date); // Make sure there was no error if (empty($error)) { // Update user meta update_user_meta($user->id, 'infraction_history', $warnings); bp_core_add_message('Warning successfully issued!', 'success'); // Maybe ban the user if ($level + $points == 5) { $u = new WP_User($user->id); $u->set_role('banned'); } // Email people if ($_POST['email-user'] || $_POST['email-mods']) { // Set the email headers $name = bp_get_displayed_user_username(); $subject = "[Tamriel Foundry] Warning Issued to {$name}"; $headers = "From: Foundry Discipline Bot <*****@*****.**>\r\n"; $headers .= "Content-Type: text/html; charset=UTF-8"; // Construct the message $body = '<p>Your user account, ' . $name . ', has been issued a warning for ' . $points . ' point(s) by the moderation team at Tamriel Foundry for the following reason:</p>'; $body .= ' '; $body .= '<p><strong>' . $reason . '</strong></p>'; $body .= ' '; $body .= '<p>Please review the Tamriel Foundry <a href="http://tamrielfoundry.com/topic/tamriel-foundry-code-of-conduct/" title="Read the Code of Conduct" target="_blank">Code of Conduct</a> to better understand the expectations we have of our users.'; $body .= 'You may review your current infractions on your user profile using the following link:</p>'; $body .= '<p><a href="' . $action_url . '" title="View Your Infractions" target="_blank">' . $action_url . '</a>'; // Send the message if ($_POST['email-user']) { $emailto = bp_get_displayed_user_email(); wp_mail($emailto, $subject, $body, $headers);
/** * Returns the public message link for displayed user * * @since BuddyPress (1.2) * * @global object $bp BuddyPress global settings * @uses bp_is_my_profile() * @uses is_user_logged_in() * @uses wp_nonce_url() * @uses bp_loggedin_user_domain() * @uses bp_get_activity_slug() * @uses bp_core_get_username() * @uses apply_filters() To call the 'bp_get_send_public_message_link' hook * * @return string The public message link for displayed user */ function bp_get_send_public_message_link() { global $bp; if (bp_is_my_profile() || !is_user_logged_in()) { return false; } return apply_filters('bp_get_send_public_message_link', wp_nonce_url(bp_get_activity_directory_permalink() . '?r=' . bp_core_get_username(bp_displayed_user_id(), bp_get_displayed_user_username(), $bp->displayed_user->userdata->user_login))); }
/** * Set some globals * * @package WP Idea Stream * @subpackage buddypress/screens * * @since 2.0.0 * * @uses bp_displayed_user_id() to get displayed user ID * @uses bp_get_displayed_user_username() to get displayed user nicename */ public function setup_globals() { $this->screen = ''; $this->user_id = bp_displayed_user_id(); $this->username = bp_get_displayed_user_username(); }
/** * Enqueues BuddyPress JS and related AJAX functions * * @since 1.3 */ function bp_compat_enqueue_scripts() { // Add words that we need to use in JS to the end of the page so they can be translated and still used. $params = array('my_favs' => __('My Favorites', 'dp'), 'accepted' => __('Accepted', 'dp'), 'rejected' => __('Rejected', 'dp'), 'show_all_comments' => __('Show all comments for this thread', 'dp'), 'show_all' => __('Show all', 'dp'), 'comments' => __('comments', 'dp'), 'close' => __('Close', 'dp')); // BP 1.5+ if (version_compare(BP_VERSION, '1.3', '>')) { // Bump this when changes are made to bust cache $version = '20110818'; $params['view'] = __('View', 'dp'); } else { $version = '20110729'; if (bp_displayed_user_id()) { $params['mention_explain'] = sprintf(__("%s is a unique identifier for %s that you can type into any message on this site. %s will be sent a notification and a link to your message any time you use it.", 'dp'), '@' . bp_get_displayed_user_username(), bp_get_user_firstname(bp_get_displayed_user_fullname()), bp_get_user_firstname(bp_get_displayed_user_fullname())); } } // Enqueue the global JS - Ajax will not work without it wp_enqueue_script('bp-theme-js', trailingslashit(get_template_directory_uri()) . 'bp/global.js', array('jquery'), $version); // Localize the JS strings wp_localize_script('bp-theme-js', 'BP_Theme', $params); }
/** * Set up IdeaStream navigation. * * @package WP Idea Stream * @subpackage buddypress/loader * * @since 2.0.0 * * @uses buddypress() to get BuddyPress instance data * @uses bp_loggedin_user_id() to get logged in user id * @uses bp_get_loggedin_user_username() to get logged in user nicename * @uses bp_loggedin_user_domain() to get logged in user domain * @uses bp_is_user() to check if a user's profile is displayed * @uses bp_displayed_user_id() to get the displayed user id * @uses bp_get_displayed_user_username() to get displayed user nicename * @uses bp_displayed_user_domain() to get displayed user profile link * @uses wp_idea_stream_users_get_profile_nav_items() to get IdeaStream user nav items * @uses sanitize_title(), sanitize_key() to sanitize datas */ public function setup_nav($main_nav = array(), $sub_nav = array()) { $bp = buddypress(); // Default is current user. $user_id = bp_loggedin_user_id(); $user_nicename = bp_get_loggedin_user_username(); $user_domain = bp_loggedin_user_domain(); // If viewing a user, set the user to displayed one if (bp_is_user()) { $user_id = bp_displayed_user_id(); $user_nicename = bp_get_displayed_user_username(); $user_domain = bp_displayed_user_domain(); } // Build the user nav if we have an id if (!empty($user_id)) { // Build user's ideas BuddyPress profile link $profile_link = trailingslashit($user_domain . $this->slug); // Get Core User's profile nav $user_core_subnav = wp_idea_stream_users_get_profile_nav_items($user_id, $user_nicename); // Build BuddyPress user's Main nav $main_nav = array('name' => $this->name, 'slug' => $this->slug, 'position' => 90, 'screen_function' => array('WP_Idea_Stream_Screens', 'user_ideas'), 'default_subnav_slug' => sanitize_title($user_core_subnav['profile']['slug'], 'ideas', 'save')); // Init nav position & subnav slugs $position = 10; $this->idea_nav = array(); // Build BuddyPress user's Sub nav foreach ($user_core_subnav as $key => $nav) { $fallback_slug = sanitize_key($key); if ('profile' == $fallback_slug) { $fallback_slug = 'ideas'; } // Register subnav slugs using the fallback title // as keys to easily build urls later on. $this->idea_nav[$fallback_slug] = array('name' => $nav['title'], 'slug' => sanitize_title($nav['slug'], $fallback_slug, 'save')); $sub_nav[] = array('name' => $this->idea_nav[$fallback_slug]['name'], 'slug' => $this->idea_nav[$fallback_slug]['slug'], 'parent_url' => $profile_link, 'parent_slug' => $this->slug, 'screen_function' => array('WP_Idea_Stream_Screens', 'user_' . $fallback_slug), 'position' => $position); // increment next nav position $position += 10; } } parent::setup_nav($main_nav, $sub_nav); }
function private_message_super_admin_override() { if (!isset($_GET['bpmSuperAdminOverridePrivateMessage']) || !is_super_admin()) { return; } check_admin_referer('bpmSuperAdminOverridePrivateMessage'); $thread_id = (int) bp_action_variable(0); bp_core_new_subnav_item(array('name' => sprintf(__('Review message by %s', 'bp-moderation'), bp_get_displayed_user_username()), 'slug' => 'view', 'parent_url' => trailingslashit(bp_displayed_user_domain() . bp_get_messages_slug()), 'parent_slug' => bp_get_messages_slug(), 'screen_function' => true, 'position' => 40, 'user_has_access' => is_super_admin(), 'link' => bp_displayed_user_domain() . bp_get_messages_slug() . '/view/' . (int) $thread_id)); bp_core_load_template(apply_filters('messages_template_view_message', 'members/single/home')); die; }
function wds_metadesc() { if (is_admin()) { return false; } global $post, $wp_query; //global $wds_options; $wds_options = get_wds_options(); if (is_singular()) { if (function_exists('groups_get_current_group') && 'groups' == bp_current_component() && ($group = groups_get_current_group())) { // BP group? $optvar = !empty($wds_options['metadesc-bp_groups']) ? $wds_options['metadesc-bp_groups'] : ''; $metadesc = wds_replace_vars($optvar, array('name' => $group->name, 'description' => $group->description)); } else { if (function_exists('bp_current_component') && 'profile' == bp_current_component()) { $optvar = !empty($wds_options['metadesc-bp_profile']) ? $wds_options['metadesc-bp_profile'] : ''; $metadesc = wds_replace_vars($optvar, array('full_name' => bp_get_displayed_user_fullname(), 'username' => bp_get_displayed_user_username())); } else { $metadesc = wds_get_value('metadesc'); if (empty($metadesc)) { $optvar = !empty($wds_options['metadesc-' . $post->post_type]) ? $wds_options['metadesc-' . $post->post_type] : ''; $metadesc = wds_replace_vars($optvar, (array) $post); } } } } else { if (function_exists('is_shop') && is_shop() && function_exists('woocommerce_get_page_id')) { // WooCommerce shop page $post_id = woocommerce_get_page_id('shop'); $metadesc = wds_get_value('metadesc', $post_id); if (empty($metadesc)) { $optvar = !empty($wds_options['metadesc-' . $post->post_type]) ? $wds_options['metadesc-' . $post->post_type] : ''; $metadesc = wds_replace_vars($optvar, (array) $post); } } else { if (is_home() && 'posts' == get_option('show_on_front') && isset($wds_options['metadesc-home'])) { $metadesc = wds_replace_vars($wds_options['metadesc-home'], array()); } else { if (is_home() && 'posts' != get_option('show_on_front')) { $post = get_post(get_option('page_for_posts')); $metadesc = wds_get_value('metadesc'); if (($metadesc == '' || !$metadesc) && isset($wds_options['metadesc-' . $post->post_type])) { $metadesc = wds_replace_vars($wds_options['metadesc-' . $post->post_type], (array) $post); } } else { if (is_category() || is_tag() || is_tax()) { $term = $wp_query->get_queried_object(); $metadesc = wds_get_term_meta($term, $term->taxonomy, 'wds_desc'); if (!$metadesc && isset($wds_options['metadesc-' . $term->taxonomy])) { $metadesc = wds_replace_vars($wds_options['metadesc-' . $term->taxonomy], (array) $term); } } else { if (is_author()) { $author_id = get_query_var('author'); $metadesc = get_the_author_meta('wds_metadesc', $author_id); } else { if (function_exists('groups_get_current_group') && 'groups' == bp_current_component() && ($group = groups_get_current_group())) { // BP group? $optvar = !empty($wds_options['metadesc-bp_groups']) ? $wds_options['metadesc-bp_groups'] : ''; $metadesc = wds_replace_vars($optvar, array('name' => $group->name, 'description' => $group->description)); } else { if (function_exists('bp_current_component') && 'profile' == bp_current_component()) { $optvar = !empty($wds_options['metadesc-bp_profile']) ? $wds_options['metadesc-bp_profile'] : ''; $metadesc = wds_replace_vars($optvar, array('full_name' => bp_get_displayed_user_fullname(), 'username' => bp_get_displayed_user_username())); } } } } } } } } if (!empty($metadesc)) { echo "\t" . '<meta name="description" content="' . esc_attr(strip_tags(stripslashes(apply_filters('wds_metadesc', $metadesc)))) . '" />' . "\n"; } }
/** * Returns author with facet link and optional link to profile. * * @return string */ function humcore_linkify_author($author, $author_meta, $author_type) { $displayed_username = bp_get_displayed_user_username(); if ('creator' === $author_type) { $page_type = 'groups'; } else { $page_type = 'members'; } if (!empty($author_meta) && 'null' != $author_meta && ('members' === $page_type && $displayed_username != $author_meta || 'groups' === $page_type && !bp_is_group())) { $profile = sprintf(' <a href="/%s/%s/deposits/">(see profile)</a> ', $page_type, $author_meta); } else { $profile = ''; } $linked_author = sprintf('<a href="/deposits/?facets[author_facet][]=%s">%s</a>%s', urlencode($author), $author, $profile); return $linked_author; }