Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'custom activity page'

Viewing 25 results - 176 through 200 (of 831 total)
  • Author
    Search Results
  • abhinav.kakku
    Participant

    i want to rename / reorder / remove items from buddypress profile page menu which includes Activity profile notification friends etc. I am running WPLMS theme

    ruchika88
    Participant

    Hi, I am struggling to get a profile page as it shows 404 error. Also notification and other profile related pages show 404 error. Have deactivated all plugins to test if any code conflict but that also didn’t resolve the issue.

    Links to pages:Profile page
    Activity:profile activity
    Notification:notification

    All other pages related to profile that showup on right corner when the member is signed in show 404 error.

    wordpress version:4.8
    Buddypress version:2.8.2
    Also have installed bbpress:2.5.12
    Wordpress Theme: customizr child theme

    Please help and thanks in advance.

    #266925
    xavi3r12
    Participant

    Hello, I have been using buddyPress Version 2.7.4. After updating to version 2.8.2, I get this error Fatal error: Call to undefined function bp_is_front_page() in ……/wp-content/plugins/bp-custom.php on line 17 here is my code in the bp-custom.php `<?php
    // hacks and mods will go here
    /* Redirects to profile upon login */
    add_action(‘login_form’, ‘redirect_after_login’);
    function redirect_after_login()
    {
    global $redirect_to;
    if (!isset($_GET[‘redirect_to’]))
    {
    $redirect_to = get_option(‘activity’);
    // sample-page = your page name after site_url
    } }

    function bp_help_redirect_to_profile(){
    global $bp;

    if( is_user_logged_in() && bp_is_front_page() )
    bp_core_redirect( get_option(‘home’) . ‘/members/’ . bp_core_get_username( bp_loggedin_user_id() ) . ‘/activity’ );

    }

    add_action( ‘get_header’, ‘bp_help_redirect_to_profile’,1);

    add_action(‘wp_logout’,’go_home’);
    function go_home(){
    wp_redirect( home_url() );
    exit();
    }

    add_action( ‘bp_complete_signup’, ‘buddydev_redirect_after_signup’ );

    function buddydev_redirect_after_signup() {

    $page = wp_redirect( get_option(‘siteurl’) . ‘/profile’ );

    bp_core_redirect( site_url( $page ) );
    }

    ?>` Help me what has happened and how can I correct this Error?

    xavi3r12
    Participant

    I have tried that it still returned the same error, however i have just noticed that if i delete my bp-custom.php everything works fine but my pages does not redirect users to there profile “if logged in” which was the purpose of the bp-custom.php file. This in the code in my bp-custom.php file

    <?php
    // hacks and mods will go here
    /* Redirects to profile upon login */
    add_action('login_form', 'redirect_after_login'); 
    function redirect_after_login() 
    {     
    global $redirect_to; 
    if   (!isset($_GET['redirect_to'])) 
    { 
    $redirect_to =   get_option('activity');
    //  sample-page = your page name after site_url
    } }
    
    function bp_help_redirect_to_profile(){
    global $bp;
    
    if( is_user_logged_in() && bp_is_front_page() )
    bp_core_redirect( get_option('home') . '/members/' . bp_core_get_username( bp_loggedin_user_id() ) . '/activity' );
    
    }
    
    add_action( 'get_header', 'bp_help_redirect_to_profile',1);
    
    add_action('wp_logout','go_home');
    function go_home(){
      wp_redirect( home_url() );
      exit();
    }
    
    add_action( 'bp_complete_signup', 'buddydev_redirect_after_signup' );
     
    function buddydev_redirect_after_signup() {
        
        $page = wp_redirect( get_option('siteurl') . '/profile' );
        
        
        bp_core_redirect( site_url( $page ) );
    }
    
    ?>

    So how do i fix this?? I need help Please

    #266407
    tackleb0x
    Participant

    Hi,

    I have a social networking site that is intended for subscribers to share only with his/her friends. Therefore, I would like to remove the options for them to be able to select where they want to post their activity. I would like to remove all options for where to post activity updates and I would like it to always post to the friends feed. Also, I would like it to post to the activity page if they are in the activity page and to post to whatever group they are in when they do a post from that page.

    Is this something that I would accomplish by removing lines of code from files, by adding custom CSS, or by adding a function in the functions.php file?

    Website: http://www.tacklebox.fish
    WP Version: 4.7.5
    BP Version: 2.8.2
    Theme: Buddy (themeforest)

    Please let me know if these is anything I can do to accomplish this.

    Thanks in Advance!
    Buddy

    shahidjaszle
    Participant

    Hello everyone,

    Currently im using Bp Portfolio plugin and on my activity stream, when subscribers update on their latest portfolio didn’t show up on the stream. (Only for admin role it works fine)

    So, i added custom post type for the portfolio on custom.php, here are the code:

    add_post_type_support( ‘bb_project’, ‘buddypress-activity’ ); function customize_page_tracking_args() {

    // Check if the Activity component is active before using it.
    if ( ! bp_is_active( ‘activity’ ) ) { return; }

    bp_activity_set_post_type_tracking_args(
    ‘page’, array( ‘action_id’ => ‘new_blog_page’,
    ‘bp_activity_admin_filter’ => __( ‘Published a new page’, ‘boss’ ),
    ‘bp_activity_front_filter’ => __( ‘Pages’, ‘boss’ ),
    ‘contexts’ => array( ‘activity’, ‘member’ ), ‘activity_comment’ => true,
    ‘bp_activity_new_post’ => __( ‘%1$s posted a new page‘, ‘boss’ ), ‘bp_activity_new_post_ms’ => __( ‘%1$s posted a new page, on the site %3$s’, ‘boss’ ), ‘position’ => 100, ) ); }

    add_action( ‘bp_init’, ‘customize_page_tracking_args’ );

    It works however it didn’t display the featured image for the portfolio. Maybe im missing some code here plus im not really good at php.

    Is there any help for me to fix this?

    shirleyddsn
    Participant

    Another Update:

    Ok, I was finally able to create a change in the file I was trying to edit. For some reason, I wasn’t able to insert code in the exact place I was trying to last time, but I WAS able to add code elsewhere in the document.

    Also, I noticed the name of the hook started with “bp”, so I moved my cover-image code to my bp-custom.php file in my child theme. But it didn’t work there either. I feel like there’s something else I’m supposed to do with $settings['callback']. Or maybe I’m supposed to plug some more code in elsewhere. I could really use some help with this.

    Also, while playing with the profile templates, I noticed there were a few hooks (which I’m learning are the ‘actions’ I’m adding to) that don’t really seem to do anything but sit there. Do they exist only for me to add code to through my bp-custom.php? If so, why wouldn’t I just hard-code something into the template file?

    For example: do_action( 'bp_member_header_actions' ); sits between the @username and last-activity. But it’s empty. When the profile page loads, there’s nothing there. So that would make it an empty hook for me to plug stuff into, right? bp_profile_header_meta is also empty. Are all hooks like that? Or do any of them have their own code/functions?

    I would still like to know where these actions are declared, and what possible functions lie inside them. Is there any way to find that information out? People create their own BP themes and plugins all the time so there has to be a way to figure this stuff out . . .

    threwthenevr
    Participant

    Really this makes no sense to me.

    I created a custom template for a page im working on and copied over the change.avatars.php to the custom page..
    Should work in theory, at least I thought.But the upload or crop didnt work.
    The dotted box wasn’t even there.

    So I ended up creating a index-action-change-avatar.php file and placed it in the BuddyPress/members/single directory and copied the change.avatars.php code over.
    And also added general-after-wrap and general-before-wrap to the file.

    Then back to my custom.php template file I added
    <meta http-equiv="refresh" content="0; url=<?php echo bp_loggedin_user_domain();?>profile/change-avatar/" />

    So now my custom page template looks like this before it gets redirected.

    Then after the redirect the page looks like this.

    I wanted my custom page to look like the 2nd pic.
    Now if I remove the index-action-change-avatar.php file it would just redirect me to the normal user profile page to upload the Avatar.
    But I didn’t want that for this custom page I am doing.

    So now that I added the index-action-change-avatar.php file it will just override the default change-avatar.php as its expected to do but unfortunately that means when a user clicks on his profile settings and selects upload avatar it would direct them to the index-action-change-avatar.php file that has some changed settings I’ve added.

    This is what I was trying to do.
    Step 1-user registers on homepage.
    Step 2-user is redirected to the check email for activation page.
    Step 3-user clicks activation link within their email.
    Step 4-user is redirected to my custom page notifying account is activated.

    Now on step 4 I was going to add the option to upload their avatar or just continue.

    Now what I could do is just add a href link that would redirect them to their profile to upload but it would defeat the purpose of what I was aiming for.

    Another option i might just do is after activation have them auto logged in and redirected to the activity page then from there I’ll add a tour of the website.

    Nahum
    Participant

    I’ve been having an issue with my activity feed where the first activity’s time since permalink comes back as site.com/activity/p/321 even when it is a blog post activity or custom post type activity. As soon as it becomes the second item in the loop, it goes back to normal permalink where it comes back as the site.com/?p=123 or site.com/2017/04/post-name/comment-page-1#comment-123.

    Does this sound familiar.

    I am running BP on the primary site of a Multisite installation.

    #265734
    Nahum
    Participant

    well I was trying post the my code, but I think I spammed myself after trying to edit the reply to this …
    CPT (and custom title thing)

    add_action('init', 'video_register_my_cpt');
    function video_register_my_cpt() {
    register_post_type('video', array( 
    'label' => 'Videos',
    'description' => 'Latest Videos',
    'public' => true,
    'show_ui' => true,
    'show_in_menu' => true,
    'menu_position' => 5,
     'show_in_nav_menus' => false,
    'capability_type' => 'post',
    'hierarchical' => false,
    'rewrite' => array('slug' => 'videos'),
    'query_var' => true,
    'has_archive' => true,
    'exclude_from_search' => false,
    'supports' => array('title','editor','excerpt','trackbacks','custom-fields','comments','revisions','thumbnail','author','page-attributes','buddypress-activity'), 
    'bp_activity' => array(
                'component_id' => buddypress()->blogs->id,
                'action_id'    => 'new_video',
                'format_callback' => 'bp_blogs_format_activity_action_new_blog_post',
                'comment_action_id' => 'new_video_comment',
                'comment_format_callback' => 'bp_activity_format_activity_action_custom_post_type_comment',
                'contexts'     => array( 'activity', 'member' ),
                'position'     => 40,
                ),
      'taxonomies' => array('video_category','video_tag'),
      'labels' => array(
      'name' => 'Videos',
      'singular_name' => 'Video',
      'menu_name' => 'Videos',
      'add_new' => 'Add Video',
      'add_new_item' => 'Add New Video',
      'edit' => 'Edit',
      'edit_item' => 'Edit Video',
      'new_item' => 'New Video',
      'view' => 'View Video',
      'view_item' => 'View Video',
      'search_items' => 'Search Videos',
      'not_found' => 'No Videos Found',
      'not_found_in_trash' => 'No Videos Found in Trash',
                
                'bp_activity_admin_filter' => __( 'New video published', 'custom-domain' ),
                'bp_activity_front_filter' => __( 'Videos', 'custom-domain' ),
                'bp_activity_new_post'     => __( '%1$s added <a href="%2$s">[Video]</a>', 'custom-domain' ),
                'bp_activity_new_post_ms'  => __( '%1$s added <a href="%2$s">[Video]</a>','custom-domain' ),
                
                'bp_activity_comments_admin_filter' => __( 'Comments about video', 'custom-domain' ), // label for the Admin dropdown filter
                'bp_activity_comments_front_filter' => __( 'Video Comments', 'custom-domain' ),        // label for the Front dropdown filter
                'bp_activity_new_comment'           => __( '%1$s commented on a <a href="%2$s">video</a>', 'custom-domain' ),
                'bp_activity_new_comment_ms'        => __( '%1$s commented on a <a href="%2$s">[Video]</a>, on the site %3$s', 'custom-domain' )
    
      )
    
    ) ); }
    
    function my_video_include_post_type_title( $action, $activity ) {
      if ( empty( $activity->id ) ) {
        return $action;
      }
    
      if ( 'new_video' != $activity->type && 'new_video_comment' !=$activity->type ) {
        return $action;
      }
    
      preg_match_all( '/<a.*?>([^>]*)<\/a>/', $action, $matches );
    
      if ( empty( $matches[1][1] ) || '[Video]' != $matches[1][1] ) {
        return $action;
      }
    
      $post_type_title = bp_activity_get_meta( $activity->id, 'post_title' );
    
      if ( empty( $post_type_title ) ) {
    
        switch_to_blog( $activity->item_id );
    
        $post_type_title = get_post_field( 'post_title', $activity->secondary_item_id );
    
        // We have a title save it in activity meta to avoid switching blogs too much
        if ( ! empty( $post_type_title ) ) {
          bp_activity_update_meta( $activity->id, 'post_title', $post_type_title );
        }
    
        restore_current_blog();
      }
    
      return str_replace( $matches[1][1], esc_html( $post_type_title ), $action );
    }
    add_filter( 'bp_activity_custom_post_type_post_action', 'my_video_include_post_type_title', 10, 2 );
    
    

    BP CUSTOM

    
    /*////////////////////////////////////////////////////////////////////////////////////////////*/
    // Modifying CPT Activity Actions
    /*///////////////////////////////////////////////////////////////////////////////////////////*/
    
    function record_blogpost_activity_action( $activity_action, $post, $post_permalink ) {
    global $bp;
    
    if( $post->post_type == 'jobs' || get_post_type($post->ID) == 'jobs' ) {
      
      $activity_action  = sprintf( __( '%1$s', 'buddypress' ), bp_core_get_userlink( (int) $post->post_author ), '<a href="' . $post_permalink . '">' . $post->post_title . '</a>');
    
    } elseif( $post->post_type == 'video' || get_post_type($post->ID) == 'video' ) {
    
      $activity_action  = sprintf( __( '%1$s posted a video', 'buddypress' ), bp_core_get_userlink( (int) $post->post_author ), '<a href="' . $post_permalink . '">' . $post->post_title . '</a>' );
    
    } elseif($post->post_type == 'post'  ) {
    
      $activity_action  = sprintf( __( '%1$s posted a blog', 'buddypress' ), bp_core_get_userlink( (int) $post->post_author ), '<a href="' . $post_permalink . '">' . $post->post_title . '</a>' );
    
    }  
    
    return $activity_action;
    }
    
    add_filter('bp_blogs_activity_new_post_action', 'record_blogpost_activity_action', 11, 3);
    
    /*////////////////////////////////////////////////////////////////////////////////////////////*/
    // Modifying CPT Comment Activity Actions
    /*///////////////////////////////////////////////////////////////////////////////////////////*/
    
    function comment_activity_action( $activity_action, $post, $post_permalink ) {
    global $bp;
    if( $post->post_type == 'post' ) {
    
      $activity_action  = sprintf( __( '%1$s commented on %2$s', 'buddypress' ), bp_core_get_userlink( (int) $post->post_author ), '<a href="' . $post_permalink . '">' . $post->post_title . '</a>' );
    
    } elseif( $post->post_type == 'video' || get_post_type($post->ID) == 'video' ) {
    
      $activity_action = sprintf( __( '%1$s replied on the video %2$s', 'buddypress' ), bp_core_get_userlink( (int) $post->post_author ), '<a href="' . esc_url( $post_permalink ). '">' . $post->post_title . '</a>' );
    
    } 
    return $activity_action;
    
    }
    
    add_filter('bp_blogs_activity_new_comment_action', 'comment_activity_action', 11, 3);
    
    /*//// ? /////*/
    function bbg_record_video_post_type_comments( $post_types ) {
          $post_types[] = 'video';
          return $post_types;
      }
    //add_filter( 'bp_blogs_record_post_post_types', 'bbg_record_video_post_type_comments' );
    //add_filter( 'bp_blogs_record_comment_post_types', 'bbg_record_video_post_type_comments' );
    

    doing it this way, everything works except my custom comment action.

    cahara
    Participant

    Hey all I’m attempting to modify the content returned by BuddyPress’ default ‘@’ mention notification. I’m using this as part of a custom profile page and would like to modify the “username mentioned you’ text to something more personalized based on post type.

    
    // Change mention output
    function format_mention_notifications( $action, $item_id, $secondary_item_id, $total_items, $format = 'string', $component_action, $component_name, $notification_id) {
        if ( $component_action === 'new_at_mention') { // User mentioned notification
    
            $mentioned_source_type = get_post_type($item_id);
            $username = wl_get_username($secondary_item_id);
            $mention_avatar = wl_get_avatar($secondary_item_id);
            $mention_title = '';
            $mention_text = $username;
    
            if ($mentioned_source_type == 'topic') {
                $mention_title = bbp_get_topic_title( $item_id );
                $mention_text .= ' mentioned you in the forum post ';
                $mention_source_link = ''; // link to topic
            } else if ($mentioned_source_type == 'reply') {
                $parent_topic_id = bbp_get_reply_topic_id( $item_id );
                $mention_title = bbp_get_topic_title( $parent_topic_id );
                $mention_text .= ' mentioned you in their response to the forum post ';
                $mention_source_link = bbp_get_reply_url( $item_id ); // link to reply
            } else if ($mentioned_source_type == 'comment') {
                $comment = get_comment($item_id);
                $mention_text .= ' mentioned you in their comment';
                $mention_source_link = get_comment_link($comment);
    
            } else {
                $mention_avatar = '';
                $mention_title = get_the_title($item_id);
                $mention_text = 'You were mentioned in ';
                $mention_source_link = get_permalink($item_id);
            }
    
            $mention_source_link = wp_nonce_url( add_query_arg( array( 'action' => 'read', 'notification_id' => $notification_id), $mention_source_link ), 'bp_notification_mark_read_' . $notification_id);
    
            // WordPress Toolbar
            if ( 'string' === $format ) {
                $return = apply_filters( 'bp_activity_single_at_mentions_notification', '<a href="' . esc_url( $mention_source_link ) . '" title="New mention">'. $mention_avatar . esc_html( $mention_text ) . '<span class="activity-title">'.$mention_title.'</span></a>', (int) $total_items, $mention_text, $mention_source_link );
    
            // Deprecated BuddyBar
            } else {
                $return = apply_filters( 'bp_activity_single_at_mentions_notification', array(
                    'text' => $mention_text . $mention_title,
                    'link' => $mention_source_link
                ), $mention_source_link, (int) $total_items, $mention_text, $mention_title );
            }
        }
    
        return $return;
    
    }
    add_filter( 'bp_notifications_get_notifications_for_user', 'format_mention_notifications', 100, 8 );
    

    What I’ve tried so far:
    – Changing the priority of the filter
    – Moving my logic into the activity_format_notifications action with various different priorities
    – All of the above in a custom plugin file, bp-custom.php, and my themes’ function.php file

    I’ve used a similar filter for custom notifications and that aspect works great. I just can’t seem to override the default content with my own. My thoughts are that the the filters/actions run too late to be noticed by BuddyPress.

    Many thanks for your help.

    lilcxnty
    Participant

    I am using visual composer for all my pages, but the buddypress pages are empty when i edit them and none of changes i make there shows up on said bp pages eg. members. Can i call a complete bubbypress page on to a new page ? with php maybe? or create a shortcode? Then i could still ad a heading above and style with vc custom css? i got activity feed to work like that with the help of 2 plugins. the other short code plugins do not give me the full bp page elements on my new page. Is there any way to do this? Help would be grately appreciated. Hope this makes sense. 🙂

    Regards
    LC

    #264785
    Siddharth
    Participant

    hello support team,

    I’m facing a problem after updating buddypress to 2.8.2. Once I submit any text into activity stream it shows the website in an IFRAME, see the screenshot below plz. Can provide login if that helps.

    Screenshot: http://nimb.ws/ufhcbA

    Also when I’m trying to upload an image into activity stream, or trying to upload an image in Groups avatar or cover photo or my individual cover photo, it says “An error occured. Please try again later”. It was working all fine 2 days ago & after the buddypress update it doesn’t seems to work.

    I’m using:-

    WP 4.7.3
    BP 2.8.2
    BBpress 2.5.12
    rtMedia for WordPress, BuddyPress and bbPress 4.3.1
    Gravity Forms 2.0.6.9 – For customized registration page
    Gravity Forms User Registration Add-On 3.3.9 – For mapping user registration with WP & BP fields.

    Please help!

    Thanks,
    Sidd

    #264030
    danbp
    Participant

    Hi,

    you have to use a group_id and to ensure you’re in an appropriate loop (activity or group)

    To get a group id, you can for ex. do:

    // check for a group ID
    	if( bp_has_groups() ) {
    		// Grab current group ID
    		bp_the_group();
    		$group_id = bp_get_group_ID();
    	}	
    	
        // apply our changes only to this group ID's
    	// conditionnal action
    	if ( $group_id == 22 OR $group_id == 8 ) {  

    … and so on!

    You may also use bp_parse_args, depending where you use your custom work. In other words, you can create a complete new activity loop on a distinct page template for only one group.

    Using bp_parse_args() to filter BuddyPress template loops

    pellu
    Participant

    I search for a plugin or code.

    I wish a notification in the administration of the keywords I would have chosen, without deleting his keywords in the front office. This feature must work with all buddypress, message, activity, group, and custom pages.

    I use WordPress 4.7 and BuddyPress 2.7.4. I have Woffice theme based on Unyson.

    Thank you in advance for your help

    #263856
    r-a-y
    Keymaster
    • Site Tracking – The description on the Settings page says it all – “Record activity for new posts and comments from your site.“. This is useful if the Activity Streams component is also active.
    • Login Widget – Not sure why you want extra tabs for a login widget… if you need extra functionality, you can always add your own widget if you have some coding ability.
    • Profile photo by URL or user-selectable profile photo – This isn’t a core option. Would have to be a custom plugin for now.
    • Mini-blog – No core option, unless a user’s activity stream is enough. There are plugins out there like BuddyBlog that offer some frontend blogging functionality.
    • Disabling emails – I think putting the desired email in draft mode might be sufficient to disable email sending. Test and see what happens!
    #263616

    In reply to: add subnav to activity

    kalughodakiya
    Participant

    Just add sub nav using bp_core_new_subnav_item and modify file activity.php just put your code before if ( is_user_logged_in() && bp_is_my_profile() && ( !bp_current_action() || bp_is_current_action( ‘just-me’ ) ) )
    bp_get_template_part( ‘activity/post-form’ );

    with if condition like
    if(is_user_logged_in() && bp_is_my_profile() && bp_is_current_action( ‘schedule_message’ )){
    get_template_part( ‘custom_files/schedule_message’ );

    if current action is you tab slug then load you page template otherwise default

    #262749
    squadup
    Participant

    Excuse me if this request is in the wrong place:

    I have added a working custom date field to my activity page by editing the post-form.php and the the bp-custom.php. This is in my bp-custom.php:

    
    // CUSTOM DATE FIELD
    function add_date_to_activity( $content, $user_id, $activity_id ) {
    bp_activity_update_meta( $activity_id,'thedate', $_POST['thedate'] );
    }
    add_action( 'bp_activity_posted_update', 'add_date_to_activity', 10, 3 );
    function my_datemeta() {
    $my_datemeta = bp_activity_get_meta( bp_get_activity_id(),'thedate' );
    if (is_user_logged_in()) : {
    echo "<span class='datefont'>" . $my_datemeta . "</span></br>";
    }
    endif;
    }
    add_action( 'bp_activity_entry_meta','my_datemeta' );
    

    Now I am trying to sort the posted activities by this date field instead of the standard sort by activity-id’s. Is there any way to override the standard sort function?

    Thanks in advance, i’d be happy to share more information if necessary

    #262699
    luisa227
    Participant

    Simple. I want to make functional code

    My actual code is:

    function bpfr_custom_profile_sub_nav() {
    	global $bp;
    	$parent_slug = 'activity';
    		
    	//Add subnav item 	 
    	bp_core_new_subnav_item( array( 
    	'name'            => __( 'Swap' ), 
    	'slug'            => 'swap', 
    	
    	'parent_url'      => $bp->displayed_user->domain . $parent_slug.'/', 
    
    	
    	'parent_slug'     => $parent_slug, 
    	
    	'screen_function' => 'swapluisa',
    	'position'        => 1,
    	
    	) );
    }
    add_action( 'bp_setup_nav', 'bpfr_custom_profile_sub_nav' );
    
    					
    	
    		
    
    function swapluisa() {
    	
    	add_action( 'bp_template_title', 'my_groups_page_function_to_show_screen_title' );
    	add_action( 'bp_template_content', 'my_groups_page_function_to_show_screen_content' );
    }
    
    add_action( 'bp_setup_nav', 'my_bp_nav_adder', 50 );
    function my_groups_page_function_to_show_screen_content() {
    	
    	return bp_get_template_part('members/single/swap');
    // (OR THIS???) return bp_get_template_part('wp-content/themes/betheme-child/buddypress/members/single');
    }
    
    function my_groups_page_function_to_show_screen_title() {
    	echo 'My new Page Title';
    }
    
    function luisa_register_template_location() {
       return 'members/single/';
    // (OR THIS????) return 'members/single/';wp-content/themes/betheme-child/buddypress/members/single'
    }
    
    function luisa_template_start() {
    
        if( function_exists( 'bp_register_template_stack' ) )
           bp_register_template_stack( 'luisa_register_template_location' );
    
    }
    add_action( 'bp_init', 'luisa_template_start' );
    

    but dont’work!

    I repeat, surely accidentally pointing to the folder, I can not figure out the exact solution. when i write “OR THIS??” i try but don’t work.

    where am I wrong? thanks

    #262676
    luisa227
    Participant

    sorry 🙁 i don’t know!!!
    I seem to do correctly, but does not work.
    I also for testing entered my files everywhere, but does not find it anywhere !!!

    In my web-site the URL is http://mysite.it/membri/testmember1/activity/swap/ but it says “We are sorry, but the page you are looking for does not exist.”

    I have my swap.php (into there’s only a echo command)’s file in wp-content/themes/child-theme/buddypress/members/single/
    and in bp-custom.php (that is in my plugin folder) I write

    
    
    function my_groups_page_function_to_show_screen_content() {
    	bp_get_template_part('members/single/swap');
    }
    function luisa_register_template_location() {
       return 'wp-content/themes/betheme-child/buddypress/members/single';
    }

    I try also to put the swap.php file into wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single but nothing is happen.

    where am I wrong? thanks

    #262639
    djsteveb
    Participant

    disclaimer, I am not a bp dev, just a long time user, and my knowledge is far from complete.

    1 -each Profile / Member offered a separate gallery or media library?
    This was a problem from the very beginning, and perhaps the biggest problem for bp aside from lousy filter options for the activity stream. Initially it was handled by the ‘bp-album’ plugin – which was later abandoned amidst some drama – rtmedia is kind of the standard for handling this now – but it’s bloated, important functions have gotten expensive, and it’s not well supported in core or themes – it’s terrible at keeping things separated like comments on media and galleries –
    There is a new bp media like experimental thing that looks promising, and some attempts at making placeholders for bp media have been made in the past year, new hooks for bp attachment, etc. Some code has appeared on github showing a great start at possible core bp media handling – but not enough devs on that.

    if you must have media with bp I suggest getting the premium “press permit core” and ask for support in limiting what other users can see in the media library. God forbid you have a problem with users trolling other users – and you have media – as you can purchase the buddyblock plugin which will prevent most abuse user to user, but it does not hook into the separate commenting system that rt-media creates. I strongly encourage you to try the other media plugin and hope that works for what you need before getting stuck with rtmedia and no way to export it’s data to something else.

    2 a cap on how many Mb’s a user is allowed to upload for the total amount of media space
    Wordpress has a setting for this when using multi-site setup – but I think it affects only what gets posted to the user blogs aka sites. I think rtmedia has an optional purchase-able plugin for this if you use their system to allow for the media uploads – not sure if the other competing system has such functionality.

    This is a problem, and a solution should include a way for admins to look at users who have uploaded media, not just by user and space taken up, but also by date. There should be more control for deleting content with various parameters as well. I pity you if you find one day a user has uploaded 100s of photos that violate… terms.. and you have to delete each one at a time. If you find a way to handle this better with rtmedia I’d love for you to share it.

    Currently I have tons of photos and videos that users have uploaded and no good way to look at or remove, aside from going profile to profile and manually checking what shows up there. A better way may exist, I have not found it yet.

    3 – Why do all members have to be Authors in order to be able to Post because this was the only method that worked for me.
    When you say post, that sounds like posting a post to a blog – either their own multi-site blog, or perhaps to a group blog. This is how worpdress is and is great for controlling things with blogs. If you mean a user needs to be an author in order to add to thier “activity stream” aka wall or profile or whatever, I do not think they need to be a blog author in order to do so… “What’s new” activity posts work fine without being a blog author.

    4 – BuddyPress and BB Press how should I set up my .htaccess file – this should be documented somewhere around here. Wish I could tell you, I don’t have any bb press running with any buddypress installs any longer.

    If you don’t want robots to crawl your site, search for forums for making buddypress private – you’ll want to lock down your site with a password required to view anything – if you really want to block bots.. if it’s just the nicer bots you are referring to, like googlebot, yahoo and bigbots – then you can setup a robots.txt with something like

    robots *
    disallow /
    allow index.php

    but I don’t think having the main engines index your index.php is really helpful with most WP themes.. you’d probably be better with “allow /about-us/” for example.. as most wp sites I’ve worked with dont have a good ol’ index.html

    your experiences may vary..

    With BP you eaither have lots of time to code, or you take everything as is for the most part. Auttomatic has not funded bp well since the first dev Andy left – it’s basically abandoned like unwanted bastard child that gets (almost) no support – and has been for years. Instead depending mainly on volunteer contributors that obviously have to do other things like earn a living and pay bills.

    Some great people do amazing things making bp better – I appreciate those that are making the documentation better and fighting the good fight of dealing with all the wp core changes and how they affect bp when it updates – and other work to make it better. However what is seemingly most important to many webmasters and end users may not be on the roadmap for future releases – and finding developers to mod up BP is not as easy as one may hope either.

    custom fixes today may well be broken with future updates, and no one has thought about the laws in Europe for privacy and users being able to export data you have them.. all kinds of things..

    consider bp a huge mix of free code that is very experimental, and in my humble opinion should be removed from the wp plugin repo if automattic is not going to fund it properly – it certainly should not be on the first page view of plugins – anyone installing it likely has no idea what can of worms they are getting into.

    If you are thinking of the future and how you may need to moderate user’s uploads and such, I strongly encourage you to test out the mediapress alternative – but realize in order to get core functionality with bp right now you will have to add on a walled garden from one place or another.. without any import / export options – before you invest too much of your time and your user’s pictures and videos into silos you may never escape, you right as well look into and test out peepso (https://www.peepso.com )- as they seem to have more skin in the game and have made at least some import / export things if I remember correctly.

    again, I am not a bp dev. also I have not used mediapress yet – although I would with a fresh install – rtmedia has not met my expectations, although not a total fail, it is only 60% of what it should be. I have not used peepso yet either. Just a guy that’s been running a few bp installs for a few years, and my knowledge is fuzzy at best. surely @ma.tt, others thoughts, and your mileage may vary.

    #262558

    Topic: New Theme for Free

    in forum Showcase
    buddycore
    Participant

    I’ve been developing a new theme called Centro which supports the core functionality of WordPress & BuddyPress.

    It’s currently still in development but has been released and is available on GitHub.

    You can view a demo on buddycore or here also and a download is available via GitHub.

    Issues will be answered and resolved via GitHub.

    Enjoy! Happy New Year!

    **********************
    Some Features
    **********************
    Colour customizations in wp-admin.
    Support for posts and pages
    Archive pages for search and taxonomies
    Post thumbnails and post formats
    Post comments

    Activity streams
    Member profiles
    – xProfile
    – Settings
    – Friends
    – PMs
    – Notifications
    – Multisite

    Registration
    – Basic member
    — With blog creation

    Responsive
    HTML5
    Cross Browser (IE10+)

    *************************
    Group support will definitely be added in the next updates
    Plan to add support for BBPress and possibly WooCommerce

    All of this depends on how many people are using the theme and feature requests from users.

    BexxBl
    Participant

    The problem:

    I want to display different types of names on the updates in the activity stream like:

    – first name + last name for updates which the user posts on their stream
    – username/display name when there are updates in groups

    i have written the following code:

    /**
     * Get the fullname of the current member in the loop.
     *
     * Full name is, by default, pulled from xprofile's Full Name field.
     * When this field is empty, we try to get an alternative name from the
     * WP users table, in the following order of preference: display_name,
     * user_nicename, user_login.
     *
     * @return string The user's fullname for display.
     */
    function bp_get_member_name_custom() {
    	global $members_template, $bp;
    	// print_r($members_template->member->id);
    	$firstname= bp_get_profile_field_data('field=vorname&user_id='.$members_template->member->id);
    	$lastname= bp_get_profile_field_data('field=nachname&user_id='.$members_template->member->id);		
    	if(!empty($firstname) || !empty($firstname)){
    		$fullname = $firstname.' '.$lastname ;
    		return apply_filters( 'bp_get_member_name_custom',$fullname );
    	}else{
    		$name_stack = array(
    			'display_name',
    			'user_nicename',
    			'user_login'
    		);
    
    		foreach ( $name_stack as $source ) {
    			if ( !empty( $members_template->member->{$source} ) ) {
    				// When a value is found, set it as fullname and be done with it.
    				$members_template->member->fullname = $members_template->member->{$source};
    				break;
    			}
    		}
    		return apply_filters( 'bp_get_member_name_custom', $members_template->member->fullname );
    	}
    	/**
    	 * Filters the display name of current member in the loop.
    	 *
    	 * @since 1.2.0
    	 *
    	 * @param string $fullname Display name for current member.
    	 */		
    }
    
    add_filter( 'bp_get_member_name_custom', 'wp_filter_kses' );
    add_filter( 'bp_get_member_name_custom', 'stripslashes'   );
    add_filter( 'bp_get_member_name_custom', 'strip_tags'     );
    add_filter( 'bp_get_member_name_custom', 'esc_html'       );
    
    // full name to all memebr list
    add_filter('bp_get_member_name','bp_get_member_name_custom');
    	
    	
    // Fullname in group memeber list
    function bp_get_group_member_link_custom() {
    	global $members_template, $bp;
    	
    	$firstname= bp_get_profile_field_data('field=vorname&user_id='.$members_template->member->id);
    	$lastname= bp_get_profile_field_data('field=nachname&user_id='.$members_template->member->id);		
    	if(!empty($firstname) || !empty($firstname)){
    		$fullname = $firstname.' '.$lastname ;
    		return apply_filters( 'bp_get_group_member_link_custom', '<a href="' . bp_core_get_user_domain( $members_template->member->user_id, $members_template->member->user_nicename, $members_template->member->user_login ) . '">' . $fullname . '</a>' );
    	}else{
    		$name_stack = array(
    			'display_name',
    			'user_nicename',
    			'user_login'
    		);
    
    		foreach ( $name_stack as $source ) {
    			if ( !empty( $members_template->member->{$source} ) ) {
    				// When a value is found, set it as fullname and be done with it.
    				$members_template->member->fullname = $members_template->member->{$source};
    				break;
    			}
    		}
    		return apply_filters( 'bp_get_group_member_link_custom', '<a href="' . bp_core_get_user_domain( $members_template->member->user_id, $members_template->member->user_nicename, $members_template->member->user_login ) . '">' . $members_template->member->display_name . '</a>' );
    	}
    	 
    }
    add_filter('bp_get_group_member_link','bp_get_group_member_link_custom');
    
    /**
     * Fetch the display fullname for a user.
     *
     * @param int|string|bool $user_id_or_username User ID or username.
     * @return string|bool The display name for the user in question, or false if
     *                     user not found.
     */
    function bp_core_get_user_displayname_custom( $user_id_or_username ) {
    	if ( empty( $user_id_or_username ) ) {
    		return false;
    	}
    	// return $user_id_or_username;
    	if ( ! is_numeric( $user_id_or_username ) ) {
    		$user_id = bp_core_get_userid( $user_id_or_username );
    	} else {
    		$user_id = $user_id_or_username;
    	}
    	
    	if ( empty( $user_id ) ) {
    		return false;
    	}
    	
    	global $bp;
    	$firstname= bp_get_profile_field_data('field=vorname&user_id='.$user_id);
    	$lastname= bp_get_profile_field_data('field=nachname&user_id='.$user_id);	
    	// return $user_id;
    	if(!empty($firstname) || !empty($firstname)){
    		$fullname = $firstname.' '.$lastname ;
    		return apply_filters( 'bp_core_get_user_displayname_custom', $fullname, $user_id );
    	}else{
    	
    		$display_names = bp_core_get_user_displaynames( array( $user_id ) );
    
    		if ( ! isset( $display_names[ $user_id ] ) ) {
    			$fullname = false;
    		} else {
    			$fullname = $display_names[ $user_id ];
    		}
    		return apply_filters( 'bp_core_get_user_displayname_custom', $fullname, $user_id );
    	}
    	
    }
    add_filter( 'bp_core_get_user_displayname_custom', 'strip_tags', 1 );
    add_filter('bp_core_get_user_displayname_custom');
    add_filter('bp_core_get_user_displayname','bp_core_get_user_displayname_custom');
    
    // Fullname on profile page on other member
    add_filter('bp_displayed_user_fullname','bp_core_get_user_displayname_custom');	
    

    which is creating the following output on my site:

    It was working before updating to WordPress 4.7.

    Can anyone help since i can’t find a solution or error?
    Or am i thinking to complicated?

    i’m currently working on:
    Wordpress Version 4.7.
    Buddypress Version 2.7.4
    BP Xprofile Member Type Field Version 1.0.2

    #262538
    luisa227
    Participant

    Hello, sorry for my bad english but I’m Italian. I want to create a sub-menu under the menu Activity (and this is ok) and view a template’s page when I click on the sub-menu. I can not do this last step: associate the template. If I make an item (not sub) it’s work but if I make the sub-item don’t work.
    I think that the error is on this line:
    bp_core_load_template( apply_filters( 'bp_core_template_plugin','members/single/swap' ) );
    And where do I put the file swap.php? in which folder? Thank you
    This is my code:

    
    function bpfr_custom_profile_sub_nav() {
    	global $bp;
    	$parent_slug = 'activity';
    		
    	//Add subnav item 	 
    	bp_core_new_subnav_item( array( 
    	'name'            => __( 'Swap' ), 
    	'slug'            => 'swap', 
    	
    	'parent_url'      => $bp->displayed_user->domain . $parent_slug.'/', 
    
    	
    	'parent_slug'     => $parent_slug, 
    	//'parent_slug'         => $bp->slug
    	'screen_function' => 'swapluisa',
    	'position'        => 1,
    	
    	) );
    }
    add_action( 'bp_setup_nav', 'bpfr_custom_profile_sub_nav' );
    	
    
    function swapluisa() {
    	//add title and content here - last is to call the members plugin.php template
    	add_action( 'bp_template_title', 'my_groups_page_function_to_show_screen_title' );
    	add_action( 'bp_template_content', 'my_groups_page_function_to_show_screen_content' );
    	 bp_core_load_template( apply_filters( 'bp_core_template_plugin','members/single/swap' ) );
    	
    }
    
    add_action( 'bp_setup_nav', 'my_bp_nav_adder', 50 );
    function my_groups_page_function_to_show_screen_title() {
    	echo 'My new Page Title';
    }
    
    function my_groups_page_function_to_show_screen_content() {
    	echo 'My Tab content here';
    
    }
    #262478
    Andrew
    Participant

    This code allows you to sort activity from most favorited activity to least favorited activity.

    class BP_Loop_Filters {
    	// Constructor
    	public function __construct() {
    		$this->setup_filters();
    	}
    
    	// Filters
    	private function setup_filters() {
    		add_filter( 'bp_activity_get_user_join_filter', array( $this, 'order_by_most_favorited' ),     10, 6 );
    		add_filter( 'bp_activity_paged_activities_sql', array( $this, 'order_by_most_favorited'),      10, 2 );
    		// Maybe Fool Heartbeat Activities!
    		//add_filter( 'bp_before_activity_latest_args_parse_args', array( $this, 'maybe_fool_heartbeat' ), 10, 1 );
    	}
    	
    	/**
    	 * Ninja Warrior trick to reorder the Activity Loop
    	 * orders by most likes highest to least
    	 */	 
    	public function order_by_most_favorited( $sql = '', $select_sql = '', $from_sql = '', $where_sql = '', $sort = '', $pag_sql = '' ) {
    		$r = $select_sql;
    		if ( empty( $r['meta_query'] ) || ! is_array( $r['meta_query'] ) ) {
    			return $sql;
    		} else {
    			$meta_query_keys = wp_list_pluck( $r['meta_query'], 'key' );
    			if ( ! in_array( 'favorite_count', $meta_query_keys ) ) {
    				return $sql;
    			}
    			preg_match( '/\'favorite_count\' AND CAST\((.*) AS/', $sql, $match );
    			if ( ! empty( $match[1] ) ) {
    				$sql = str_replace( 'ORDER BY a.date_recorded', 'ORDER BY '. $match[1] .' + 0', $sql );
    			}
    		}
    
    		return $sql;
    	}
    }
    
    // 1, 2, 3 go !
    function bp_loop_filters() {
    	return new BP_Loop_Filters();
    }
    add_action( 'init', 'bp_loop_filters' );

    with query args like this:

    	// order activity by favorited. 
    	$query_args = array(
    		'meta_query' 	=> 	array(
    			array(
    				'key'     => 'favorite_count',
    				'value'   => 1,
    				'type'    => 'numeric',
    				'compare' => '>='
    			),
    		),
    	);

    Does anyone know how to add a new parameter argument for this? instead of favorite_count, I would like something like orderby_favorite_count.

    The reason is, I’ve got custom pages where I like to manipulate the activity loop in a variety of ways, and if I don’t use that class BP_Loop_Filters, then this query args code:

    	$query_args = array(
    		'meta_query' 	=> 	array(
    			array(
    				'key'     => 'favorite_count',
    				'value'   => 1,
    				'type'    => 'numeric',
    				'compare' => '>='
    			),
    		),
    	);

    will get activities that have been favorited at least x amount of times, but ordered by date_recorded.

    So I would like to be able to
    1. order activities from most favorited, to least favorited, and
    2. order activities by date with activities that has been favorited at least x amount of times.

    At the moment I can only do one or the other.

    Any help appreciated.

Viewing 25 results - 176 through 200 (of 831 total)
Skip to toolbar